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

How to handle multiple URDF files in a single moveit package

asked 2018-07-20 04:03:27 -0500

Hello,

I am trying to test several robot-tool configurations. Doing that, I combined the tool urdfs (as discussed here) with the urdf of my robot.

To me it seems the only way to test that configuration with my robot is to create a moveit package for every single robot-tool configuration. I was wondering if there is a convinient way to switch beetween urdf or xacro files to be able to switch between robot models and still use only a single movit package.

Any ideas?

Thanks a lot.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2018-07-20 07:44:40 -0500

The moveit_setup_assistant doesn't support doing that, but you can do it yourself by editing the files inside your moveit config package. Assuming the only thing that needs to change between your moveit packages is the SRDF, and you already have one SRDF for each robot-tool configuration. Then you can add "robot" and "tool" args to your planning_config.launch to look something like this:

<launch>
  [...]

  <arg name="robot" default="myrobot1"/>
  <arg name="tool" default="mytool1"/>

  <!-- Load universal robot description format (URDF) -->
  <param if="$(arg load_robot_description)" name="$(arg robot_description)" command="$(find xacro)/xacro --inorder $(find myrobot_description)/urdf/$(robot)_$(tool).urdf.xacro" />

  <!-- The semantic description that corresponds to the URDF -->
  <param name="$(arg robot_description)_semantic" textfile="$(find myrobot_moveit_config)/config/$(robot)_$(tool).srdf" />

   [...]
</launch>

... and then of course you need to edit the launch files that include planning_context.launch and pass through the robot and tool args. If you do a diff between your current "robot+tool" moveit configs and find things that are different between them other than the SRDF, you need to make them parametrizable as well, perhaps doing something like this in the launch files:

<include if="$(eval robot == 'myrobot1')" [...] />
edit flag offensive delete link more

Comments

Ok. Thanks for your answer.

nmelchert gravatar image nmelchert  ( 2018-07-30 06:55:42 -0500 )edit

I thought I'd comment on my approach as the response helped me get to a solution. I've got a robot arm that sits on a rail system (prismatic joint). I wanted to have the ability to launch the moveit package for the Arm, or the Arm on Rail cfgs using a cmd line switch (for which the above answer was very useful). What really helped me visualize a solution to the moveit package files was the following:

  • Create a moveit package for just the Arm and check that into source control.
  • Create a 2nd separate moveit package for the Arm/Rail combination based upon the ROS-i tutorials (http://wiki.ros.org/Industrial/Tutorials) Sec 2.2
  • Copy the Arm/Rail files into the Arm only package and review the changes.

The diff tool highlighted how to merge the 2 packages - I.e Create 2 different Planning Groups (one ...(more)

bakerhillpins gravatar image bakerhillpins  ( 2019-06-17 14:52:59 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2018-07-20 04:03:27 -0500

Seen: 1,351 times

Last updated: Jul 20 '18