-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
convert GPS subsystems to modules #1625
Conversation
This is definitely the way to go I think. I'll help on this when I have some time. |
@flixr After some thoughts, I don't see how to make it work with a dependency. Because, if the initial module is unloaded for a target (like |
Hmm... that is true. But I really don't want to add additional files for simulation for each GPS implementation. We would need the same for IMU, AHRS, etc. as well... In the end I would like to have some required modules for each firmware (like stabilization, control, etc...) but GPS is not required... |
@gautierhattenberger how about adding something like a |
I add a similar idea that would be to add |
I think the |
Ok, I'll let my colleague know about this. Not sure what he did so far. |
and remove obsolete/non-functional gps_ublox_hitl and gps_ardrone2 GPS functions still need to be called from main...
and get rid of need for GPS registering. PRIMARY_GPS (and SECONDARY_GPS) now needs to be UPPERCASE (the first part of the ABI id, e.g. GPS_UBX) This is now only used/needed to resolve GpsId(PRIMARY_GPS) to e.g. GPS_UBX_ID sim and nps are now failing, since the init and event functions are wrong for those targets. Next step is to make gps_sim and gps_nps modules and remove those targets from the "normal" modules. But maybe add the sim modules as dependencies so they can be auto-loaded?
from the "normal" gps modules so that you don't have to add them manually in your airframe to get the simulation running
Updated to autoload the gps modules for the simulators... Regarding getting rid of explicitly calling |
One option would be to have a common gps module autoloaded from each gps implementation. At the end, modules are singletonized, so it should work. |
this should be added to each GPS implementation separately (where appropriate)
Wanted to make a "generic" |
true, autoloaded modules are not parsed for their own autoloaded stuff. I'll see if I can make it recursive. But I'm not sure it is what should be done here. It would mean that any gps implementation have to rely on gps_sim/nps modules for simulation (which is the case now) and can't provide their own sim/nps implementation (for whatever reasons). |
Good point. |
- remove gps_init from main - all actual gps_x implementations autoload the generic gps module - generic GPS module has setting for multi_gps_mode
Done from my point of view... |
@gautierhattenberger @dewagter @kirkscheper or anyone else got any feedback/questions here before we merge this? |
It's all good for me |
What about gps_datalink and gps_optitrack makefiles? |
@kirkscheper thx, forgot about that one... done. |
Converting the GPS subsystems should have the following benefits:
PRIMARY_GPS (and SECONDARY_GPS) now needs to be UPPERCASE (the first part of the ABI id, e.g. GPS_UBX)
This is now only used/needed to resolve GpsId(PRIMARY_GPS) to e.g. GPS_UBX_ID
Also:
Next steps?:
as dependencies so they can be auto-loadedwith the new autoload feature?gps_periodic_check
from the modules for each implementationgps_init
in main?Feedback appreciated!