mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
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:
parent
d8e8e23947
commit
e96571b45d
@ -27,8 +27,6 @@ px4_add_board(
|
||||
ARCHITECTURE cortex-m4
|
||||
ROMFSROOT cannode
|
||||
UAVCAN_INTERFACES 1
|
||||
SERIAL_PORTS
|
||||
GPS1:/dev/ttyS1
|
||||
DRIVERS
|
||||
barometer/ms5611
|
||||
bootloaders
|
||||
@ -38,30 +36,13 @@ px4_add_board(
|
||||
tone_alarm
|
||||
uavcannode
|
||||
MODULES
|
||||
#ekf2
|
||||
#load_mon
|
||||
#sensors
|
||||
#temperature_compensation
|
||||
load_mon
|
||||
SYSTEMCMDS
|
||||
#bl_update
|
||||
#dmesg
|
||||
#dumpfile
|
||||
#esc_calib
|
||||
#hardfault_log
|
||||
#i2cdetect
|
||||
i2cdetect
|
||||
led_control
|
||||
#mft
|
||||
#mixer
|
||||
#motor_ramp
|
||||
#motor_test
|
||||
#mtd
|
||||
#nshterm
|
||||
param
|
||||
perf
|
||||
reboot
|
||||
#reflect
|
||||
#sd_bench
|
||||
#shutdown
|
||||
top
|
||||
topic_listener
|
||||
tune_control
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
# board sensors init
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
#board_adc start
|
||||
gps start -d /dev/ttyS1 -g 38400 -p ubx
|
||||
|
||||
# Internal SPI
|
||||
ms5611 -s start
|
||||
|
||||
@ -306,10 +306,10 @@ void UavcanNode::Run()
|
||||
dist.registerCallback();
|
||||
}
|
||||
|
||||
_sensor_baro_sub.registerCallback();
|
||||
_sensor_mag_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;
|
||||
}
|
||||
@ -462,11 +462,11 @@ void UavcanNode::Run()
|
||||
}
|
||||
}
|
||||
|
||||
// vehicle_gps_position -> uavcan::equipment::gnss::Fix2
|
||||
if (_vehicle_gps_position_sub.updated()) {
|
||||
vehicle_gps_position_s gps;
|
||||
// sensor_gps -> uavcan::equipment::gnss::Fix2
|
||||
if (_sensor_gps_sub.updated()) {
|
||||
sensor_gps_s gps;
|
||||
|
||||
if (_vehicle_gps_position_sub.copy(&gps)) {
|
||||
if (_sensor_gps_sub.copy(&gps)) {
|
||||
uavcan::equipment::gnss::Fix2 fix2{};
|
||||
|
||||
fix2.gnss_time_standard = fix2.GNSS_TIME_STANDARD_UTC;
|
||||
|
||||
@ -79,7 +79,7 @@
|
||||
#include <uORB/topics/optical_flow.h>
|
||||
#include <uORB/topics/sensor_baro.h>
|
||||
#include <uORB/topics/sensor_mag.h>
|
||||
#include <uORB/topics/vehicle_gps_position.h>
|
||||
#include <uORB/topics/sensor_gps.h>
|
||||
|
||||
using namespace time_literals;
|
||||
|
||||
@ -198,7 +198,7 @@ private:
|
||||
uORB::SubscriptionCallbackWorkItem _optical_flow_sub{this, ORB_ID(optical_flow)};
|
||||
uORB::SubscriptionCallbackWorkItem _sensor_baro_sub{this, ORB_ID(sensor_baro)};
|
||||
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 _interval_perf;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user