Hello,
I am using a depth camera for point cloud.
I added a ROS2CameraHelper and set the type of Inputs to depth_pcl.
When I get point cloud topic, it says like below.
header:
stamp:
sec: 5
nanosec: 83333598
frame_id: camera_frame
height: 1
width: 921600
fields:
- name: x
offset: 0
datatype: 7
count: 1
- name: y
offset: 4
datatype: 7
count: 1
- name: z
offset: 8
datatype: 7
count: 1
is_bigendian: false
point_step: 12
row_step: 11059200
data:
- 241
- 217
- 2
- 193
- 220
I think that the height and width value is not correct.
It says height is 1 and width is 921600. (width 1280 x height 720 = 921600?)
Is there any way to fix this problem?
I think this is expected, the point cloud data is not an image, but a linear array of points.
Ok. depth_pcl publishes 1d unordered point cloud data.
Is it possible to set camera to publish 2d image-like point cloud data?
sensor_msgs/PointCloud2 Documentation
sensor_msgs/PointCloud2 Message
File: sensor_msgs/PointCloud2.msg
Raw Message Definition
# This message holds a collection of N-dimensional points, which may
# contain additional information such as normals, intensity, etc. The
# point data is stored as a binary blob, its layout described by the
# contents of the "fields" array.
# The point cloud data may be organized 2d (image-like) or 1d
# (unordered). Point clouds organized as 2d images may be produced by
# camera depth sensors such as stereo or time-of-flight.
# Time of sensor data acquisition, and the coordinate frame ID (for 3d
# points).
Header header
# 2D structure of the point cloud. If the cloud is unordered, height is
# 1 and width is the length of the point cloud.
uint32 height
uint32 width
# Describes the channels and their layout in the binary data blob.
PointField[] fields
bool is_bigendian # Is this data bigendian?
uint32 point_step # Length of a point in bytes
uint32 row_step # Length of a row in bytes
uint8[] data # Actual point data, size is (row_step*height)
bool is_dense # True if there are no invalid points
Its not possible currently, will file a feature request to see if we can support this in the future