# Handling changing frames in ROS

I have a robot that is inherently symmetric in nature. Sometimes one side is the base while the other is the end-effector and vice versa. This 'mode' can change while the robot is moving around.

Judging from the URDF tutorials wiki, it looks like the commonly used URDF package in ROS is static and so the base of the robots is assumed to stay the base. Are there ways to get around this so that I can still use the TF package?

• What ROS nodes do you want to use? Jun 5 '17 at 21:27
• What do you mean by that? A publisher node that reads the joint states and a listener node that writes to the servos. Other nodes are flexible. Jun 10 '17 at 16:20

Your system looks similar to walking robots, like humanoids. You may set the base as an other joint/link, that in your case would your symmetry center. In the case of humanoids it is usually the pelvis, where all the kinematics chains originate.

All the rest is only software, you never have to touch your URDF. You will need to remember in which mode your robot is. You'll also need something to keep your odometry (if needed) up to date when it switches. But I guess you already have done this.

You may have a look to ROS packages for humanoid robots, like Nao.

Possible approaches:

1: Choose one end as the primary end, and set its position from your own calculations. Don't use URDF and write your own robot state publisher.

2: Maintain two models and switch between them. You publish which TF chain is valid, downstream nodes that care use that to choose which to use.

• When using two models, how would you switch between them? Jun 8 '17 at 23:56

Always save the last transforms and whenever the base_link changes publish all the transforms using saved ones accordingly.