How to define a static_transform_publisher between two frames with a same child frame?

asked 2018-07-12 05:11:17 -0500

Hi everybody, I'm using ROS Indigo on Ubuntu 14.04 LTS with the package loam_velodyne and trying to run a static_transform_publisher between two frames (frame_velodyne and frame_imu) with the same child frame (map) so that I can get the correct offset, orientation, velocity, and acceleration with respect to one of my parent frames (frame_velodyne). My tree looks like this:

frame_velodyne/map
frame_imu/map

I tried to add a static_transform_publisher to the loam_velodyne.launch file so that it transformed my imu data when my bag file was played as follows:

<node pkg="tf2_ros" type="static_transform_publisher" name="tf_velodyne_to_imu" args="1 2 3 0.1 0.2 0.3 frame_velodyne frame_imu" output="screen"/>

but it didn't work, so I am wondering if this is the right procedure.

Thanks in advance!

edit retag flag offensive close merge delete

Comments

could you explain what are you actually trying to do, from what it looks like you have 2 different tf trees, and you want to make one tree, am I correct?

Choco93 gravatar image Choco93  ( 2018-07-12 07:52:15 -0500 )edit

I would like to use the orientation, velocity, and acceleration from my IMU device referred to frame_velodyne in the loam_velodyne algorithm. I thought that adding a static_transform_publisher between frame_velodyne and frame_imu would solve the problem, but it didn't work for me.

laizwithzed gravatar image laizwithzed  ( 2018-07-12 08:31:31 -0500 )edit

if you just want the same orientation as you have of IMU at any moment then you can simply add static transform where IMU is parent and velodyne is child, with zero rotations, so whatever rotation you get in IMU, velodyne will also get that.

Choco93 gravatar image Choco93  ( 2018-07-12 09:00:14 -0500 )edit
1

If you want to use those values in algorithm, then better go into your node, and subscribe to IMU topic and use those values accordingly.

Choco93 gravatar image Choco93  ( 2018-07-12 09:01:03 -0500 )edit

Actually, there is a translation and rotation between those coordinate systems and static_transform_publisher is not transforming my IMU data. I'll change the code manually.

laizwithzed gravatar image laizwithzed  ( 2018-07-12 09:19:53 -0500 )edit