Gazebo | Ignition | Community
Ask Your Question
0

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

asked 2022-05-16 04:19:54 -0500

pmuthu2s gravatar image

updated 2022-05-16 04:21:14 -0500

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>
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-05-25 04:50:36 -0500

joe28965 gravatar image

For an argument, you need to call it using:

${arg robot_names}
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2022-05-16 04:19:54 -0500

Seen: 10 times

Last updated: May 25