Robotics StackExchange | Archived questions

why am I not able to use the argument value of a xacro under a gazebo tag?

I'm just showing the relevant parts..

<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="xyz">
<xacro:arg name="robot_names" default="robot_1"/>

<gazebo>
    <plugin name="object_controller" filename="libgazebo_ros_planar_move.so">

      <commandTopic>cmd_vel</commandTopic>
      <odometryTopic>odom</odometryTopic>
      <robotNamespace><remapping>/tf:=tf</remapping>  </robotNamespace>
      <ros>    <remapping>/tf:=tf</remapping>    </ros>

      <!-- Set control loop update rate -->
      <odometryRate>100</odometryRate>
      <!-- Set odom publish rate -->
      <publish_rate>100</publish_rate>

      <!-- Set if odom required -->
      <publish_odom>true</publish_odom>
      <publish_odom_tf>true</publish_odom_tf>

      <!-- Frame IDs -->
      <odometry_frame>${robot_names}</odometry_frame>
      <robot_base_frame>${robot_names}base_link</robot_base_frame>

      <!-- Set odom covariance -->
      <covariance_x>0.0001</covariance_x>
      <covariance_y>0.0001</covariance_y>
      <covariance_yaw>0.0001</covariance_yaw>

    </plugin>  
  </gazebo>
</robot>

Asked by pmuthu2s on 2022-05-16 04:19:54 UTC

Comments

Answers

For an argument, you need to call it using:

${arg robot_names}

Asked by joe28965 on 2022-05-25 04:50:36 UTC

Comments