ros-simulation / gazebo_ros_pkgs

Wrappers, tools and additional API's for using ROS with Gazebo
http://wiki.ros.org/gazebo_ros_pkgs
776 stars 772 forks source link

Cannot set physics parameters using ROS parameters #1053

Open stertingen opened 4 years ago

stertingen commented 4 years ago

Affects gazebo_ros_api_plugin.

Description

It's impossible to set physics parameters like sor_pgs_w via roslaunch parameters due to the initial override of the dynamic reconfigure parameters in https://github.com/ros-simulation/gazebo_ros_pkgs/blob/kinetic-devel/gazebo_ros/src/gazebo_ros_api_plugin.cpp#L2216.

To Reproduce

Steps to reproduce the behavior:

  1. Create launchfile:
    <launch>
    <include file="$(find gazebo_ros)/launch/empty_world.launch" />
    <rosparam param="gazebo">
    sor_pgs_w: 1.0
    </rosparam>
    </launch>
  2. Launch above launchfile
  3. Execute rosparam get /gazebo/sor_pgs_w
  4. See that the value has the default value 1.3

Expected behavior

I expected to read the value 1.0 as it is explicitly set it in above launchfile

Environment (please complete the following information):

stertingen commented 4 years ago

However, there's a workaround using dynparam:

<launch>
  <include file="$(find gazebo_ros)/launch/empty_world.launch" />
  <node name="gazebo_physics_config" pkg="dynamic_reconfigure" type="dynparam" args="set_from_parameters gazebo">
    <rosparam>
      sor_pgs_w: 1.0
    </rosparam>
  </node>
</launch>