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

How to change the position of "base_link" frame?

asked 2017-03-02 11:13:47 -0500

utkarshjp7 gravatar image

For navigation, the base_link should be placed at the rotational center of the robot.

My robot is a rectangular shaped robot, whose rotation center is at the front.

How do I change the location of "base_link" from its physical center to its front?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-03-02 12:24:52 -0500

croesmann gravatar image

updated 2017-03-02 12:27:14 -0500

The robot frame is usually published by your robot driver which integrates wheel encoder values (or in addition with a gyro/imu) in order to broadcast the relative transformation between odom and base_link. The location of base_linkw.r.t. the robot body is driver specific here.


  • You could change the driver code, but you would need to compile from source and update the package manually in the future.
  • If the driver has the option to change the base_link name, rename base_link and add a static_transform_publisher to your robot launch file in order to create a new base_linkat the rotational center.
  • Create a new link, e.g. nav_link at the rotational center with a static_transform_publisher in your robot launch file. Configure the navigation stack accordingly (the base frame can be set in the global and local costmap parameters). I haven't tried this option yet. Ideally, planners should adhere to the base frame specification in all internal transformations.

Some drivers are only publishing joint states and utilize a robot_state_publisher to provide the corresponding robot frames from a robot model description, usually a URDF file. Sometimes xacro is utilized to generate URDF files. In that case, you can adjust the robot model in one of the following ways:

  • Move the current base_link frame to the rotational center and adjust all inherited transformations (children frames) as well.
  • Choose a different name for the current base_link frame and add a new base_linkat the rotational center (e.g. as a child frame from the old one).
  • Create a new link, e.g. nav_link at the rotational center. Refer to option 3. above for further comments.
edit flag offensive delete link more


Thank You for this great explanation. I have full access to the driver code. What exactly I need to change in the driver code? the transform between odom and base_link??

utkarshjp7 gravatar image utkarshjp7  ( 2017-03-02 12:41:07 -0500 )edit

yes, you can add an offset to that transformation in order to shift base_link. But just for the record: it is not the best-practice solution as mentioned above ;-)

croesmann gravatar image croesmann  ( 2017-03-07 07:31:33 -0500 )edit

Question Tools



Asked: 2017-03-02 11:13:47 -0500

Seen: 2,574 times

Last updated: Mar 02 '17