Include model in robot URDF
I have downloaded a model of a kinect with functioning plugins. How can I add this model into my existing urdf? Thanks, L
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
I have downloaded a model of a kinect with functioning plugins. How can I add this model into my existing urdf? Thanks, L
In general you will want to make a xacro for your composite system (i.e., robots, sensors, environment, etc.). In the industrial world this is equivalent to your workcell. The ROS-Industrial guys have a training unit on creating modular xacro macros for building workcells here. Good macros will accept parent links and relative offsets for easily building configurations.
As an example, you might end up with something that looks like the following for you high-level macro that will create your desired configuration:
<?xml version="1.0" ?>
<robot name="my_robot" xmlns:xacro="http://ros.org/wiki/xacro">
<xacro:include filename="$(find my_robot_support)/urdf/awesome_robot_macro.xacro"/>
<xacro:include filename="$(find my_sensor_a_support)/urdf/sensor_a_macro.xacro"/>
<xacro:include filename="$(find my_sensor_b_support)/urdf/sensor_b_macro.xacro"/>
<xacro:property name="pi" value="3.141592"/>
<!-- the robot -->
<xacro:awesome_robot />
<!-- my sensor A (mounted to the table) -->
<xacro:sensor_a parent_link="$base_link"
x_val="0.400" y_val="0.500" z_val="0.000"
roll="0.000" pitch="0.000" yaw="1.200"/>
<!-- my sensor B (mounted to the robot's tool flange) -->
<xacro:sensor_b parent_link="$tool0"
x_val="0.000" y_val="0.000" z_val="0.000"
roll="${pi/2}" pitch="0.000" yaw="${-pi}"/>
....
</robot>
Asked: 2017-05-26 09:15:00 -0500
Seen: 1,218 times
Last updated: May 26 '17
You likely want to be looking to xacro. This has the ability to include other URDF and/or xacro files.