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

Xacro include breaks including xacro file

asked 2018-09-29 12:06:17 -0600

Julian98 gravatar image

updated 2018-09-29 13:54:04 -0600

I have a xacro file named "diff_wheeled_robot.urdf.xacro" to describe a robot and it works just fine. It is including other xacro files and their xacro macros. Now I want to include another xacro file describing a laser. The following code is the laser file ("rplidar.urdf.xacro"):

<?xml version="1.0"?>
<robot name="rplidar" xmlns:xacro="">

    <xacro:include filename="$(find testbot_description)/urdf/inertias.urdf.xacro" /> 
    <xacro:include filename="$(find testbot_description)/urdf/materials.urdf.xacro" /> 

    <xacro:property name="rplidar_mass" value="0.2" /> 
    <xacro:property name="rplidar_radius" value="0.0757" /> 
    <xacro:property name="rplidar_height" value="0.04080" />

    <xacro:macro name="rplidar" params="parent translateX translateY">
        <link name="rplidar_link">
                <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/>
                <mass value="${rplidar_mass}"/>
                <cylinder_inertia m="${rplidar_mass}" r="${rplidar_radius}" h="${rplidar_height}"/>
                <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/>
                    <cylinder length="${rplidar_height}" radius="${rplidar_radius}" />
                <material name="Blue" />
                <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/>
                    <cylinder length="${rplidar_height}" radius="${rplidar_radius}" />

        <joint name="rplidar_joint" type="fixed">
            <parent link="${parent}"/>
            <child link="rplidar_link"/>

        <gazebo reference="rplidar_link">
            <sensor type="ray" name="rplidar_sensor">
                <pose>${rplidar_radius/2} 0 0 0 0 0</pose>
                <plugin name="gazebo_ros_head_rplidar_controller" filename="">

But when I try to include it via

<xacro:include filename="${find testbot_description)/urdf/rplidar.urdf.xacro" />

and I run

rosrun xacro xacro --inorder diff_wheeled_robot.urdf.xacro

I get an error:

No such file or directory:  None None
when processing file: diff_wheeled_robot.urdf.xacro

What am I doing wrong?

ROS Kinetic

Ubuntu 16.04

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-09-29 16:43:17 -0600

gvdhoorn gravatar image
<xacro:include filename="${find testbot_description)/urdf/rplidar.urdf.xacro" />

It should be $(find ..), not ${find ..).

edit flag offensive delete link more


Thank you ;)

Julian98 gravatar image Julian98  ( 2018-09-30 02:24:10 -0600 )edit

Question Tools


Asked: 2018-09-29 12:06:17 -0600

Seen: 1,905 times

Last updated: Sep 29 '18