-
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
[WIP]: mc_att_control split out rate controller and sensor aggregation into new modules #12225
[WIP]: mc_att_control split out rate controller and sensor aggregation into new modules #12225
Conversation
The overall diff is actually quite small. The majority of the change in the main loop is one level of indentation. |
8a5e1b5
to
c5f9664
Compare
6516ae8
to
479756b
Compare
312999b
to
a67e42b
Compare
b7c96c9
to
ca93abd
Compare
ca93abd
to
3ff00e0
Compare
3ff00e0
to
5e4cca9
Compare
Tested on Pixhawk 4mini v5:Modes Tested
Procedure Notes: Log: Master |
Tested on Pixhawk 2 Cube v3:Modes Tested
Procedure Notes: Log:
Master |
Tested on PixRacer V4:Modes Tested Position Mode: Good. Notes: Log: https://review.px4.io/plot_app?log=5d6fcd40-dc85-4bf2-a042-9dc7788042b4 Master: |
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.
Looks very good, I had some small questions but I generally like the direction this takes.
It all seems fine in SITL, I don't see any issues.
|
||
uint64 timestamp_sample # the timestamp of the raw data (microseconds) | ||
|
||
float32 rollspeed # Bias corrected angular velocity about X body axis in rad/s |
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.
Could we make that an array?
* POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
****************************************************************************/ | ||
|
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 think a very brief description of the class would help reading through the code.
@@ -123,6 +123,7 @@ set(msg_files | |||
ulog_stream.msg | |||
ulog_stream_ack.msg | |||
vehicle_air_data.msg | |||
vehicle_angular_velocity.msg |
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.
What about vehicle_angular_rate
? I know this term is used a lot in this pr, I'm just suggesting it because terminoligy would be consistent with "rate controller". What do you think?
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 don't feel that strongly about it as long is we try to be consistent at some level (with literature, ROS, internally, etc). When I first sketched this out I was just calling it vehicle body rate or even vehicle rates.
bool | ||
MulticopterAttitudeControl::init() | ||
{ | ||
return selected_gyro_update(); |
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.
Do you select the gyro on module start "only"?
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.
Why was I already outdated? 🤷♂
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 think it was commenting on something in the 1st commit (mc_att_control changes) that changed again in the 2nd (moving this out of mc_att_control entirely)?
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.
Do you select the gyro on module start "only"?
It also updates if sensor_selection
(from sensors voting) changes as well.
0e4b030
to
b045539
Compare
444c22f
to
cf50d84
Compare
cf50d84
to
d127813
Compare
Continued in #12650. |
Requires #12207 before merging.Background - #12207
The multicopter attitude controller currently contains a rate controller, attitude controller, and logic for handling multiple gyros.
mc_att_control components
This PR splits mc_att_control into 3 separate modules, each running out of a WQ. We can afford to do this because each will be running out of an appropriate WQ thread, rather than as a new standalone task.
sensors/vehicle_angular_velocity
sensor_gyro
), estimated bias (sensor_bias
), primary gyro from sensors (sensor_selection
), and optional corrections (sensor_corrections
)vehicle_angular_velocity
mc_rate_control
vehicle_angular_velocity
updatesactuator_controls_0
andrate_ctrl_status
mc_att_control
vehicle_attitude
updatesvehicle_rate_setpoint