ackermann: update module structure, add acro/position mode and improve guidance #23781
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 implements the following features:
Solution
Note: Offboard mode is not yet implemented, but this structure already accounts for it.
This introduces the following new parameters:
with$$w_b:$$ Wheel base, $$a_{lat}:$$ Lateral acceleration setpoint and $$v:$$ Rover speed.
Position Mode: Same as Acro mode except that the speed is close loop controlled and the rover is being course controlled (keep driving in a straight line) if the right stick is centered.
Auto Mode: The steering setpoint that is calculated using pure pursuit and the ackermann geometry is now transformed into a lateral_acceleration_setpoint$$a_{lat}$$ :
with$$w_b:$$ Wheel base, $$\theta:$$ Steering angle and $$v:$$ Rover speed.
This has the following effects:
with$$w_b:$$ Wheel base, $$a_{lat, max}:$$ Maximum lateral acceleration (RA_MAX_LAT_ACCEL) and $$\theta_{max}:$$ Maximum steering angle (RA_MAX_STR_ANG).
with$$r:$$ Turning radius for the upcoming corner and $$a_{lat, max}:$$ Maximum lateral acceleration (RA_MAX_LAT_ACCEL).
Testing