Skip to content
This repository was archived by the owner on Jul 10, 2025. It is now read-only.

gazebo_ros_wheel_slip: support parameters specified in launch file (backport to melodic)#1111

Merged
scpeters merged 1 commit intoros-simulation:melodic-develfrom
scpeters:wheel_slip_melodic_ignore_cfg_default
Aug 8, 2020
Merged

gazebo_ros_wheel_slip: support parameters specified in launch file (backport to melodic)#1111
scpeters merged 1 commit intoros-simulation:melodic-develfrom
scpeters:wheel_slip_melodic_ignore_cfg_default

Conversation

@scpeters
Copy link
Copy Markdown
Member

The gazebo_ros_wheel_slip plugin currently ignores slip compliance values specified in a launch file due to the check of the level parameter added in 3cf9f5e, which ensures that parameter values specified in the urdf / sdf xml parameters are not over-ridden by the default values specified in the .cfg file. In order to respect the values set in launch files but ignore the defaults in the .cfg file, change the .cfg default values to -1 and adjust the callback to ignore negative values. This is fine because gazebo's WheelSlipPlugin already has default values for the slip compliance parameters, so the .cfg defaults are extraneous.

This also reverts 3cf9f5e so that the level parameter is ignored again.

cc @Maxx84

The WheelSlipPlugin already has default values for the slip
compliance parameters, so ignore the default values set in
WheelSlip.cfg by making them negative and instruct the
callback to ignore negative values.
Also, ignore the `level` variable in callback so that
parameters set in launch file will not be ignored.
@Maxx84
Copy link
Copy Markdown

Maxx84 commented Jun 10, 2020

Both the issue and this fix have been replicated.

Behavior before this fix:

  • The plugin loaded the parameters (A) specified in the urdf/sdf, even if different values (B) are set in the launch file. Although the dynamic parameters appear to be set with the values (B) specified in the launch file, the robot clearly behaves according to the parameter values (A) specified in the urdf/sdf. If new dynamic parameters (C) are manually set during runtime, the robot starts behaving according to these new parameters (C).

Behavior with this fix:

  • The plugin loads the parameters (B) specified in the launch file, if available. The dynamic parameters are set with the correct values (B) and the robot behaves in the expected way.
  • If no parameters are set in the launch file, then the plugin loads the parameter values (A) set in the urdf/sdf. These values (A) however are not loaded in the plugin dynamic parameters, which are just set to zero. Nevertheless, the robot behaves correctly, according to the parameters (A). If new dynamic parameters (C) are manually set during runtime, the robot starts behaving according to these new parameters (C).

@scpeters scpeters changed the title gazebo_ros_wheel_slip: support parameters specified in launch file gazebo_ros_wheel_slip: support parameters specified in launch file (backport to melodic) Jun 17, 2020
@scpeters
Copy link
Copy Markdown
Member Author

I've created #1126 that targets this to noetic-devel. We will merge that first and then revisit this as a backport to melodic if all is well.

@scpeters
Copy link
Copy Markdown
Member Author

I just merged #1126 to noetic

scpeters added a commit to scpeters/gazebo_ros_pkgs that referenced this pull request Jul 14, 2020
Similar to the change in ros-simulation#1111, moves the WheelSlipPlugin::Load
call before the parameter callback so that the values from SDF/URDF
are set first.
Then the callback is changed to ignore negative values, and the
default slip parameter values are set to -1, so that the SDF/URDF
values are still preferred unless a different parameter value
is specified in a launch file.
@scpeters scpeters requested a review from jacobperron August 7, 2020 23:10
@scpeters scpeters merged commit ca5cc8f into ros-simulation:melodic-devel Aug 8, 2020
@scpeters scpeters deleted the wheel_slip_melodic_ignore_cfg_default branch August 8, 2020 01:22
scpeters added a commit that referenced this pull request Aug 13, 2020
Initial port of gazebo_ros_wheel_slip_plugin to ros2.

It includes a similar change to #1111, which moved the
WheelSlipPlugin::Load call before the parameter callback
so that the values from SDF/URDF are set first.
Then the callback is changed to ignore negative values, and the
default slip parameter values are set to -1, so that the SDF/URDF
values are still preferred unless a different parameter value
is specified in a launch file.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
scpeters added a commit to scpeters/gazebo_ros_pkgs that referenced this pull request Aug 13, 2020
Initial port of gazebo_ros_wheel_slip_plugin to ros2.

It includes a similar change to ros-simulation#1111, which moved the
WheelSlipPlugin::Load call before the parameter callback
so that the values from SDF/URDF are set first.
Then the callback is changed to ignore negative values, and the
default slip parameter values are set to -1, so that the SDF/URDF
values are still preferred unless a different parameter value
is specified in a launch file.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
scpeters added a commit that referenced this pull request Aug 17, 2020
Forward port of wheel slip plugin from eloquent (#1099)
to foxy.

It includes a similar change to #1111, which moved the
WheelSlipPlugin::Load call before the parameter callback
so that the values from SDF/URDF are set first.
Then the callback is changed to ignore negative values, and the
default slip parameter values are set to -1, so that the SDF/URDF
values are still preferred unless a different parameter value
is specified in a launch file.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>

Co-authored-by: Jacob Perron <jacob@openrobotics.org>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants