differential: speed setpoint feasibility and slow down effect in mission mode #24035
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Solved Problem
This PR adds these 2 updates to the differential rover module:
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.
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
$v_{transition} = v_{max} \cdot (1 - \theta_{normalized} \cdot k) $
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):with
RD_MISS_VEL_GAIN
This adds the new parameter
RD_MISS_VEL_GAIN
and also deprecatesRD_MISS_SPD_DEF
Test coverage