Use Multiple GPS in PX4 with PX4 supported package?

5 views (last 30 days)
Hello,
I am trying to use multiple GPS(one for GPS1 port and one for CAN1 port) with my own developed control algorithm.
I am currently using cube orange board and it is successfully connected with UAVCAN gps as I set the UAVCAN_ENABLE paramter to 2 as document said.
However, I am not sure how can I use multiple GPS for robustness in EKF fusion.
The PX4 document said I have to enable UAVCAN_SUB_GPS paramter, but there is no such parameter.
Do MATLAB did not yet support multiple GPS settings in case of one for GPS1 port and one for CAN communication?
Or is it ok that I just connect two gps and EKF will automatically find two gps signals and fusion it?
I am currently using R2023a version and latest uav toolbox version.
Below is related link I found in PX4 software.
https://docs.px4.io/main/en/dronecan/
Thank you for your answer in advance.
Sincerely,
Jongwon Lee
  1 Comment
UDAYA PEDDIRAJU
UDAYA PEDDIRAJU on 22 Sep 2023
Hi Jongwon Lee,
I understood that you’re looking for multiple GPS connectivity to the cube orange board, The use of multiple GPS units with PX4 and MATLAB is indeed possible, but there are a few things to consider.
Firstly, the GPS module is enabled by default in the startup script (“rc.txt”) available with UAV Toolbox Support Package for PX4 Autopilots. In this startup script, only the main GPS device is enabled on the port ‘/dev/ttyS3’. To enable main GPS on a different serial port or to enable secondary GPS, you would need to modify the “rc.txt” manually.
Secondly, when it comes to blending or using multiple GPS units, it’s usually recommended to use two GPS units from the same manufacturer because the scaling of the accuracy numbers varies and will lead to favouring one GPS over the other.
In addition, based on the PX4 documentation you provided, it seems that there are specific parameters for enabling UAVCAN subscriptions such as “UAVCAN_SUB_GPS” for GPS. A system reboot is required after changing this parameter. However, please note that these settings are specific to the PX4 firmware.
Also, please note that if you’re using the PX4 CAN transmit and receive block from the UAV Toolbox Support Package for PX4 Autopilots, you should disable UAVCAN before working with PX4 CAN blocks by setting the PX4 parameter, “UAVCAN_ENABLE” to 0. Unfortunately, CAN blocks are not supported on “STM32H7” based autopilots (Cube Orange and Pixhawk 6x).
for reading GPS data from PX4 autopilot please refer to Reading GPS Data from PX4 Autopilot - MATLAB & Simulink Example - MathWorks India, to read more about PX4 CAN receive followed by transmit please refer to Receive message from CAN network - Simulink - MathWorks India and for UAVCAN_SUB_GPS please refer to Parameter Reference | PX4 User Guide
Best regards,
Uday

Sign in to comment.

Accepted Answer

Arun Mathamkode
Arun Mathamkode on 2 Apr 2024
It is possible to use two GPS over serial connection. Most of the Pixhawk boards will have two GPS ports (GPS1 and GPS2) and it will be marked in the hardware. You can enable these using GPS_1_CONFIG and GPS_2_CONFIG paramters.
I am not sure if you can use one GPS over serial and other over UAVCAN. As per my undertsanding as soon as you enable UAVCAN, only the GPS connected through UAVCAN will be active.
parameter UAVCAN_SUB_GPS is not available in PX4 v1.12 and it is available in only newer versions.

More Answers (0)

Tags

Products


Release

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!