depthai-ros icon indicating copy to clipboard operation
depthai-ros copied to clipboard

Ros Coordinate System And OAK Coordinate System Not Matching/

Open Mani-Radhakrishanan opened this issue 2 years ago • 14 comments

https://www.ros.org/reps/rep-0103.html

The above Standards Followed??When we integrate the system with ros (Moveit) the target(Aruco) is in random position.

Mani-Radhakrishanan avatar Nov 03 '22 15:11 Mani-Radhakrishanan

Can you add more details on where, what and which frames are not matching?

saching13 avatar Nov 03 '22 15:11 saching13

We are using Moveit for robot arm calibration.The target frame is Aruco Marker.We are following standard ROS coordinate system in the our URDF. But the image coming out of depthai is not aligning with ROS Coordinate System(RIGHT HAND COORDINATE SYSTEM) .We are not facing the issue with realsense..

Is there anywhere in the depthai code mentionded about coordinate system ??

Mani-Radhakrishanan avatar Nov 03 '22 16:11 Mani-Radhakrishanan

We are using Moveit for robot arm calibration.The target frame is Aruco Marker.We are following standard ROS coordinate system in the our URDF. But the image coming out of depthai is not aligning with ROS Coordinate System(RIGHT HAND COORDINATE SYSTEM) .We are not facing the issue with realsense..

Is there anywhere in the depthai code mentionded about coordinate system ??

If you are referring to the depth frames. It is in mm from the DepthAI. We need to change that to meters for the ROS. And focal length is in pixel units.

saching13 avatar Nov 04 '22 01:11 saching13

photo_6280413635243258589_x

Can You explain What is the Coordinate system mentioned in the Image??? Is there a Convention followed on coordinate frame???

Mani-Radhakrishanan avatar Nov 04 '22 12:11 Mani-Radhakrishanan

Hi, you can view all the frames in Rviz by enabling TF option. You can find that for a camera there is a regular frame and an optical frame, here is an example: image optical frame represents image in the opencv format. This is a similar convention to the one that Gazebo uses. We'll be probably adding an option to switch between the two, but for now you can either republish the image in different frame or modify the code to switch to the frame needed.

Serafadam avatar Nov 07 '22 16:11 Serafadam

I did the static transform between the two coordinate frame using tf frames in ROS

dai_rgb_camera_optical_frame to camera_link (in my robot)

Also edited the code to match my link name in urdf. But still the detected target(Aruco) is in weird place.

https://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/OWENS/LECT9/node2.html We have followed the same convention in our code as per the above link.

Is anywhere coordinate frame convention is defined in depthai???

Also Can you explain the coorindate frame mentioned in the PCB???

Mani-Radhakrishanan avatar Nov 08 '22 02:11 Mani-Radhakrishanan

dai_rgb_camera_optical_frame to camera_link (in my robot)

You should do it to the base of the camera.

Also Can you explain the coorindate frame mentioned in the PCB???

This is IMU mounting orientation of default. I think it can be changed. Let me get back to you on this.

saching13 avatar Nov 09 '22 03:11 saching13

@Mani-Radhakrishanan Does something like this work ?

saching13 avatar Nov 09 '22 12:11 saching13

No it is working for me. So which point is the frame of reference in urdf ,RGB or One of the Stereo Camera. (i.e) Which camera point is reference for XYZ Coordinates ???Currently I am taking RGB as my reference point but it seems to be there is 37.5 shift in X ???Is it anything to do with Right Stereo Camera?

Mani-Radhakrishanan avatar Nov 13 '22 06:11 Mani-Radhakrishanan

Base mounting point should be oak-d-frame. Could you show us your TF tree? Or a screenshot from rviz, maybe it could better illustrate what we are dealing with.

Serafadam avatar Nov 14 '22 12:11 Serafadam

Screenshot from 2022-11-15 19-46-53 why the target frame is in weird pose? I am using rgb_stero_node.launch .I did the static transform between the dai_rgb_camera_optical_frame to camera_link in my robot....Getting this weird pose.

I just came to know that stereo_inertial_node.launch is the proper one??Is it right ?

Mani-Radhakrishanan avatar Nov 15 '22 14:11 Mani-Radhakrishanan

Hi, yes, stereo_inertial_node is the one that is most up to date, can you post the results when running it? Also, can you try linking oak-d-frame and camera_link?

Serafadam avatar Nov 16 '22 10:11 Serafadam

I tried with stereo_inertial_node still I am getting the same result as I mentioned in above query.Why the target position is different location ??? I am putting the target in front but it shows in the side ??

The Frame_Id is now oak_rgb_camera_optical_frame .I also tried attaching oak-d-base_frame to my robot..Still the pose of target is same loaction.Any suggestion is appreciated

201942076-fbe6b125-8fe3-45c3-8014-7d8b7a1835aa

Mani-Radhakrishanan avatar Nov 17 '22 07:11 Mani-Radhakrishanan

photo_6280413635243258589_x

Can You explain What is the Coordinate system mentioned in the Image??? Is there a Convention followed on coordinate frame???

thanks for the picture! yes, it looks like this is back of the PCB on which IMU is mounted in my OAK-D Pro W.

so IMU coordinate frame is: x - down, y - rght, z - backwards if looking at the camera from behind

asimonov avatar Sep 19 '23 14:09 asimonov