The pointcloud data generated by the depth camera in gazebo_ros_camera plugin is not organized pointcloud. The height value is always 1 and width is total size of pointcloud data
To Reproduce
Steps to reproduce the behavior:
Install navigation2 package for foxy and launch ros2 launch nav2_bringup tb3_simulation_launch.py
Check ros2 topic echo /intel_realsense_r200_depth/points width and height values. Height is 1
Expected behavior
With the organized pointcloud data height should be 240 and width is 320 as per the camera_info
Environment (please complete the following information):
Description
The pointcloud data generated by the depth camera in gazebo_ros_camera plugin is not organized pointcloud. The height value is always 1 and width is total size of pointcloud data
To Reproduce
Steps to reproduce the behavior:
ros2 launch nav2_bringup tb3_simulation_launch.py
ros2 topic echo /intel_realsense_r200_depth/points
width and height values. Height is 1Expected behavior With the organized pointcloud data height should be 240 and width is 320 as per the camera_info
Environment (please complete the following information):
Additional context
This issue happens because of resize call from here https://github.com/ros-simulation/gazebo_ros_pkgs/blob/foxy/gazebo_plugins/src/gazebo_ros_camera.cpp#L712 . The rezise() function changes height to 1 https://github.com/ros2/common_interfaces/blob/foxy/sensor_msgs/include/sensor_msgs/impl/point_cloud2_iterator.hpp#L126. Replacing this line with this
impl_->cloud_msg_.data.resize(_width * _height * impl_->cloud_msg_.point_step);
publishes organized pointcloud without any issues.