ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

From my understanding, your LIDAR frame (laser) is in the opposite direction when compared to your base frame (base_link). The solution is, as you've mentioned, to rotate the frame by 180 degrees.

You can do this by changing the values in the static transform publisher that you've written. The tf publisher accepts arguments in the format - 'x y z yaw pitch roll' with ypr values in radians. Assuming your Z axis is facing upwards, the rotation about the Z axis corresponds to a yaw movement rotation of 3.1416 radians, and that needs to be added to the tf argument.

Simply put, replace the line you added :

node pkg="tf" type="static_transform_publisher" name="base_to_laser_broadcaster" args="0 0 0 0 0 0 base_link laser 100"

with

node pkg="tf" type="static_transform_publisher" name="base_to_laser_broadcaster" args="0 0 0 3.1416 0 0 base_link laser 100"

Hoping this helps