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

differential: speed setpoint feasibility and slow down effect in mission mode #24035

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

chfriedrich98
Copy link
Contributor

Solved Problem

This PR adds these 2 updates to the differential rover module:

  1. The controller prioritizes yaw rate over forward speed. A high yaw rate setpoint can therefor make the forward speed setpoint infeasible due to actuator limitations. This leads the integrator of the speed controller to build up. This problem is fixed in this PR by adjusting the speed setpoint based on the amount of control effort that is “occupied” by the yaw rate setpoint.

  2. Adds a tunable slow down effect in mission mode. As the rover approaches a waypoint it will slow down with the following logic: If the angle between the prev-curr-wp and curr-next-wp lines is bigger than RD_TRANS_DRV_TRN the rover will come to a full stop at the waypoint and then turn on the spot (this is not new). If this angle is lower then it will slow down s.t. it arrives at the waypoint with the following speed (this is new):
    $v_{transition} = v_{max} \cdot (1 - \theta_{normalized} \cdot k) $

    with

    • $v_{transition}:$ Transition speed
    • $v_{max}:$ Maximum speed 'RD_MAX_SPEED`
    • $\theta_{normalized}:$ Angle between the linesegment of prev-curr and curr-next waypoints normalized from $[0\degree, 180\degree]$ to $[1, 0]$
    • $k:$ Tuning parameter RD_MISS_VEL_GAIN
      This adds the new parameter RD_MISS_VEL_GAIN and also deprecates RD_MISS_SPD_DEF

Test coverage

  • Tested in SITL
  • Tested on hardware

@chfriedrich98 chfriedrich98 added the Rover 🚙 Rovers and other UGV label Nov 25, 2024
@chfriedrich98 chfriedrich98 self-assigned this Nov 25, 2024
@chfriedrich98 chfriedrich98 marked this pull request as ready for review November 26, 2024 16:01

} else if (_param_rd_max_jerk.get() > FLT_EPSILON && _param_rd_max_decel.get() > FLT_EPSILON
&& _param_rd_miss_spd_gain.get() > FLT_EPSILON) {
const float speed_reduction = math::constrain(_param_rd_miss_spd_gain.get() * math::interpolate(
Copy link
Contributor

Choose a reason for hiding this comment

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

Could it be an option to use RD_TRANS_DRV_TRN for the slow down instead of introducing this new param RD_MISS_SPD_GAIN?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Rover 🚙 Rovers and other UGV
Projects
Status: 👀 In Review
Development

Successfully merging this pull request may close these issues.

2 participants