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

Well, you may need to check the tf package.

tf is a package that lets the user keep track of multiple coordinate frames over time. tf maintains the relationship between coordinate frames in a tree structure buffered in time, and lets the user transform points, vectors, etc between any two coordinate frames at any desired point in time.

For example, the origin of base_link frame is at the center of the robot, and the laser_frame is 10cm to the base_link. The tf can maintain the relationship between base_link and laser_frame. When you get the obstacle distance to the laser, you can calculate that distance to your robot center by listening to the tf base_link->laser_frame. And you can setup the tf with simple static_transform_publisher, for example, in the launch file, you can add this:

   <launch>
       <node pkg="tf" type="static_transform_publisher" name="base_to_laser" args="0.1 0 0 0 0 0 base_link laser_frame 50" />
   </launch>

And then you need to write a ROS node to listen to the tf base_link->laser_frame and calculate what you want.