mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 22:33:34 +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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user