-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
mecanum: new features #24036
mecanum: new features #24036
Conversation
I think CI might have caught a real error here https://github.com/PX4/PX4-Autopilot/actions/runs/12014063746/job/33488988716?pr=24036#step:6:9349 |
@mrpollo Thanks for the heads up. It is caused by one of these commits (5640287 or e2d553c) which are actually part of this PR: #23931. |
The failing unit tests were my PRs fault sry 😇 |
657066f
to
6fe609d
Compare
6fe609d
to
4660d3b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes conceptually sense and looks clean in the implementation. Didn't check the code it too much detail but given that tested it well and it follows the same patterns for all rover type I'm okay with bringing it in like this.
4660d3b
to
b38caa5
Compare
Solved Problem
This PR adds the following new features to the mecanum module:
Deprecate
RM_MISS_SPD_DEF
: This brings the module in line with the other 2 rover modules. The default mission speed is now simply the maximum speedRM_MAX_SPEED
or specified with a speed waypoint.Deprecate
RM_MAN_YAW_SCALE
: This is also to bring the module in line with the other rover modules. This parameter is removed and its functionality is instead provided byRM_MAX_YAW_RATE
andRM_MAX_THR_YAW_R
(which already existed).Add slew rates for the yaw, yaw rate and speed setpoints. Same idea/implementation as with the differential module (differential: add slew rates for speed, yaw and yaw rate setpoints #23812). Adds 2 new parameters
RM_MAX_DECEL
andRM_MAX_YAW_ACCEL
.Fix inverse kinematics: The yaw rate prioritization was implemented wrong. The prioritization of the yaw rate over the velocity caused the rover to completely disregard the velocity setpoint if for example the user was giving full forward throttle + some yaw rate input while keeping the lateral throttle at 0. This happend because of an if statement that checked the sign consistency of the original and reduced speed setpoints which could fail due to floating point precision.
The updated inverse kinematics instead scales the requested normalized velocity vector to be withing a square that is scaled based on the control effort that is left after applying the required motor commands for the yaw rate.
This way the desired yaw rate is achieved (prioritized over speed) and the velocity direction is maintained while ensuring that none of the normalized motor commands exceed [-1, 1].
Adjust speed setpoints to always be feasible: Using the same calculation as the new inverse kinematics, the speed setpoint in closed loop speed control is adjusted based on the yaw rate setpoint s.t. the setpoint is always feasible.
Update the mecanum SITL airframe with the new/deprecated parameters.
Test coverage