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 slip nonlinear effect (breaks ABI, not for merging) #3342

Closed
wants to merge 6 commits into from

Conversation

scpeters
Copy link
Member

🎉 New feature

Adds a nonlinear effect to the wheel slip model (not for merging due to ABI breaks)

Summary

Driving on deformable terrain can currently be modeled using the ode physics engine in Gazebo using the WheelSlipPlugin to get a linear slip model (steady wheel slip roughly proportional to the slope angle when driving uphill or downhill) and the plowing parameters added in #3164. In cases for which the linear slip model only matches experimental data within a particular range of slope angles, a nonlinear aspect to the model would be useful.

This pull request adds a nonlinear wheel slip effect in ODEPhysics in the portion of the contact callback function where the wheel plowing model is currently implemented. This nonlinear effect iterates over each contact point/normal pair and computes for each pair an equivalent slope angle from the projection of gravity and some other body forces into the wheel's longitudinal/normal plane. For each pair of collisions in contact, the equivalent slope angle is averaged over the set of contact points for that collision pair. If the equivalent slope is below the lower threshold or above the upper threshold, the longitudinal slip compliance is altered in proportion to the difference from the threshold according to the following equation:

if (aboveThreshold) {
  longitudinal_slip_compliance *=
    (1 + nonlinearSlipUpperPerDegree * degreesAboveThreshold);
}
else if (belowThreshold) {
  longitudinal_slip_compliance *=
    (1 + nonlinearSlipLowerPerDegree * degreesBelowThreshold);
}

The slope threshold values are specified in degrees in the //nonlinear_slip/lower/degree and //nonlinear_slip/upper/degree parameters with the proportionality parameters are specified in //nonlinear_slip/lower/per_degree and //nonlinear_slip/upper/per_degree

<nonlinear_slip>
  <lower>
    <degree>-6</degree>
    <per_degree>0.01</per_degree>
  </lower>
  <upper>
    <degree>6</degree>
    <per_degree>0.01</per_degree>
  </upper>
</nonlinear_slip>

Test it

  1. In a terminal, append test/models from the local clone of the gazebo-classic source repository to the GAZEBO_MODEL_PATH variable
  2. Run the example world with
gazebo --verbose test/worlds/plowing_nonlinear_slip_tricycle_demo.world

The loads a world with two tricycles driving "uphill" against an inclined gravity vector on a flat plane. The inclination angle of the gravity vector is larger than the upper nonlinear slope threshold, so the nonlinear effect causes that tricycle to reach a reduced linear speed compared to the other tricycle with no nonlinear slip parameters. Reducing the gravity inclination below the threshold (such as with gravity of -1 0 -9.75) will cause both tricycles to drive at the same speed, since their slip parameters will be identical.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

This breaks ABI, so is not intended for gazebo11.
Compute and cache mass in Model::Init.

Signed-off-by: Steve Peters <[email protected]>
This returns the total forces added by the
AddForce and AddRelativeForce APIs. This change
breaks ABI and is not intended for gazebo11.

Signed-off-by: Steve Peters <[email protected]>
Apply scaling to slip compliance above and below
threshold slopes to induce a nonnlinear effect.

Signed-off-by: Steve Peters <[email protected]>
@scpeters
Copy link
Member Author

this pull request is provided for reference, but it breaks ABI, so it is not intended for merging to gazebo11

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.

1 participant