different sensors on different robots

asked 2020-04-03 15:40:22 -0600


I have created a Gazebo world, and have an urdf file for a robot with a lidar sensor. However, I would like to have in my environment some robots with a lidar sensor and some with a camera sensor for example. I have a xacro file for both robot types, the camera type and the lidar type. However, in my launch file I would like to be able to specify which robot gets either camera or lidar xacro. I would appreciate any advice on how to do this?

<!-- -->
  <param name="/use_sim_time" value="true" />

  <!-- start world -->
  <include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="world_name" value="$(find uri_soft_4wd_sim)/world/street.world"/>
    <!-- more default parameters can be changed here -->    

  <param name="robot_description"
    command="$(find xacro)/xacro.py $(find uri_soft_4wd_sim)/urdf/cherokey.xacro" />

  <!-- BEGIN ROBOT 1-->
  <group ns="robot1">
    <param name="tf_prefix" value="robot1_tf" />
    <include file="$(find uri_soft_4wd_sim)/launch/single.launch" >
      <arg name="init_pose" value="-x 0 -y 8 -z 0" />
      <arg name="robot_name"  value="Robot1" />
      <arg name="namespace_arg"  value="Robot1" />

  <!-- BEGIN ROBOT 2-->
  <group ns="robot2">
    <param name="tf_prefix" value="robot2_tf" />
    <include file="$(find uri_soft_4wd_sim)/launch/single.launch" >
      <arg name="init_pose" value="-x 1.3 -y 8 -z 0" />
      <arg name="robot_name"  value="Robot2" />
      <arg name="namespace_arg"  value="Robot2" />


edit retag flag offensive close merge delete