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

gazebo_ros_wheel_slip plugin#995

Merged
scpeters merged 5 commits intoros-simulation:melodic-develfrom
scpeters:wheel_slip_plugin_melodic
Apr 16, 2020
Merged

gazebo_ros_wheel_slip plugin#995
scpeters merged 5 commits intoros-simulation:melodic-develfrom
scpeters:wheel_slip_plugin_melodic

Conversation

@scpeters
Copy link
Copy Markdown
Member

Uses dynamic_reconfigure to set wheel slip parameters and publishes wheel slip in JointState message.
Requires gazebo 9.5.

I marked this as WIP since it's a bit weird to use JointState to publish the wheel slip. We should consider a different / custom message.

This inherits from gazebo's WheelSlipPlugin added in the following pull requests:

wheel_slip_trisphere_cycle_shorter.gif

Description copied from those pull requests:

This adds a new plugin for tuning the amount of wheel slip experienced by a wheeled robot. It dynamically adjusts the ODE slip1 and slip2 parameters (see Force-dependent slip parameters in ODE user guide). This parameter has units like an inverse damper (velocity / effort). It is often preferred to use normalized parameters, so this plugin accepts unitless longitudinal_slip_compliance and lateral_slip_compliance parameters. The slip1 and slip2 parameters are then dynamically updated by multiplying the normalized slip compliance by the linear wheel spin velocity (radius * angular spin rate) and dividing by a wheel_normal_force parameter supplied to the plugin.

Here's some ASCII art and documentation pasted from the plugin header file:

A graphical interpretation of these parameters is provided below for a positive value of slip compliance. The horizontal axis corresponds to the slip ratio at the wheel, and the vertical axis corresponds to the tangential force ratio (tangential / normal force). As wheel slip increases, the tangential force increases until it reaches the maximum set by the friction coefficient. The slip compliance corresponds to the inverse of the slope of the force before it reaches the maximum value. A slip compliance of 0 corresponds to a completely vertical portion of the plot below. As slip compliance increases, the slope decreases.

+        |                                            .
+        |      _________ friction coefficient        .
+        |     /                                      .
+        |    /|                                      .
+        |   /-┘ slope is inverse of                  .
+        |  /    slip compliance                      .
+        | /                                          .
+        |/                                           .
+      --+-------------------------- slipRatio
+        |

cc: @azeey @jacobperron

@jacobperron
Copy link
Copy Markdown
Collaborator

Friendly ping. Let me know if there's something I can do to help move this forward.

I can help with a ROS 2 port once this lands.

@scpeters
Copy link
Copy Markdown
Member Author

the reason it's WIP is because it feels weird to publish wheel slip data in a JointStates message. we can remove that publisher for now and merge the rest of it, which allows dynamically updating the wheel slip parameters

or we could make a custom message for wheel slip data. I'm not sure if people are planning to use that or not

@jacobperron
Copy link
Copy Markdown
Collaborator

jacobperron commented Jan 29, 2020

Although the published wheel slip data sounds useful, I don't think it's necessary on my end. So, I'd be okay removing the publisher for now, with a TODO to add it back once a new message type is defined.

@scpeters
Copy link
Copy Markdown
Member Author

Although the published wheel slip data sounds useful, I don't think it's necessary on my end. So, I'd be okay removing the publisher for now, with a TODO to add it back once a new message type is defined.

are you up for removing the publisher and pushing to this branch? I'll give you permissions on my fork if so

@jacobperron
Copy link
Copy Markdown
Collaborator

are you up for removing the publisher and pushing to this branch?

I probably don't have time to get to it any time soon, but I'll poke you if that changes.

@scpeters scpeters force-pushed the wheel_slip_plugin_melodic branch from 2aef6bd to 1a7080f Compare March 4, 2020 23:59
@scpeters scpeters changed the title WIP gazebo_ros_wheel_slip plugin gazebo_ros_wheel_slip plugin Mar 5, 2020
@scpeters scpeters force-pushed the wheel_slip_plugin_melodic branch from 6ebc12e to c429174 Compare March 11, 2020 22:48
Uses dynamic_reconfigure to set wheel slip parameters
and publishes wheel slip in JointState message.
Requires gazebo 9.5.
@scpeters scpeters force-pushed the wheel_slip_plugin_melodic branch from c429174 to cedd848 Compare March 11, 2020 23:00
Copy link
Copy Markdown
Collaborator

@jacobperron jacobperron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown

@azeey azeey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I tested in gazebo and seems to work great. Left a comment about cleaning up memory.

@scpeters
Copy link
Copy Markdown
Member Author

scpeters commented Apr 9, 2020

I've added a test world:

roslaunch gazebo_ros empty_world.launch \
  verbose:=true \
  world_name:=<REPO_PATH>/gazebo_plugins/test/test_worlds/trisphere_cycle_wheel_slip.world ~~~

then you can use the dynamic reconfigure gui to change the wheel slip parameters for different groups of wheels

@scpeters
Copy link
Copy Markdown
Member Author

scpeters commented Apr 15, 2020

the build.ros.org job is parsing some console error messages from a test as compiler warnings:

19:32:40 [ROSUNIT] Outputting test results to /tmp/ws/test_results/gazebo_plugins/rostest-test_set_model_state_test_set_model_state_test.xml
19:32:41 Gazebo multi-robot simulator, version 9.0.0
19:32:41 Copyright (C) 2012 Open Source Robotics Foundation.
19:32:41 Released under the Apache 2 License.
19:32:41 http://gazebosim.org
19:32:41 
19:32:41 �[0m[ INFO] [1586399561.369891224]: Finished loading Gazebo ROS API Plugin.�[0m
19:32:41 �[0m[ INFO] [1586399561.371208450]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...�[0m
19:32:41 �[1;32m[Msg] �[0m�[1;32mWaiting for master.�[0m�[1;32m
19:32:41 �[0m�[1;32m�[0m�[1;32m[Msg] �[0m�[1;32mConnected to gazebo master @ �[0m�[1;32mhttp://127.0.0.1:11345�[0m�[1;32m
19:32:41 �[0m�[1;32m�[0m�[1;32m[Msg] �[0m�[1;32mPublicized address: �[0m�[1;32m172.17.0.2�[0m�[1;32m
19:32:41 �[0m�[1;32m�[0m�[1;31m[Err] [RenderEngine.cc:725] �[0m�[1;31mCan't open display: �[0m�[1;31m�[0m�[1;31m
19:32:41 �[0m�[1;33m[Wrn] [RenderEngine.cc:93] �[0m�[1;33mUnable to create X window. Rendering will be disabled
19:32:41 �[0m�[1;33m[Wrn] [RenderEngine.cc:293] �[0m�[1;33mCannot initialize render engine since �[0m�[1;33mrender path type is NONE. Ignore this warning if�[0m�[1;33mrendering has been turned off on purpose.
19:32:41 �[0mALSA lib confmisc.c:767:(parse_card) cannot find card '0'
19:32:41 ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
19:32:41 ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
19:32:41 ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
19:32:41 ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
19:32:41 ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
19:32:41 ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
19:32:41 ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM default
19:32:41 AL lib: (EE) ALCplaybackAlsa_open: Could not open playback device 'default': No such file or directory
19:32:41 �[1;31m[Err] [OpenAL.cc:84] �[0m�[1;31mUnable to open audio device[�[0m�[1;31mdefault�[0m�[1;31m]
19:32:41  Audio will be disabled.
19:32:41 �[0m�[0m[ INFO] [1586399561.660409081]: waitForService: Service [/gazebo/set_physics_properties] is now available.�[0m
19:32:54 �[0m[ INFO] [1586399561.696777220, 350.334000000]: Physics dynamic reconfigure ready.�[0m
19:32:55 �[1;33m�[0m�[1;36m�[0m�[1;31m�[0m�[1;32m�[0m[Testcase: testset_model_state_test] ... ok
19:32:55 
19:32:55 [ROSTEST]-----------------------------------------------------------------------
19:32:55 
19:32:55 [gazebo_plugins.rosunit-set_model_state_test/FrameTest][passed]

http://build.ros.org/job/Mpr__gazebo_ros_pkgs__ubuntu_bionic_amd64/36/

@scpeters
Copy link
Copy Markdown
Member Author

@ros-pull-request-builder retest this please

@scpeters
Copy link
Copy Markdown
Member Author

the build.ros.org issue persists, but I think it's not blocking

@scpeters
Copy link
Copy Markdown
Member Author

indeed, those false positive compiler warnings are tracked by ros2/ci#316

I believe I've addressed your comments @azeey

@scpeters scpeters merged commit cbf5c93 into ros-simulation:melodic-devel Apr 16, 2020
@scpeters scpeters deleted the wheel_slip_plugin_melodic branch April 16, 2020 20:48
scpeters added a commit to scpeters/gazebo_ros_pkgs that referenced this pull request Apr 16, 2020
Uses dynamic_reconfigure to set wheel slip parameters.
Requires gazebo 9.5.

* don't overwrite initial slip values
* Add test world using trisphere_cycles
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