Multiple problems when configuring MiR200 with ur5 using MoveIt in Gazebo

asked 2020-02-19 15:33:06 -0500

Heenne gravatar image

updated 2022-01-22 16:10:21 -0500

Evgeny gravatar image


for the last weeks I am trying to get a MiR200 and a ur5 to work in Gazebo. Special is, I need to spawn multiple robots at the same time, so I am working with a namespace (robot1_ns in this case) and a tf_prefix (robot1_tf in this case). First of all I want to get one instance working with namespaces and tf_prefix, but in between I am testing with multiple robots in separated namespaces and tf_prefixes. So much for the goal and how I am trying to accomplish it.

I configured MoveIt for the urdf-file with the robot platform and UR5 on top of it with this tutorial: MoveIt Tutorial

I am running ROS Melodic on Ubuntu 18.04 with these universal robot packages. If there are any other information needed, please let me know. I will respond as fast as possible and thanks in advance for reading.

Following errors are occuring that I cant seem to solve:

1.When starting rviz I get multiple Warnings like this (this is only a snippet from all the warnings I receive):

[ WARN] [1582125739.944783654, 24.706000000]: Unable to transform object from frame 'robot1_tf/tool0' to planning frame 'base_footprint' ("base_footprint" passed to lookupTransform argument target_frame does not exist. )

[ WARN] [1582125739.944799672, 24.706000000]: Unable to transform object from frame 'robot1_tf/odom' to planning frame 'base_footprint' ("base_footprint" passed to lookupTransform argument target_frame does not exist. )

[ WARN] [1582125739.944814607, 24.706000000]: Unable to transform object from frame 'map' to planning frame 'base_footprint' ("base_footprint" passed to lookupTransform argument target_frame does not exist. )

I really don't know where the base_footprint is comming from, its in none of the configuration files. My TF-tree is also fine (see this picture). So why is it selecting one frame with the tf_prefix and one without it? (I think the warnings are printed two times and everytime I tell the arm to "plan and execute")

2.When RVIZ is started I see the following in the window: RVIZ screenshot. The interactive marker is missing. When launching the moveit configuration from the universal robot the interactive marker is shown. It is also shown when launching the MiR200 and UR5 combination without a namespace. I suspect the first point to also be the reason for this problem, but this is just a guess. I can move the robot with the predefined poses (it moves in RVIZ and Gazebo), but the marker never appears.

3.I am trying to control the arm with a c++ node. Therefore I followed this tutorial from the MoveIt website for the C++ Interface.

I copied line 48 - 158 and changed the planning group and the visualization tools link that is specified there. Also I switched to the RTTConnect in the ompl_planning.yaml with default_planner_config: "RTTConnect" because I hearded people had a much better experience with this planner.

Then I executed the code.

Problem is, that most of the time the code executes with each no trajectory found (not shown in RVIZ) or it found a trajectory and ... (more)

edit retag flag offensive close merge delete



I am not an expert on Move it but it seems to me that when you load the robot description and append both, the namespace and tf_prefix, you are changing every frame name, thus all other components like planning are listening to default tf names like base_footprint and not robot1/base_footprint.

Maybe the problem is that you are launching gazebo and ros control with no namespace.

Weasfas gravatar image Weasfas  ( 2020-02-20 07:15:45 -0500 )edit

Thanks for your comment. Gazebo and the map is the only thing without a namespace but it must be without a namespace in my opinion, because every robot must access the map from and so on. The controllers like joint_state_controller, robot_state_publisher etc. are spawned in the namespace of the robot.

Heenne gravatar image Heenne  ( 2020-02-21 02:39:17 -0500 )edit

Hi @Heenne,

What you are saying is true, but you will need to find and debug what component in your architecture is listening to the base_footprint frame and not the robot1/base_footprint. Because for me the problems lays on the fact that you have an unconnected tf tree. Once you solve that issue you will be able to check other things.

Maybe the problem is you did not set propely your frame or planning group in your code or that you have a msgs topic that some nodes of your set up listen with an unexpected frame_id.

As I said I am not an expert in Move it. Maybe someone on this forum can be more helpful.

Weasfas gravatar image Weasfas  ( 2020-02-22 07:35:46 -0500 )edit

Thanks again for your reply! After writing my answer I thought about it again and looked in the code where the warnings are thrown. I think you were right! Because in the code I found the following: The first frame comes from the tf tree and so it got my tf_prefix. The second frame comes through a method that looks directly in the urdf/srdf files. So I started to redo my project so the tf_prefix is allready set in the urdf-files. I wanted to try it first and then report back, but I wasnt able to finish it on friday, so I will hopefully be able to on thuesday.

Short question: For tf-prefix. Do you set it in the urdf files and no tf_prefix at the robot_state_publisher? Because I didnt set it in the urdf files and thought the right way would be to set it with the robot_state_publisher

Heenne gravatar image Heenne  ( 2020-02-22 08:13:21 -0500 )edit

Hi @Heenne,

Glad I can help you. As you said in the comment I usually do not add the tf_prefix in the RSP and manage it in the URDF itself. In my case, I have several project in wich I decided to do that in this way since for my situation it is better, becasue there can be many other external tools that do not read properly the tf tree frames. At the end of the day you should always have consistency between tools and nodes.

If your code is looking for the robot1/base_link frame but in low level another tool is looking direcly in the link tag of the urdf named base_link you will always have an error or warning. So consistency should be the goal here.

Weasfas gravatar image Weasfas  ( 2020-02-22 12:30:44 -0500 )edit

It works! Thank you so much for your help. Short question as I am not 100% sure what you mean with "consistency between tools and nodes". Could you explain this in one or two sentences please? Because my experience with ros so far is that nothing is consistent... :D

For everybody also having this problem: I switched from having the tf_prefix in the robot_state_publisher to using the prefix (f.e. tf_prefix = "robot1_tf/") in the urdf files. But notice that you have to do that in every file. Also in the controller.yaml files and the srdf moveit configuration. After that it works for me

Heenne gravatar image Heenne  ( 2020-02-25 05:26:59 -0500 )edit

Hi @Heenne,

Great you solve the problem! By consistency I mean to follow the same standard for each component of your environment. If you have, for instance, a URDF description generating a certain TF tree with a namespace, be sure to force all your nodes and tools to use the same namespace. Because if you are not using the same ns the nodes may want to look up for a transform in the TF tree that does not exist in its environment but outside.

In fact ROS has pretty well defined these kind of things: ROS conventions and TF conventions

Weasfas gravatar image Weasfas  ( 2020-02-25 09:24:06 -0500 )edit

Hello @Heenne,

Above when you say "you have to do that in every file", can you elaborate a bit? I am having the same problem you did. I do specify the tf_prefix when I load the robot description, but that doesn't seem enough to do it--did you actually go through your URDF and SRDF files and add the prefix to every link name?

Thanks in advance for any clues you can provide!

khausman gravatar image khausman  ( 2020-06-04 16:13:29 -0500 )edit