Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wheel plowing approximation in ODEPhysics #3164

Merged
merged 16 commits into from
Jul 21, 2022
Merged

Wheel plowing approximation in ODEPhysics #3164

merged 16 commits into from
Jul 21, 2022

Conversation

scpeters
Copy link
Member

@scpeters scpeters commented Jan 22, 2022

As noted in #3085, the distribution of contact forces can be quite different for a wheel driving on rigid terrain and deformable terrain. Contact for rigid wheel on rigid terrain can be modeled with a single contact point and normal direction perpendicular to the surface. For a rigid wheel on deformable terrain, the contact occurs over a larger area. The contact pressure distribution can be approximated as an equivalent point force at the centroid of the pressure distribution. At rest, a wheel on a deformable surface may sink into the surface with a symmetric distribution of normal contact pressure, such that the equivalent normal force vector is parallel to the undisturbed surface normal, which is vertical in the illustration below.

wheel_plowing

While rolling, the sinkage of the wheel may cause a plowing effect, in which the terrain material is bunched up in the direction of travel and compacted in its wake. This can cause a significant forward bias in the distribution of normal contact pressure and an equivalent normal force vector that is inclined relative to the undisturbed surface normal. In the illustration above, the equivalent normal force opposes the motion of the wheel, requiring tractive torque to be applied in order to maintain a steady velocity. Even when flat, the plowing effect means that driving on a deformable surface is energetically equivalent to driving uphill on a rigid surface.

This pull request implements an approximation of longitudinal wheel plowing effects by displacing contact points and inclining the contact normals to replicate the behavior illustrated in the figure above. This is implemented in ODEPhysics::Collide, which is a callback function called for each pair of colliding bodies. To enable the plowing effect, special SDFormat tags must be added to the terrain (<gz:plowing_terrain />) and the wheels (<gz:plowing_wheel />). The wheel must specify <fdir1> in its <surface>, and the <gz:plowing_wheel> tag must also contain <max_degrees> and <saturation_velocity> and may optionally contain <deadband_velocity>. See the plowing_effect_* models in test/models for examples.

@adityapande-1995
Copy link
Contributor

adityapande-1995 commented Feb 1, 2022

Left : Vehicle using the plowing effect, right : without the plowing effect
image

Wheels sinking into the ground :
image

@adityapande-1995
Copy link
Contributor

adityapande-1995 commented Feb 1, 2022

To run the example : gazebo --verbose worlds/plowing_effect_demo.world

@scpeters scpeters marked this pull request as ready for review April 1, 2022 08:24
@scpeters scpeters changed the title WIP: Prototype of plowing effect ODEPhysics: approximate longitudinal plowing Apr 1, 2022
@scpeters
Copy link
Member Author

scpeters commented Apr 1, 2022

I've updated this and marked it ready for review

@scpeters scpeters changed the title ODEPhysics: approximate longitudinal plowing ODEPhysics: approximate wheel plowing effects Apr 1, 2022
scpeters and others added 4 commits April 1, 2022 16:54
This builds on the implementation of the plowing effect
from the aditya/contact_pts branch to implement a model
of longitudinal wheel plowing effects on deformable
terrain discussed in #3085.

The approach rotates contact points and normals forward
to approximate the normal pressure distribution when
plwing through deformable soil.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
Signed-off-by: Steve Peters <scpeters@openrobotics.org>
* Removed unused code
* Added example world and model directory
* Added plowing_wheel and plowing_terrain sdf tags

Signed-off-by: Aditya <aditya050995@gmail.com>
* Rename GetRotationAngle as deadband_saturation
* Use gz instead of ignition for the xmlns
* Nest wheel parameters inside <gz:plowing_wheel />
* Move plowing_effect models to test/models
* Comment out ROS plugins from demo world

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

@WilliamLewww WilliamLewww left a comment

Choose a reason for hiding this comment

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

A minor warning:

[Err] [InsertModelWidget.cc:403] Missing model.config for model "/gazebo-ws/shared/gazebo/test/models/test_nested_urdf"
[Err] [InsertModelWidget.cc:403] Missing model.config for model "/gazebo-ws/shared/gazebo/test/models/testdb"

but looks good to me!

* Add Aditya as model author
* Return 0.0 instead of 0
* Fix typo: THe

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
Add static helper function to ODECollision for parsing wheel
parsing parameters. Use _verbose flag to optionally print
error messages if invalid parameter values are detected.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
deepanshubansal01 and others added 4 commits July 5, 2022 12:10
This PR implements unit tests for plowing effect feature.

Signed-off-by: deepanshu <deepanshubansal01@gmail.com>
* Remove unused variable callbackCountRigidTerrain_
* Fix whitespace in model.sdf
* plowing_effect_test.world: set model pose instead
  of link pose, and raise spheres above ground level
  by setting initial Z coordinate to value of radius

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
* Fix calculation of longitudinal unit vector and
  expect that longitudinal velocity and contact unit
  normal vector oppose each other.
* Update model plowing parameters to ensure max plowing
  is reached.
* Test contacts at rear wheel instead of front since
  they are more stable and expect matching contact
  point at each time step.
* Print one debug message for each plowing state.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
@scpeters scpeters changed the title ODEPhysics: approximate wheel plowing effects Wheel plowing approximation in ODEPhysics Jul 6, 2022
Improve stability of contact points through softened
kp and kd, and small max_vel and min_depth values.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
@scpeters
Copy link
Member Author

scpeters commented Jul 6, 2022

tests have been kindly provided by @deepanshubansal01 in #3229, and I have made some small adjustments:

  • b6cf816: minor refactoring of test code and models
  • ecedcc1: adjustments to tricycle on deformable terrain test: update parameters to ensure all plowing states are reached, fix one of the calculations, and improve console messaging
  • 5432fe5: improve contact parameters in plowing_effect_test.world to improve contact point stability

@adityapande-1995 adityapande-1995 self-requested a review July 6, 2022 07:42
Copy link
Contributor

@adityapande-1995 adityapande-1995 left a comment

Choose a reason for hiding this comment

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

Tests look good ! I feel we should document in the examples / code that the plowing effect only applies in the direction of fdir1 for now.

Copy link
Contributor

@deepanshubansal01 deepanshubansal01 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 to me as well.

@scpeters
Copy link
Member Author

Tests look good ! I feel we should document in the examples / code that the plowing effect only applies in the direction of fdir1 for now.

To be precise, the plowing effect applies in the direction normal to fdir1 and the surface normal. If fdir1 is the wheel's lateral direction, then the plowing effect will apply in the wheel's longitudinal direction. I'll go ahead and add some notes about this in the example model / world

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
* Move tricycle demo world to test folder since its models
  aren't installed and rename to plowing_effect_tricycle_demo.world
* Rename spheres test world to plowing_effect_spheres_test.world

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
Signed-off-by: Steve Peters <scpeters@openrobotics.org>
Signed-off-by: Steve Peters <scpeters@openrobotics.org>
@scpeters
Copy link
Member Author

Tests look good ! I feel we should document in the examples / code that the plowing effect only applies in the direction of fdir1 for now.

To be precise, the plowing effect applies in the direction normal to fdir1 and the surface normal. If fdir1 is the wheel's lateral direction, then the plowing effect will apply in the wheel's longitudinal direction. I'll go ahead and add some notes about this in the example model / world

I've added documentation in several recent commits; let me know what you think @adityapande-1995 and @deepanshubansal01

@adityapande-1995
Copy link
Contributor

Tests look good ! I feel we should document in the examples / code that the plowing effect only applies in the direction of fdir1 for now.

To be precise, the plowing effect applies in the direction normal to fdir1 and the surface normal. If fdir1 is the wheel's lateral direction, then the plowing effect will apply in the wheel's longitudinal direction. I'll go ahead and add some notes about this in the example model / world

I've added documentation in several recent commits; let me know what you think @adityapande-1995 and @deepanshubansal01

Looks good to me !

@deepanshubansal01
Copy link
Contributor

deepanshubansal01 commented Jul 21, 2022

Tests look good ! I feel we should document in the examples / code that the plowing effect only applies in the direction of fdir1 for now.

To be precise, the plowing effect applies in the direction normal to fdir1 and the surface normal. If fdir1 is the wheel's lateral direction, then the plowing effect will apply in the wheel's longitudinal direction. I'll go ahead and add some notes about this in the example model / world

I've added documentation in several recent commits; let me know what you think @adityapande-1995 and @deepanshubansal01

Looks good to me as well !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants