stereolabs / zed-ros-wrapper

ROS wrapper for the ZED SDK
https://www.stereolabs.com/docs/ros/
MIT License
447 stars 391 forks source link

Point_cloud/cloud_registered corrodinate system #879

Closed amoghv17 closed 1 year ago

amoghv17 commented 1 year ago

Preliminary Checks

Description

I am using a ZED2i camera and was trying to implement a local planner using the /odom and /point_cloud/cloud_registered topics that is being published by the zed camera. The co-ordinate system of the point cloud is "COORDINATE_SYSTEM_RIGHT_HANDED_Y_UP" this causes the planner to generate /cmd_vel values on a different co-ordinate than the one the robot is using. The robot uses "COORDINATE_SYSTEM_RIGHT_HANDED_Z_UP_X_FWD". I want to change the coordinate system of the point cloud generated by the zed camera to the second coordinate system. I was not able to find the initialization of the coordinate systems anywhere in the .yaml, .urdf and src files. Could you please tell me how to change the coordinate system of the generated point cloud only and not disrupt the other rostopic's coordinate systems?

Steps to Reproduce

  1. Run the zed-pcl application. and you can see the Coordinate system of the zed point cloud like this - pcl

  2. ...

Expected Result

To have the coordinate system of the pointcloud to be same as the camera tf.

Actual Result

The coordinate system of the point cloud generated is different from the ROS coordinate confiuration pcl

ZED Camera model

ZED2i

Environment

OS: UBUNTU 20.04
ZED_SDK: 3.8.2 FOR UBUNTU 20

Anything else?

No response

Myzhar commented 1 year ago

Hi @amoghv17 The ZED ROS Wrapper publishes the point cloud in ROS coordinate, so X FWD, Z UP: https://github.com/stereolabs/zed-ros-wrapper/blob/master/zed_nodelets/src/zed_nodelet/src/zed_wrapper_nodelet.cpp#L233

Why do you say its COORDINATE_SYSTEM_RIGHT_HANDED_Y_UP?

amoghv17 commented 1 year ago

I don't think it is COORDINATE_SYSTEM_RIGHT_HANDED_Y_UP, is the point cloud generated from the zed_left_optical frame and zed_right_optical frame? because the tfs of both these are different comapred to the base_link and all the other topics of the camera. optical

Myzhar commented 1 year ago

I don't think it is COORDINATE_SYSTEM_RIGHT_HANDED_Y_UP, is the point cloud generated from the zed_left_optical frame and zed_right_optical frame? because the tfs of both these are different comapred to the base_link and all the other topics of the camera. optical

They reflect the ROS specification, but if you look at the frame of the point cloud message you can notice that is the correct. You can start the Rviz demo to check it: ros launch zed_display_rviz display_zed2i.launch

amoghv17 commented 1 year ago

frames The tf topic does not display the frame of the pointcloud. Is there any other way to look at it?

Myzhar commented 1 year ago

I meant that if you open Rviz with the default setting you can see that the point cloud is correctly displayed in front of the camera. If the TF frame is incorrect, then the point cloud has been upside down or placed in the wrong position. If you want to know the frame id of the point cloud messages you can start rqt and use the Topic Monitor plugin to verify the frame id field in the header of the topic.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment otherwise it will be automatically closed in 5 days

rohitmenon86 commented 1 year ago

I am using the ZED2i camera. The depth image and the rect image have frame_id = left_camera_optical_frame but only the point cloud is is in left_camera_frame. Is there a parameter I can change to have the cloud published in the optical frame?

Myzhar commented 1 year ago

@rohitmenon86 please do not reply to closed issues. GithHub is only for bug reporting and feature requests. For questions please write a post to the Stereolabs community forum