uavcannode: GPS working on cuav_can-gps-v1

- use sensor_gps directly from sensor rather than vehicle_gps_position (aggregated value)
This commit is contained in:
Daniel Agar
2021-01-13 21:33:49 -05:00
parent d8e8e23947
commit e96571b45d
4 changed files with 12 additions and 31 deletions
+2 -21
View File
@@ -27,8 +27,6 @@ px4_add_board(
ARCHITECTURE cortex-m4 ARCHITECTURE cortex-m4
ROMFSROOT cannode ROMFSROOT cannode
UAVCAN_INTERFACES 1 UAVCAN_INTERFACES 1
SERIAL_PORTS
GPS1:/dev/ttyS1
DRIVERS DRIVERS
barometer/ms5611 barometer/ms5611
bootloaders bootloaders
@@ -38,30 +36,13 @@ px4_add_board(
tone_alarm tone_alarm
uavcannode uavcannode
MODULES MODULES
#ekf2 load_mon
#load_mon
#sensors
#temperature_compensation
SYSTEMCMDS SYSTEMCMDS
#bl_update i2cdetect
#dmesg
#dumpfile
#esc_calib
#hardfault_log
#i2cdetect
led_control led_control
#mft
#mixer
#motor_ramp
#motor_test
#mtd
#nshterm
param param
perf perf
reboot reboot
#reflect
#sd_bench
#shutdown
top top
topic_listener topic_listener
tune_control tune_control
+1 -1
View File
@@ -3,7 +3,7 @@
# board sensors init # board sensors init
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#board_adc start gps start -d /dev/ttyS1 -g 38400 -p ubx
# Internal SPI # Internal SPI
ms5611 -s start ms5611 -s start
+7 -7
View File
@@ -306,10 +306,10 @@ void UavcanNode::Run()
dist.registerCallback(); dist.registerCallback();
} }
_sensor_baro_sub.registerCallback();
_sensor_mag_sub.registerCallback();
_optical_flow_sub.registerCallback(); _optical_flow_sub.registerCallback();
_vehicle_gps_position_sub.registerCallback(); _sensor_baro_sub.registerCallback();
_sensor_gps_sub.registerCallback();
_sensor_mag_sub.registerCallback();
_initialized = true; _initialized = true;
} }
@@ -462,11 +462,11 @@ void UavcanNode::Run()
} }
} }
// vehicle_gps_position -> uavcan::equipment::gnss::Fix2 // sensor_gps -> uavcan::equipment::gnss::Fix2
if (_vehicle_gps_position_sub.updated()) { if (_sensor_gps_sub.updated()) {
vehicle_gps_position_s gps; sensor_gps_s gps;
if (_vehicle_gps_position_sub.copy(&gps)) { if (_sensor_gps_sub.copy(&gps)) {
uavcan::equipment::gnss::Fix2 fix2{}; uavcan::equipment::gnss::Fix2 fix2{};
fix2.gnss_time_standard = fix2.GNSS_TIME_STANDARD_UTC; fix2.gnss_time_standard = fix2.GNSS_TIME_STANDARD_UTC;
+2 -2
View File
@@ -79,7 +79,7 @@
#include <uORB/topics/optical_flow.h> #include <uORB/topics/optical_flow.h>
#include <uORB/topics/sensor_baro.h> #include <uORB/topics/sensor_baro.h>
#include <uORB/topics/sensor_mag.h> #include <uORB/topics/sensor_mag.h>
#include <uORB/topics/vehicle_gps_position.h> #include <uORB/topics/sensor_gps.h>
using namespace time_literals; using namespace time_literals;
@@ -198,7 +198,7 @@ private:
uORB::SubscriptionCallbackWorkItem _optical_flow_sub{this, ORB_ID(optical_flow)}; uORB::SubscriptionCallbackWorkItem _optical_flow_sub{this, ORB_ID(optical_flow)};
uORB::SubscriptionCallbackWorkItem _sensor_baro_sub{this, ORB_ID(sensor_baro)}; uORB::SubscriptionCallbackWorkItem _sensor_baro_sub{this, ORB_ID(sensor_baro)};
uORB::SubscriptionCallbackWorkItem _sensor_mag_sub{this, ORB_ID(sensor_mag)}; uORB::SubscriptionCallbackWorkItem _sensor_mag_sub{this, ORB_ID(sensor_mag)};
uORB::SubscriptionCallbackWorkItem _vehicle_gps_position_sub{this, ORB_ID(vehicle_gps_position)}; uORB::SubscriptionCallbackWorkItem _sensor_gps_sub{this, ORB_ID(sensor_gps)};
perf_counter_t _cycle_perf; perf_counter_t _cycle_perf;
perf_counter_t _interval_perf; perf_counter_t _interval_perf;