code-iai / iai_kinect2

Tools for using the Kinect One (Kinect v2) in ROS
Apache License 2.0
879 stars 519 forks source link

Add a convert script from calib_pose.yaml to urdf format #427

Closed eisoku9618 closed 6 years ago

eisoku9618 commented 7 years ago

I would like to appply the result of the extrinsics calibration to my urdf, but the format of calib_pose.yaml is different from the one of urdf.

calib_pose.yaml urdf
rotation 3x3 matrix rpy
parent / child no description need to specify

So I added a utility script to convert calib_pose.yaml to urdf.

command

./convert_calib_pose_to_urdf_format.py -f ../../kinect2_bridge/data/299150235147/calib_pose.yaml

output

    <joint name="kinect2_rgb_joint" type="fixed">
      <origin xyz="-0.0520171521241 -0.000240451181123 0.000294544694029" rpy="0.00178209349915 -0.000222819786098 -0.00114226514527"/>
      <parent link="kinect2_rgb_optical_frame"/>
      <child link="kinect2_ir_optical_frame"/>
    </joint>