Robotics StackExchange | Archived questions

programmatically switching parameters of a plugin inside a model.sdf

Hello,

I would like to switch on or off parameters such as publishodomtf .. to true and false, from an argument or parameter given at launch time.

Consider the part:

<plugin name="robot_diff_drive" filename="libgazebo_ros_diff_drive.so">
  <ros>
    <!-- <namespace></namespace> -->
  </ros>
  <update_rate>30</update_rate>
  <left_joint>wheel_left_joint</left_joint>
  <right_joint>wheel_right_joint</right_joint>
  <wheel_separation>0.184</wheel_separation>
  <wheel_diameter>0.0685</wheel_diameter>
  <max_wheel_torque>20</max_wheel_torque>
  <max_wheel_acceleration>1.0</max_wheel_acceleration>
  <command_topic>cmd_vel</command_topic>
  <publish_odom>true</publish_odom>
  <publish_odom_tf>false</publish_odom_tf>
  <publish_wheel_tf>false</publish_wheel_tf>
  <odometry_topic>odom</odometry_topic>
  <odometry_frame>odom</odometry_frame>
  <odometry_source>0</odometry_source> <!-- 0: encoder, 1: world -->
  <covariance_x>0.01</covariance_x>
  <covariance_y>0.0</covariance_y>
  <covariance_yaw>0.1</covariance_yaw>
  <robot_base_frame>base_footprint</robot_base_frame>
</plugin> 

I am using and I have not been able to find a way to pass parameters to sdf. Any ideas?

Best Regards, C.

Asked by altineller on 2023-03-14 08:25:55 UTC

Comments

Answers