Zed2i-imu transform to add to robot urdf

I am trying to find ‘rpy’ to provide to my urdf. Already got the ‘xyz’ (-0.002 -0.023 0.000) coordinates using logger by enabling publish_tf and echo. Any thoughts on this ?
AS my first post I could not attach multiple media so added reply to myself for the tf2 echo.
image

thanks
Ani

Hi @anath93
Welcome to the Stereolabs community.

You can use tf2 to retrieve RPY from a quaternion:

Thank you @Myzhar for welcome and reply.

Is there anyway to get that info from CLI the factory default measurements as I am going to hard code this into my URDF and disable publish_tf ? Or do I need to write a simple program to retrieve that first as you mentioned above using tf2 ? OR would you have values for Zed2i already which I can use ?

Thanks
Ani

There are online converters from quaternions to RPY, you simply enter the values you got from the CLI:

@Myzhar Thank you, that was quite easy to do. This is the resulting, I got below. I know for a fact that IMU is located towards left lens but to the precise location wise I would appreciate if you can confirm please.

<link name="${name}_imu_link" />
<joint name="${name}_imu_link_joint" type="fixed">
  <parent link="${name}_left_camera_frame"/>
  <child link="${name}_imu_link"/>
  <origin xyz="-0.002 -0.023 0.000" rpy="0.000 -0.000 0.000" />
</joint>

1 Like

The position is good. Didn’t you set the orientation from the quaternion?

@Myzhar I had just input the Camera-IMU translation vector which I got in logger before disabling the IMU tf on zed2i yaml file which gave me xyz for the position relative to parent and yes I did apply rpy from quaternion by converting to euler’s angle in radians to input into my urdf resulting in below.

Quaternion vector was [-0.002, -0.000, -0.004, 1.000]
Translation from Zed2i logger [-0.002 -0.023 0.00022]

   <link name="${name}_imu_link" />
    <joint name="${name}_imu_link_joint" type="fixed">
      <parent link="${name}_left_camera_frame"/>
      <child link="${name}_imu_link"/>
      <origin xyz="-0.002 -0.023 0.00022" rpy="-0.004 0.00 -0.008"/>
    </joint>

1 Like

@Myzhar Another quick question, is there anyway to add Namespace ? Except to alter the camera_name ?

You can simply include the launch file into another launch file and use the group keyword to create a new namespace or modify the original launch file:
https://www.stereolabs.com/docs/api/classsl_1_1Mat.html#accab3cb8c395f6b32c897e549fef78a8

@Myzhar Thank you !!

1 Like

I have noticed after updating the SDK to 4.0.6, the IMU tf keeps getting published even after Publish_tf is false as I am publishing using my robot urdf. Some screenshots are below

image

image

Tried clearing the workspace and rebuilding, but same result.