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

Here's a working example of loading a mobile base model either with or without a gripper. Use xacro:arg in the xacro file:

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

  <xacro:arg name="with_gripper" default="true" />

  <!-- model descriptions -->
  <!-- mobile base description -->
  <xacro:include filename="$(find mobile_manipulator)/models/mobile_base/mobile_base.urdf.xacro"/>

  <!-- gripper -->
  <xacro:if value="$(arg with_gripper)">
    <xacro:include filename="$(find mobile_manipulator)/models/gripper_fake/gripper_fake.urdf.xacro"/>
  </xacro:if>
</robot>

A value of with_gripper can be passed from the launch file.

<?xml version="1.0"?>
<launch>
  <arg name="is_using_gripper" default="true" />

  <!-- Load the mobile-arm description on the parameter server -->
  <param name="robot_description" command="$(find xacro)/xacro --inorder
                       '$(find mobile_manipulator)/models/mobile_manipulator/mobile_manipulator.urdf.xacro'
                       with_gripper:=$(arg is_using_gripper)"/>
</launch>

Finally, the value can be passed to the launch file when it's called from terminal.

roslaunch -v mobile_manipulator mobile_manipulator.launch is_using_gripper:=false

Here's a working example of loading a mobile base model either with or without a gripper. Use xacro:arg in the xacro file:file.

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

  <xacro:arg name="with_gripper" default="true" />

  <!-- model descriptions -->
  <!-- mobile base description -->
  <xacro:include filename="$(find mobile_manipulator)/models/mobile_base/mobile_base.urdf.xacro"/>

  <!-- gripper -->
  <xacro:if value="$(arg with_gripper)">
    <xacro:include filename="$(find mobile_manipulator)/models/gripper_fake/gripper_fake.urdf.xacro"/>
  </xacro:if>
</robot>

A value of with_gripper can be passed from the launch file.

<?xml version="1.0"?>
<launch>
  <arg name="is_using_gripper" default="true" />

  <!-- Load the mobile-arm description on the parameter server -->
  <param name="robot_description" command="$(find xacro)/xacro --inorder
                       '$(find mobile_manipulator)/models/mobile_manipulator/mobile_manipulator.urdf.xacro'
                       with_gripper:=$(arg is_using_gripper)"/>
</launch>

Finally, the value can be passed to the launch file when it's called from terminal.

roslaunch -v mobile_manipulator mobile_manipulator.launch is_using_gripper:=false

Here's a working example of loading a mobile base model either with or without a gripper. Use xacro:arg xacro:arg in the xacro file.

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

  <xacro:arg name="with_gripper" default="true" />

  <!-- model descriptions -->
  <!-- mobile base description -->
  <xacro:include filename="$(find mobile_manipulator)/models/mobile_base/mobile_base.urdf.xacro"/>

  <!-- gripper -->
  <xacro:if value="$(arg with_gripper)">
    <xacro:include filename="$(find mobile_manipulator)/models/gripper_fake/gripper_fake.urdf.xacro"/>
  </xacro:if>
</robot>

A value of with_gripper can be passed from the launch file.

<?xml version="1.0"?>
<launch>
  <arg name="is_using_gripper" default="true" />

  <!-- Load the mobile-arm description on the parameter server -->
  <param name="robot_description" command="$(find xacro)/xacro --inorder
                       '$(find mobile_manipulator)/models/mobile_manipulator/mobile_manipulator.urdf.xacro'
                       with_gripper:=$(arg is_using_gripper)"/>
</launch>

Finally, the value can be passed to the launch file when it's called from terminal.

roslaunch -v mobile_manipulator mobile_manipulator.launch is_using_gripper:=false

Here's a working example of loading a mobile base model either with or without a gripper. Use xacro:arg in the xacro file.

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

  <xacro:arg name="with_gripper" default="true" />

  <!-- model descriptions -->
  <!-- mobile base description -->
  <xacro:include filename="$(find mobile_manipulator)/models/mobile_base/mobile_base.urdf.xacro"/>

  <!-- gripper -->
  <xacro:if value="$(arg with_gripper)">
    <xacro:include filename="$(find mobile_manipulator)/models/gripper_fake/gripper_fake.urdf.xacro"/>
  </xacro:if>
</robot>

A value of for with_gripper can be passed from the launch file.

<?xml version="1.0"?>
<launch>
  <arg name="is_using_gripper" default="true" />

  <!-- Load the mobile-arm description on the parameter server -->
  <param name="robot_description" command="$(find xacro)/xacro --inorder
                       '$(find mobile_manipulator)/models/mobile_manipulator/mobile_manipulator.urdf.xacro'
                       with_gripper:=$(arg is_using_gripper)"/>
</launch>

Finally, the value can be passed to the launch file when it's called from terminal.

roslaunch -v mobile_manipulator mobile_manipulator.launch is_using_gripper:=false

Here's a working example of loading a mobile base model either with or without a gripper. Use xacro:arg in the xacro file.

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

  <xacro:arg name="with_gripper" default="true" />

  <!-- model descriptions -->
  <!-- mobile base description -->
  <xacro:include filename="$(find mobile_manipulator)/models/mobile_base/mobile_base.urdf.xacro"/>

  <!-- gripper -->
  <xacro:if value="$(arg with_gripper)">
    <xacro:include filename="$(find mobile_manipulator)/models/gripper_fake/gripper_fake.urdf.xacro"/>
  </xacro:if>
</robot>

A value for with_gripper can be passed from the launch file.file (here the value is itself an arg).

<?xml version="1.0"?>
<launch>
  <arg name="is_using_gripper" default="true" />

  <!-- Load the mobile-arm description on the parameter server -->
  <param name="robot_description" command="$(find xacro)/xacro --inorder
                       '$(find mobile_manipulator)/models/mobile_manipulator/mobile_manipulator.urdf.xacro'
                       with_gripper:=$(arg is_using_gripper)"/>
</launch>

Finally, the value can be passed to the launch file when it's called from terminal.

roslaunch -v mobile_manipulator mobile_manipulator.launch is_using_gripper:=false

Here's a working example of loading a mobile base model either with or without a gripper. Use xacro:arg in the xacro file.

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

  <xacro:arg name="with_gripper" default="true" />

  <!-- model descriptions -->
  <!-- mobile base description -->
  <xacro:include filename="$(find mobile_manipulator)/models/mobile_base/mobile_base.urdf.xacro"/>

  <!-- gripper -->
  <xacro:if value="$(arg with_gripper)">
    <xacro:include filename="$(find mobile_manipulator)/models/gripper_fake/gripper_fake.urdf.xacro"/>

    <joint name="gripper_to_mount" type="fixed">
      <origin xyz=".15 0 .205" rpy="0 0 0" />
      <parent link="chassis" />
      <child link="gripper_center" />
    </joint>
  </xacro:if>
</robot>

A value for with_gripper can be passed from the launch file (here the value is itself an arg).

<?xml version="1.0"?>
<launch>
  <arg name="is_using_gripper" default="true" />

  <!-- Load the mobile-arm description on the parameter server -->
  <param name="robot_description" command="$(find xacro)/xacro --inorder
                       '$(find mobile_manipulator)/models/mobile_manipulator/mobile_manipulator.urdf.xacro'
                       with_gripper:=$(arg is_using_gripper)"/>
</launch>

Finally, the value can be passed to the launch file when it's called from terminal.

roslaunch -v mobile_manipulator mobile_manipulator.launch is_using_gripper:=false