I started the simulation using make px4_sitl gz_x500_depth and able to control the simulated drone using QGroundControl as well.
I used the ros_gz_bridge to publish camera and point cloud data.
ros2 run ros_gz_bridge parameter_bridge /camera@sensor_msgs/msg/Image@ignition.msgs.Image /camera_info@sensor_msgs/msg/CameraInfo@ignition.msgs.CameraInfo /depth_camera/points@sensor_msgs/msg/PointCloud2@gz.msgs.PointCloudPacked /depth_camera@sensor_msgs/msg/Image@ignition.msgs.Image
I added objects infront of the camera and able to visualize the images in RVIZ2.
I added the PointCloud2 topic into RVIZ2 display but there is no depth point cloud displayed. I am seeing a warning message that says “Fixed Frame No tf data. Actual error: Frame [base_link] does not exist” in the Global Status widget.
No I did not. Honestly, I feel like Gazebo Classic just runs better on my machine. I was able to get depth data and raw rgb with it, but the issue now is, I cannot run multiple UAVs at a time.
Thanks for your response! Now I think I’ve discovered my problem,The key lies in the version issues of Gazebo and ros_gz-bridge, my ros2 version is humble and my gazebo version is harmonic.Instruction: sudo apt install ros-humble-ros-gzharmonic should be used ,but I installed ros-humble-ros-gz incorrectly.
i also got the same problem when i used different custom sdf file to run the depth simulation , and got tf2 error , rviz2 uses default frame as “map” u have to find correct tf2 frame and change it i dont know how to find it , but from my sdf file i added the camera link address like “base_link/depth_camera_link” and after that i was able to visualize the depth data in rviz2