Skip to content
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

Autopilot refactor #2009

Merged
merged 11 commits into from
Feb 19, 2017
Merged

Autopilot refactor #2009

merged 11 commits into from
Feb 19, 2017

Conversation

gautierhattenberger
Copy link
Member

@gautierhattenberger gautierhattenberger commented Feb 14, 2017

With this, fixedwing and rotorcraft are mostly using the same interface for the autopilot. Some specific code and messages handling are still firmware dependent.
A large part of the autopilot logic of the fixedwing is moved from main_ap to autopilot_static.
More getter/setter functions are provided.
The rest of the systems, the simulators and the configurations are also updated. Unfortunately it does have a small impact on airframe configurations and flight plans when variables where directly used.
The functionality of the strip to go back to nav mode (when clicking on mode status) is disabled for now as FW and rotorcraft nav have different index.

With this, fixedwing and rotorcraft are mostly using the same interface
for the autopilot. Some specific code and messages handling are still
firmware dependent.
A large part of the autopilot logic of the fixedwing is moved from
main_ap to autopilot_static.
More getter/setter functions are provided.
for using the refactored autopilot API
@OpenUAS
Copy link
Contributor

OpenUAS commented Feb 14, 2017

WOW thx, yeah, merge FW and rotorcraft the sooner the better. Will see how I can quickly fix just move airframes... or @gautierhattenberger you can do it you want pull request honored now

autopilot_mode != AP_MODE_MODULE &&
autopilot_mode != AP_MODE_FLIP &&
autopilot_mode != AP_MODE_GUIDED) {
autopilot_get_mode() != AP_MODE_KILL &&
Copy link
Contributor

@OpenUAS OpenUAS Feb 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a chance "autopilot_get_mode()" is different between calls and would "autopilot.mode" as a value maybe be better here and in the next 6 also

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand your question...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@OpenUAS it will have exactly the same behavior than before, it is just a simple getter function that doesn't change the variable. The only possible inconsistency is if you start changing the mode without proper protection in multi-threaded environment or in interrupts. It is not the case at the moment (and hopefully it will never be the case!).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gautierhattenberger, yes, that was indeed my worry, mode change with unintended effect. But since you also testfly a lot we both will discover and inconsistency soon ;-) . Thanks for the code integration, really appreciated 🥇

</description>
</doc>
<header/>
<makefile/>
<makefile>
<configure name="ACTUATORS"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should rather use <configure name="ACTUATORS" value="none"/>?
That might be more clear and also consistent with the configure option we have for LEDs....

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a nice way to test that ACTUATORS is either null, undefined or equal to none on this line: https://github.com/paparazzi/paparazzi/blob/master/conf/firmwares/fixedwing.makefile#L33 ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hum... I guess defaulting to none just before should be enough

@gautierhattenberger
Copy link
Member Author

tested and working on fixedwing (Apogee) and rotorcraft (elle0), using the static autopilot.

@flixr
Copy link
Member

flixr commented Feb 16, 2017

What do we do about the functionality to get out of home mode by clicking on the strip?

@gautierhattenberger
Copy link
Member Author

With this the firmware should be automatically detected and if not, the button is not connected.

@flixr flixr merged commit 363dec8 into master Feb 19, 2017
@flixr flixr deleted the autopilot_refactor branch February 19, 2017 10:46
@podhrmic podhrmic mentioned this pull request Feb 22, 2017
podhrmic pushed a commit that referenced this pull request Mar 7, 2017
* [autopilot] refactor autopilot API for both firmwares

With this, fixedwing and rotorcraft are mostly using the same interface
for the autopilot. Some specific code and messages handling are still
firmware dependent.
A large part of the autopilot logic of the fixedwing is moved from
main_ap to autopilot_static.
More getter/setter functions are provided.

* [autopilot] update the rest of the system and the conf

for using the refactored autopilot API

* [autopilot] fix some errors from CI servers

* [actuators] use dummy actuators module to prevent autoloading

* Rename Bart_heliDD_INDI.xml to tudelft_bs_helidd_indi.xml

* Rename Bart_heliDD_pid.xml to tudelft_bs_helidd_pid.xml

* Delete tudelft_course2016_bebop_colorfilter.xml

* Delete tudelft_course2016_bebop_avoider.xml

* [actuators] don't autoload actuators when set to 'none'

* [gcs] autodetect firmware for strip mode button
podhrmic pushed a commit that referenced this pull request Mar 19, 2017
* [autopilot] refactor autopilot API for both firmwares

With this, fixedwing and rotorcraft are mostly using the same interface
for the autopilot. Some specific code and messages handling are still
firmware dependent.
A large part of the autopilot logic of the fixedwing is moved from
main_ap to autopilot_static.
More getter/setter functions are provided.

* [autopilot] update the rest of the system and the conf

for using the refactored autopilot API

* [autopilot] fix some errors from CI servers

* [actuators] use dummy actuators module to prevent autoloading

* Rename Bart_heliDD_INDI.xml to tudelft_bs_helidd_indi.xml

* Rename Bart_heliDD_pid.xml to tudelft_bs_helidd_pid.xml

* Delete tudelft_course2016_bebop_colorfilter.xml

* Delete tudelft_course2016_bebop_avoider.xml

* [actuators] don't autoload actuators when set to 'none'

* [gcs] autodetect firmware for strip mode button
podhrmic pushed a commit that referenced this pull request Mar 19, 2017
* [autopilot] refactor autopilot API for both firmwares

With this, fixedwing and rotorcraft are mostly using the same interface
for the autopilot. Some specific code and messages handling are still
firmware dependent.
A large part of the autopilot logic of the fixedwing is moved from
main_ap to autopilot_static.
More getter/setter functions are provided.

* [autopilot] update the rest of the system and the conf

for using the refactored autopilot API

* [autopilot] fix some errors from CI servers

* [actuators] use dummy actuators module to prevent autoloading

* Rename Bart_heliDD_INDI.xml to tudelft_bs_helidd_indi.xml

* Rename Bart_heliDD_pid.xml to tudelft_bs_helidd_pid.xml

* Delete tudelft_course2016_bebop_colorfilter.xml

* Delete tudelft_course2016_bebop_avoider.xml

* [actuators] don't autoload actuators when set to 'none'

* [gcs] autodetect firmware for strip mode button
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants