-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[WIP] Implement INDI control law with supporting infrastructure #25216
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
base: main
Are you sure you want to change the base?
Changes from all commits
3027a1b
756baa1
afb6f58
5d388b1
2fce64e
33ba896
10f431b
ff00bd0
6c39a4b
38f5029
3926a8d
2d52733
4e78aba
9f9a106
1153de0
791b453
a5fa2f5
00ba1d7
790af59
d5662d7
705f413
73818c9
ae27648
39fb863
b0dbd5c
d6ccb01
aef7adf
9163a34
d1cad7c
c2170d2
8cc00c8
6e10dd8
0b56151
5577d08
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,24 @@ | ||||||||||||||
| # INDI Adaptation Status Message | ||||||||||||||
| # Tracks changes in G matrices during INDI adaptation | ||||||||||||||
|
Comment on lines
+1
to
+2
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
|
|
||||||||||||||
| uint64 timestamp # time since system start (microseconds) | ||||||||||||||
| uint64 timestamp_sample # timestamp of the data used for adaptation | ||||||||||||||
|
Comment on lines
+4
to
+5
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doc standard now single space before after comment, metadata prefix [] for units, [@range low,high], [@enum constant_prefix], [@frame frame_name]. No full stop unless there is multiple sentences.
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI the docs standard is now documented in https://docs.px4.io/main/en/uorb/uorb_documentation |
||||||||||||||
|
|
||||||||||||||
| # G1 matrix (moment part) - 3x16 matrix flattened | ||||||||||||||
| float32[48] g1_matrix # G1 matrix elements (3 rows * 16 columns) | ||||||||||||||
|
|
||||||||||||||
| # G2 matrix (gyroscopic part) - 3x16 matrix flattened | ||||||||||||||
| float32[48] g2_matrix # G2 matrix elements (3 rows * 16 columns) | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it necessary to log these huge matrices to figure out what is going on?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hm... I would suggest leaving it in for debugging the adaptive effectiveness matrix (bc its essentially only possible through manual tuning and I assume this feature would only be used experimentally). And it would only be published to when INDI_ADAPT_EN is enabled (==1).
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These would be quite expensive to log at a high rate. I would at least remove them by default.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok! What is the best practice to do that? Just comment them out?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes |
||||||||||||||
|
|
||||||||||||||
| # Adaptation inputs | ||||||||||||||
| float32[16] rotor_speeds # Current rotor speeds (rad/s) | ||||||||||||||
| float32[16] rotor_speed_dots # Rotor speed derivatives (rad/s^2) | ||||||||||||||
| float32[3] angular_accel_delta # Angular acceleration delta (rad/s^2) | ||||||||||||||
|
Comment on lines
+14
to
+16
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
|
|
||||||||||||||
| # Adaptation constants | ||||||||||||||
| float32[3] g1_adaptive_constants # G1 adaptation constants | ||||||||||||||
| float32[3] g2_adaptive_constants # G2 adaptation constants | ||||||||||||||
|
|
||||||||||||||
| # Status flags | ||||||||||||||
| bool adaptation_enabled # Whether adaptation is currently enabled | ||||||||||||||
| uint8 num_actuators # Number of actuators being adapted | ||||||||||||||
|
Comment on lines
+23
to
+24
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,11 @@ uint64 timestamp # time since system start (microseconds) | |
| uint64 timestamp_sample # timestamp of the data sample on which this message is based (microseconds) | ||
|
|
||
| float32[3] xyz # torque setpoint about X, Y, Z body axis (normalized) | ||
| float32[3] g1_term # G1 term of torque setpoint about X, Y, Z body axis (normalized) | ||
| float32[3] g2_term # G2 term of torque setpoint about X, Y, Z body axis (normalized) | ||
| float32[3] pid_xyz # PID torque setpoint about X, Y, Z body axis (normalized) | ||
| float32[3] indi_torque_xyz # INDI torque setpoint about X, Y, Z body axis (normalized) | ||
| float32[3] measured_body_torque_xyz # measured body torque about X, Y, Z body axis (normalized) | ||
|
Comment on lines
+6
to
+10
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this should go here. If you need all these terms, then you should have a different message definition specific for INDI. Furthermore, |
||
|
|
||
| # TOPICS vehicle_torque_setpoint | ||
| # TOPICS vehicle_torque_setpoint_virtual_fw vehicle_torque_setpoint_virtual_mc | ||
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 do we need to define this in addition to the
CA_parameters?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.
the CT, KM for CA_ are not in metric. The IZZ is not defined in CA_. And with regards to the positioning, I can get rid of those, the CA_ params seem to give accurate enough results and are in metric.
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 is the downside of just using Ct and Km in CA_ and use them as metric parameters? Defining additonal parameters will use a lot of flash space that is not necesssary.