-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
mc_att_control: remove direct setting of att sp in Stabilized #22644
Conversation
Instead of directly setting the attitude setpoint for usage inside the same module only publish it to the uorb topic, which is subscribed to in the same module. Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
It's not less stable or anything, but one problem with the change given the current structure is that now the attitude setpoint is delayed by one iteration. Probably not even noticeable, but it's unnecessary input latency we should be able to easily avoid with a slightly different structure. Could you simply move "check for new attitude setpoint" to right before the attitude controller is run (_attitude_control.update(q))? You'll need to make sure the heading reset is still correct, but otherwise that seems fine. PX4-Autopilot/src/modules/mc_att_control/mc_att_control_main.cpp Lines 229 to 240 in 101d882
|
…sage Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
Good point. Done it in 6173323. I don't see an issue with it neither, neither with the order (run |
@MaEtUgR would appreciate your review with fresh eyes! |
Currently in the MC attitude controller, in Stabilized mode, the generated attitude setpoints are copied inside the module to where they are used (plus also published over uORB).
Here I propose to remove this internal copying and only publish it to the uorb topic, which is subscribed to in the same module.
This "should" have no behavior change - unless we deem the passing of the attitude setpoint over uorb less stable and want to keep the internal copying of it through
setAttitudeSetpoint()
. I propose this change to be able to remove the "if(vtol_transition)" and keep the controller flows as consistent as possible.Context: #22584 (comment)
FYI @MaEtUgR