Skip to content
Snippets Groups Projects
Commit 1990338a authored by bastien's avatar bastien Committed by Kabir Mohammed
Browse files

gps: Support for Emlid Reach


Support Emlid Reach in ERB format,
including autodetect

Reported-by: default avatarBastien Auneau <bastien.auneau@while-true.fr>
parent 9692ef1a
No related branches found
No related tags found
No related merge requests found
...@@ -44,6 +44,7 @@ px4_add_module( ...@@ -44,6 +44,7 @@ px4_add_module(
devices/src/ashtech.cpp devices/src/ashtech.cpp
devices/src/ubx.cpp devices/src/ubx.cpp
devices/src/rtcm.cpp devices/src/rtcm.cpp
devices/src/emlid_reach.cpp
MODULE_CONFIG MODULE_CONFIG
module.yaml module.yaml
DEPENDS DEPENDS
......
Subproject commit 2fecb4912dd8c97a9eee42c5dbecfb58c4aeb9ee Subproject commit a6687961ec328a1694916618f9160eaed555d4be
...@@ -86,6 +86,7 @@ ...@@ -86,6 +86,7 @@
#include "devices/src/ubx.h" #include "devices/src/ubx.h"
#include "devices/src/mtk.h" #include "devices/src/mtk.h"
#include "devices/src/ashtech.h" #include "devices/src/ashtech.h"
#include "devices/src/emlid_reach.h"
#ifdef __PX4_LINUX #ifdef __PX4_LINUX
#include <linux/spi/spidev.h> #include <linux/spi/spidev.h>
...@@ -98,7 +99,8 @@ typedef enum { ...@@ -98,7 +99,8 @@ typedef enum {
GPS_DRIVER_MODE_NONE = 0, GPS_DRIVER_MODE_NONE = 0,
GPS_DRIVER_MODE_UBX, GPS_DRIVER_MODE_UBX,
GPS_DRIVER_MODE_MTK, GPS_DRIVER_MODE_MTK,
GPS_DRIVER_MODE_ASHTECH GPS_DRIVER_MODE_ASHTECH,
GPS_DRIVER_MODE_EMLIDREACH
} gps_driver_mode_t; } gps_driver_mode_t;
/* struct for dynamic allocation of satellite info data */ /* struct for dynamic allocation of satellite info data */
...@@ -720,6 +722,10 @@ GPS::run() ...@@ -720,6 +722,10 @@ GPS::run()
_helper = new GPSDriverAshtech(&GPS::callback, this, &_report_gps_pos, _p_report_sat_info, heading_offset); _helper = new GPSDriverAshtech(&GPS::callback, this, &_report_gps_pos, _p_report_sat_info, heading_offset);
break; break;
case GPS_DRIVER_MODE_EMLIDREACH:
_helper = new GPSDriverEmlidReach(&GPS::callback, this, &_report_gps_pos, _p_report_sat_info);
break;
default: default:
break; break;
} }
...@@ -782,6 +788,10 @@ GPS::run() ...@@ -782,6 +788,10 @@ GPS::run()
// mode_str = "ASHTECH"; // mode_str = "ASHTECH";
// break; // break;
// //
// case GPS_DRIVER_MODE_EMLIDREACH:
// mode_str = "EMLID REACH";
// break;
//
// default: // default:
// break; // break;
// } // }
...@@ -809,6 +819,10 @@ GPS::run() ...@@ -809,6 +819,10 @@ GPS::run()
break; break;
case GPS_DRIVER_MODE_ASHTECH: case GPS_DRIVER_MODE_ASHTECH:
_mode = GPS_DRIVER_MODE_EMLIDREACH;
break;
case GPS_DRIVER_MODE_EMLIDREACH:
_mode = GPS_DRIVER_MODE_UBX; _mode = GPS_DRIVER_MODE_UBX;
px4_usleep(500000); // tried all possible drivers. Wait a bit before next round px4_usleep(500000); // tried all possible drivers. Wait a bit before next round
break; break;
...@@ -877,6 +891,10 @@ GPS::print_status() ...@@ -877,6 +891,10 @@ GPS::print_status()
PX4_INFO("protocol: ASHTECH"); PX4_INFO("protocol: ASHTECH");
break; break;
case GPS_DRIVER_MODE_EMLIDREACH:
PX4_INFO("protocol: EMLIDREACH");
break;
default: default:
break; break;
} }
...@@ -976,7 +994,7 @@ gps start -d /dev/ttyS3 -e /dev/ttyS4 ...@@ -976,7 +994,7 @@ gps start -d /dev/ttyS3 -e /dev/ttyS4
PRINT_MODULE_USAGE_PARAM_FLAG('s', "Enable publication of satellite info", true); PRINT_MODULE_USAGE_PARAM_FLAG('s', "Enable publication of satellite info", true);
PRINT_MODULE_USAGE_PARAM_STRING('i', "uart", "spi|uart", "GPS interface", true); PRINT_MODULE_USAGE_PARAM_STRING('i', "uart", "spi|uart", "GPS interface", true);
PRINT_MODULE_USAGE_PARAM_STRING('p', nullptr, "ubx|mtk|ash", "GPS Protocol (default=auto select)", true); PRINT_MODULE_USAGE_PARAM_STRING('p', nullptr, "ubx|mtk|ash|eml", "GPS Protocol (default=auto select)", true);
PRINT_MODULE_USAGE_DEFAULT_COMMANDS(); PRINT_MODULE_USAGE_DEFAULT_COMMANDS();
...@@ -1107,6 +1125,9 @@ GPS *GPS::instantiate(int argc, char *argv[], Instance instance) ...@@ -1107,6 +1125,9 @@ GPS *GPS::instantiate(int argc, char *argv[], Instance instance)
} else if (!strcmp(myoptarg, "ash")) { } else if (!strcmp(myoptarg, "ash")) {
mode = GPS_DRIVER_MODE_ASHTECH; mode = GPS_DRIVER_MODE_ASHTECH;
} else if (!strcmp(myoptarg, "eml")) {
mode = GPS_DRIVER_MODE_EMLIDREACH;
} else { } else {
PX4_ERR("unknown interface: %s", myoptarg); PX4_ERR("unknown interface: %s", myoptarg);
error_flag = true; error_flag = true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment