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

Revision history [back]

click to hide/show revision 1
initial version

yeah you can just copy the meat of the xacro into your urdf...its all the stuff in the <xacro:macro> section. alternatively, you can add a <xacro:create> tag at the end of the realsense file and then just <include> it in your urdf.

but you should really get comfortable with xacro. its great.

i feel your pain I had learn the xacro format while adding a _d415.urdf.xacro file too. but no. you don't need to make everything a macro and call it in a common file.

yeah you can just copy the meat of the xacro into your urdf...its all the stuff in the <xacro:macro> section. alternatively, you can add a <xacro:create> tag at the end of the realsense file and then just <include> it in your urdf.

but you should really get comfortable with xacro. its great.

i feel your pain I had learn the xacro format while adding a _d415.urdf.xacro file too. but no. you don't need to make everything a macro and call it in a common file.

here is an example of making a common file to call all the macros I made

<?xml version="1.0"?>
<robot name="arlobot" xmlns:xacro="http://ros.org/wiki/xacro">

  <!-- A common file to tie together all of the bits and bobs of the entire robot
  Modeled after turtlebot_description 
  NOTE: All Gazebo references are gone, so simulation will have to be rebuilt if you want it -->

  <!-- From $(find turtlebot_description)/urdf/common_properties.urdf.xacro -->
  <!-- It is required by asus_xtion_pro.urdf.xacro -->
  <xacro:property name="M_PI" value="3.1415926535897931"/>

  <!-- Include 3D camera -->
  <xacro:include filename="$(find realsense2_description)/urdf/_d415.urdf.xacro"/>

  <!-- Arlo -->
  <xacro:include filename="$(find arlo-description)/urdf/arlo_temp.urdf.xacro"/>

  <!-- RPLIDAR -->
  <!-- <xacro:include filename="$(find arlobot_ros)/urdf/asus_xtion_pro_chrisl8.urdf.xacro"/> -->

  <xacro:arlobot/>
  <xacro:stack_circles parent="base_link"/>
  <xacro:sensor_d415 parent="plate_0_link" use_nominal_extrinsics="true" add_plug="false" use_mesh="true">
    <origin xyz=".1945 0 .00475" rpy="0 0 0"/>
  </xacro:sensor_d415>
</robot>