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
Proxy driver for GPS modules supported by the PX4 firmware #1580
Conversation
GNSS modules handled by PX4 drivers are not auto-detectable, some are not even connected to a UART port. The activation is therefore controlled by GPS_TYPE only. Baud rate and port settings (if applicable) have to be handled by the PX4 firmware.
Thanks Holger! |
Hi tridge, the problem with autodetection is that the parallel probing and initialization from APM would interfere with the PX4 driver, that is already running and talking with the GPS - there is no locking AFAIK. We would have to suspend/delay the probing for APM-driven GPS modules until we are sure that there is no PX4 GPS connected. Unfortunately we don't get any negative acknowledge if no PX4 GPS is connecte either. The other aspect is that we don't have to care about different hardware here - this is transparently handled by the PX4 driver (which in fact does an autodetection again). Regarding startup: for the case that the GPS is interfaced by UAVCAN, there is no special startup code needed at all, except the one that starts the UAVCAN stack itself (executable "uavcan"). This is BTW handled by my PR #1323 . For other GPS modules, we would indeed have to add a line to rc.APM. The rc.user would be a very nice way to do that IMHO. |
hi Holger, I've pushed this to master with some fixes. The main fixes were to fix the build for non-PX4 boards, plus to add PX4EXPERIMENTAL to the drop down list in the GCS so users know how to select this option. |
I've now ordered one of the GPS+mag+baro UAVCAN combos from nicadrone. That should get me started! |
Hi tridge, I think you should not compare the Zubax module to a "naked" uBlox6 or so. It uses a completely different approach - I think the best is to just see it as a smart position provider, not as a GPS module at all. It contains its own STM32F105, running it's own OS and it's own uBlox driver. This driver handles all initialization, configuration and data transfer. There is absolutely no need for an application running on Pixhawk even to know that the module is UBlox-based. Offering a virtual port over UAVCAN is probably possible, but I think doing so would give up 90% advantages of this module. You would increase load on Pixhawk and, even worse, on UAVCAN as well, plus introducing addtional delays. BTW: please watch for my latest patches in PX4/master for making the compass work with APM. The drivers contained in diydrones/PX4Firmware does not support read() on the device file yet and hence do not work for APM. The same applies for the baro, but as APM does not support more than one baro yet, this is probably not that interesting. |
The fact that it uses a completely different approach and that it doesn't involve a driver that we have control of is what makes it unattractive to me. The "increase load" argument makes no sense - the load in parsing GPS msgs is absolutely trivial, even on the APM2. |
Hi tridge, it's no closed-source black box, the software just runs on a different (additional) MCU. And as far as I know the author, he will probably be happy to accept contributions to fix potential problems or to add missing features: https://github.com/Zubax/zubax_gnss After working with the module and UAVCAN in general for some weeks now, I have the impression that we don't have to give up anything. But it is well possible that we have to spend more effort to design clean interfaces and to agree them. |
This PR adds a very simple proxy driver for GNSS modules already supported PX4/Firmware. The driver could be enabled via GPS_TYPE parameter. The driver is useful e.g. for UAVCAN GNSS receivers, but not limited to them.
Note: this driver uses the same architectural approach as AP_Compass_PX4 and AP_Baro_PX4 do. In contrast to them, it uses a direct orb_subscribe() instead of a device file interfaces (there is no such thing in the current PX4 Firmware for GNSS devices).