Ask Your Question

Unable to transform object from namespaced frame 'ns/base_link' to planning frame 'base_link'

asked 2021-08-19 04:35:24 -0500

sniegs gravatar image

updated 2021-09-13 07:06:42 -0500

I have a two robot system that is prefixed in separated namespaces so each robot can work independently, but they exist in a single workspace in a connected tf_tree. I'm working in Linux 18 with ROS Melodic, C++.

I run separate move groups for each robot in their own namespace and run C++ code in the same namespace for each robot. Every time a path is planned, I get this warning in the move_group.launch terminal for every frame of the robot.

[ WARN] [1629361686.174205495]: Unable to transform object from frame 'ur5/base_link' to planning frame 'base_link' ("base_link" passed to lookupTransform argument target_frame does not exist. )

Each robot is namespaced and prefixed at launch, so the name base_link only exists in the .srdf's for each robot, but when executing the command move_group.getPlanningFrame() it displays base_link so I'm assuming, inside the namespace, the frames aren't namespaced and for some reason it's searching for them?


When computing a Cartesian path, I get a similar error

[ERROR] [1629898925.139134667]: TF Problem: "base_link" passed to lookupTransform argument source_frame does not exist.
[ERROR] [1629898925.139152001]: Error encountered transforming waypoints to frame 'base_link'

and that blocks code from being executed.

Are there any ways to prefix/namespace the planning frame, perhaps in code or any other ways to fix this?

UPDATE #2 tf_tree (the second robots tree is the same, but with a different namespace, both connected by the world frame) image description

rqt_graph for the same setup image description

edit retag flag offensive close merge delete


What's the output of rosrun tf view_frames?

fvd gravatar image fvd  ( 2021-08-26 03:48:03 -0500 )edit

@fvd I don't think I can add the tf_tree image, but the tree is connected and sort of looks like this:

                  /         \ 
    ur5/base_link           ur5e/base_link
            |                      |
          etc.                   etc.

the world frame is added by a static_transform_publisher at ...setup.launch to connect the two namespaced robot tf_trees. As far as I know the problem might be that move_group is searching for base_link as the planner_id, but it should be looking for ur5/base_link.

sniegs gravatar image sniegs  ( 2021-08-26 07:20:11 -0500 )edit

I upvoted your question so you should have enough reputation to upload the image. The planning frame might be an issue, yes.

fvd gravatar image fvd  ( 2021-08-26 08:32:44 -0500 )edit

I added tf_tree and rqt_graph output

sniegs gravatar image sniegs  ( 2021-08-26 08:50:50 -0500 )edit

The TF frames are not namespaced, so yes you should try setting your PlanningFrame to ur5/base_link

fvd gravatar image fvd  ( 2021-08-26 08:55:14 -0500 )edit

do you have any idea how to do that? As far as I know there is no setPlanningFrame in the c++ API and I can't find it in the launch files. But also, when I would launch the second robot, how would they connect if the TF frame were namespaced?

sniegs gravatar image sniegs  ( 2021-08-26 08:58:01 -0500 )edit

I went with a completely different solution for namespacing, where this question is no longer relevant, so I'm not sure if I should post it as an answer or not.

sniegs gravatar image sniegs  ( 2021-09-13 02:16:54 -0500 )edit

Surely that would be better than leaving the question unanswered.

Sorry for not answering your comment, by the way. I did not have a good response ready, and then I lost sight of this.

fvd gravatar image fvd  ( 2021-09-13 02:29:16 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2021-09-13 07:05:52 -0500

sniegs gravatar image

I ended up using a completely different solution for a multi-robot setup, so this error is no longer relevant, but I'll write it as an answer here!

Instead of using tf_prefix in it's existing form and robot_state_publisher for namespacing my robot frames, I set the prefix variable in my .xacro files for both robots. This raises a couple of issues, but they can be solved.

  1. You have to rename all the joints and frames in your package to match your prefixed .xacro (this also means renaming them in the .srdf, kinematics.yaml, joint_states.yaml etc.;
  2. I didn't want to edit the controller in the ur driver, so I had to copy it and rename the joints to the new, namespaced ones in it, then load it as a rosparam in the ur_controller.yaml
  3. ur_hardware_interface doesn't return these namespaced joints, so a publisher for renaming them had to be made and the joint_state_publisher remapped to the new publisher

After this is done, no problems arise with moving both of the robots simultaneously with move group.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2021-08-19 04:35:24 -0500

Seen: 192 times

Last updated: Sep 13 '21