ROS2 equivalent for tf_prefix or tf_remap
I am trying to create a multi-robot setup with turtlebot3 on ROS2. Most resources I have found online use ROS1.
My issue is my SLAM node does not create it's map to odom transform under the namespace of robot1 while all the other transforms generated by turtlebot3 are properly created under robot1.
I thought tf_prefix or tf_remap might do the trick but they don't seem to be supported for ROS2. How can I create this map->odom transform with "robot1" prefix?
I see this piece of code in nav2_gazebo_spawner.py which seems like what I need:
for plugin in root.iter('plugin'):
if 'ros_diff_drive' in plugin.get('filename'):
# The only plugin we care for now is 'diff_drive' which is
# broadcasting a transform between`odom` and `base_footprint`
break
if args.robot_namespace:
ros_params = plugin.find('ros')
ros_tf_remap = ET.SubElement(ros_params, 'remapping')
ros_tf_remap.text = f'/tf:=/{args.robot_namespace}/tf'
Do I need to do something similar in my SLAM node?
Alternatively: I see a remappings parameter when launching a Node. I tried remapping /map to robot1/map but it does not result in any change in behavior.