-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
Rover cleanup + arch fixes #16847
Rover cleanup + arch fixes #16847
Conversation
455289d
to
b1b56fc
Compare
FYI @MaEtUgR (manual input range) |
I threw this directly into master immediately. |
If the user calibrated to negative throttle, enable them to use it.
90% of all real-world vehicle configs default to this and it is something that users stumble over if they configure a new system. There are valid cases where this would not be desired - for these it can be still switched off.
PX4 can support negative (reverse) throttle and the fixed wing controller is not expecting this input range. This hardens it against it.
PX4 can support negative (reverse) throttle and the fixed wing controller is not expecting this input range. This hardens it against it.
b1b56fc
to
76d7afe
Compare
@@ -53,7 +53,8 @@ bool Sticks::checkAndSetStickInputs() | |||
// Linear scale | |||
_positions(0) = manual_control_setpoint.x; // NED x, pitch [-1,1] | |||
_positions(1) = manual_control_setpoint.y; // NED y, roll [-1,1] | |||
_positions(2) = -(manual_control_setpoint.z - 0.5f) * 2.f; // NED z, thrust resacaled from [0,1] to [-1,1] | |||
_positions(2) = -(math::constrain(manual_control_setpoint.z, 0.0f, 1.0f) | |||
, - 0.5f) * 2.f; // NED z, thrust resacaled from [0,1] to [-1,1] |
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.
, - 0.5f) * 2.f; // NED z, thrust resacaled from [0,1] to [-1,1] | |
- 0.5f) * 2.f; // NED z, thrust resacaled from [0,1] to [-1,1] |
PX4 can support negative (reverse) throttle and the multicopter controller is not expecting this input range. This hardens it against it.
This commit moves the steering output from yaw to the roll channel to better reflect the lateral control input / reaction mapping. It also removes old unused parameters and modernizes the mainloop to remove unnecessary polling.
PX4 supports -1 to 1 as input and this module was not protected against the input range.
PX4 supports -1 to 1 as input and this module was not protected against the input range.
This matches better the different platforms that are using this functionality.
Modernize rover position control
This commit adds support for stabilized flight mode for rovers, which enables the rover tracking a fixed heading that is set with a manual input
This allows to give external barometers priority if they are present.
This adds support for the different implementation variants of the v5X standard.
b5a8ff1
to
cc47038
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.
Thanks for pulling this in!
|
||
} else { | ||
const float yaw_rate = math::radians(_param_gnd_man_y_max.get()); | ||
_att_sp.yaw_sp_move_rate = _manual_control_setpoint.r * yaw_rate; |
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.
_att_sp.yaw_sp_move_rate = _manual_control_setpoint.r * yaw_rate; | |
_att_sp.yaw_sp_move_rate = _manual_control_setpoint.y * yaw_rate; |
I think using the roll stick inputs were part of this PR, and need to change for stabilized mode too
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.
I was confused as well, but I did fix that yesterday already, but forgot to push - done now.
It is more intuitive to use the roll stick as lateral control input given that drones defined this category, plus this is how consumer car / rover radio controls have been working already.
This cleans up some rover specific things, but also adds / fixes two fundamentals (@dagar):
To get to a -1 to 1 scaling for reversing vehicles the calibration in QGC will need to be changed - QGC sets the throttle channel MIN == TRIM, effectively eliminating the negative range. We should change that behavior going forward for reversing vehicle classes.