-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
fw_att_control move to ModuleBase #8899
Conversation
Cool, this does fix the subscription problem. But still does not fix the subtraction of the unsigned integers in L889. E.g. see below a debug print (where "diff=airsp ts - time now"): However, using the hrt_elapsed_time you recommended in #8898 works. This amounts only to this change:
@dagar can you do this? Then I think this PR is good to merge -- I just tested on hardware and it works out. |
b0c76c9
to
b9164e6
Compare
@tstastny I fixed the time check and also slipped in some trivial cleanup I've wanted to do for readability. I've tested on the bench and in SITL. |
08b4d89 fixes attitude setpoint logging & display on flight review for stabilized mode. |
Random mode testing https://logs.px4.io/plot_app?log=f3675edc-b8a8-45b6-aeb3-824ad4894936 |
@RomanBapst quick review? Nothing too interesting here should be different, I'm mainly trying to get this module organized. |
@dagar Sure, first thing in the morning. |
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.
@dagar Looks pretty good. We could a second pass and update some of the comments in the module.
|
||
_sub_airspeed(ORB_ID(airspeed), 0, 0, nullptr), | ||
SuperBlock(nullptr, "FW_ATT"), | ||
_sub_airspeed(ORB_ID(airspeed), 0, 0, &getSubscriptions()), |
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.
@dagar Any reason why the airspeed subscription is handled using the subscription class and not the others?
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 would say that within a module we should only use one type of subscription. So we either use the subscription class also for all other inputs of the fixed-wing attitude control module or use the same syntax for the airspeed as for the other subscribers.
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.
In general I agree, but I'd like to strongly encourage moving away from the old C APIs for both params and orb. There's no type safety and most common usage throughout the code base doesn't check any errors.
|
||
using uORB::Subscription; | ||
|
||
class FixedwingAttitudeControl final : public control::SuperBlock, public ModuleBase<FixedwingAttitudeControl> |
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.
@dagar What does "final" mean?
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.
That this class can't be derived from. In some cases it allows the compiler to devirtualize calls, but it's otherwise harmless.
@dagar I guess the next thing would be a couple of flight tests in all possible modes? |
No, but I was going to do another pass later that continued splitting out the main loop into separate functions for attitude control and rate control (partially to enable rate setpoint subscriptions). We can continue removing all the extraneous checks as we go. I was also tempted to completely pull out manual handling and finally create stick_mapper, but the rattitude mode is problematic. |
@dagar we plan to go to the flying field tomorrow and test this PR if the weather allows it. Regards. |
Perfect flight performance on this flights: |
I made one minor change to fix the vehicle_attitude_setpoint publication (which is also wrong in master). https://logs.px4.io/plot_app?log=cee40f51-3e92-4700-ba6e-1bd2ad0de2da |
No description provided.