mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-11 10:33:34 +08:00
uavcan: kconfig options for gnss handlers
This commit is contained in:
@@ -62,8 +62,20 @@ if DRIVERS_UAVCAN
|
||||
bool "Subscribe to Fuel Tank Status: uavcan::equipment::ice::FuelTankStatus"
|
||||
default y
|
||||
|
||||
config UAVCAN_SENSOR_GNSS
|
||||
bool "Subscribe to GPS: uavcan::equipment::gnss::Auxiliary | uavcan::equipment::gnss::Fix | uavcan::equipment::gnss::Fix2"
|
||||
config UAVCAN_SENSOR_GNSS_AUXILIARY
|
||||
bool "Subscribe to GPS Auxiliary: uavcan::equipment::gnss::Auxiliary"
|
||||
default y
|
||||
|
||||
config UAVCAN_SENSOR_GNSS_FIX
|
||||
bool "Subscribe to GPS Fix (deprecated): uavcan::equipment::gnss::Fix"
|
||||
default n
|
||||
|
||||
config UAVCAN_SENSOR_GNSS_FIX2
|
||||
bool "Subscribe to GPS Fix2: uavcan::equipment::gnss::Fix2"
|
||||
default n
|
||||
|
||||
config UAVCAN_SENSOR_GNSS_FIX3
|
||||
bool "Subscribe to GPS Fix3 (preferred): uavcan::equipment::gnss::Fix3"
|
||||
default y
|
||||
|
||||
config UAVCAN_SENSOR_GNSS_RELATIVE
|
||||
|
||||
@@ -56,29 +56,51 @@ const char *const UavcanGnssBridge::NAME = "gnss";
|
||||
UavcanGnssBridge::UavcanGnssBridge(uavcan::INode &node, NodeInfoPublisher *node_info_publisher) :
|
||||
UavcanSensorBridgeBase("uavcan_gnss", ORB_ID(sensor_gps), node_info_publisher),
|
||||
_node(node),
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_AUXILIARY)
|
||||
_sub_auxiliary(node),
|
||||
#endif
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX)
|
||||
_sub_fix(node),
|
||||
#endif
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX2)
|
||||
_sub_fix2(node),
|
||||
#endif
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX3)
|
||||
_sub_fix3(node),
|
||||
#endif
|
||||
_sub_gnss_heading(node),
|
||||
_sub_moving_baseline_data(node),
|
||||
_pub_moving_baseline_data(node),
|
||||
_pub_rtcm_stream(node),
|
||||
_channel_using_fix2(new bool[_max_channels]),
|
||||
_channel_using_fix3(new bool[_max_channels])
|
||||
_pub_rtcm_stream(node)
|
||||
{
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX) && (defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX2) || defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX3))
|
||||
_channel_using_fix2 = new bool[_max_channels];
|
||||
|
||||
for (uint8_t i = 0; i < _max_channels; i++) {
|
||||
_channel_using_fix2[i] = false;
|
||||
}
|
||||
|
||||
#endif
|
||||
#if (defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX) || defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX2)) && defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX3)
|
||||
_channel_using_fix3 = new bool[_max_channels];
|
||||
|
||||
for (uint8_t i = 0; i < _max_channels; i++) {
|
||||
_channel_using_fix3[i] = false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
set_device_type(DRV_GPS_DEVTYPE_UAVCAN);
|
||||
}
|
||||
|
||||
UavcanGnssBridge::~UavcanGnssBridge()
|
||||
{
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX) && (defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX2) || defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX3))
|
||||
delete [] _channel_using_fix2;
|
||||
#endif
|
||||
#if (defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX) || defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX2)) && defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX3)
|
||||
delete [] _channel_using_fix3;
|
||||
#endif
|
||||
perf_free(_rtcm_stream_pub_perf);
|
||||
perf_free(_moving_baseline_data_pub_perf);
|
||||
perf_free(_moving_baseline_data_sub_perf);
|
||||
@@ -87,13 +109,19 @@ UavcanGnssBridge::~UavcanGnssBridge()
|
||||
int
|
||||
UavcanGnssBridge::init()
|
||||
{
|
||||
int res = _sub_auxiliary.start(AuxiliaryCbBinder(this, &UavcanGnssBridge::gnss_auxiliary_sub_cb));
|
||||
int res = 0;
|
||||
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_AUXILIARY)
|
||||
res = _sub_auxiliary.start(AuxiliaryCbBinder(this, &UavcanGnssBridge::gnss_auxiliary_sub_cb));
|
||||
|
||||
if (res < 0) {
|
||||
PX4_WARN("GNSS auxiliary sub failed %i", res);
|
||||
return res;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX)
|
||||
res = _sub_fix.start(FixCbBinder(this, &UavcanGnssBridge::gnss_fix_sub_cb));
|
||||
|
||||
if (res < 0) {
|
||||
@@ -101,6 +129,9 @@ UavcanGnssBridge::init()
|
||||
return res;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX2)
|
||||
res = _sub_fix2.start(Fix2CbBinder(this, &UavcanGnssBridge::gnss_fix2_sub_cb));
|
||||
|
||||
if (res < 0) {
|
||||
@@ -108,6 +139,9 @@ UavcanGnssBridge::init()
|
||||
return res;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX3)
|
||||
res = _sub_fix3.start(Fix3CbBinder(this, &UavcanGnssBridge::gnss_fix3_sub_cb));
|
||||
|
||||
if (res < 0) {
|
||||
@@ -115,6 +149,8 @@ UavcanGnssBridge::init()
|
||||
return res;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
res = _sub_gnss_heading.start(RelPosHeadingCbBinder(this, &UavcanGnssBridge::gnss_relative_sub_cb));
|
||||
|
||||
if (res < 0) {
|
||||
@@ -154,6 +190,7 @@ UavcanGnssBridge::init()
|
||||
return res;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_AUXILIARY)
|
||||
void
|
||||
UavcanGnssBridge::gnss_auxiliary_sub_cb(const uavcan::ReceivedDataStructure<uavcan::equipment::gnss::Auxiliary> &msg)
|
||||
{
|
||||
@@ -162,7 +199,9 @@ UavcanGnssBridge::gnss_auxiliary_sub_cb(const uavcan::ReceivedDataStructure<uavc
|
||||
_last_gnss_auxiliary_hdop = msg.hdop;
|
||||
_last_gnss_auxiliary_vdop = msg.vdop;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX)
|
||||
void
|
||||
UavcanGnssBridge::gnss_fix_sub_cb(const uavcan::ReceivedDataStructure<uavcan::equipment::gnss::Fix> &msg)
|
||||
{
|
||||
@@ -170,10 +209,20 @@ UavcanGnssBridge::gnss_fix_sub_cb(const uavcan::ReceivedDataStructure<uavcan::eq
|
||||
// If so, ignore the old "Fix" message for this node.
|
||||
const int8_t ch = get_channel_index_for_node(msg.getSrcNodeID().get());
|
||||
|
||||
if (ch > -1 && (_channel_using_fix2[ch] || _channel_using_fix3[ch])) {
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX2) || defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX3)
|
||||
|
||||
if (ch > -1 && (_channel_using_fix2[ch]
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX3)
|
||||
|| _channel_using_fix3[ch]
|
||||
#endif
|
||||
)) {
|
||||
return;
|
||||
}
|
||||
|
||||
#else
|
||||
(void)ch;
|
||||
#endif
|
||||
|
||||
uint8_t fix_type = msg.status;
|
||||
|
||||
const bool valid_pos_cov = !msg.position_covariance.empty();
|
||||
@@ -187,7 +236,9 @@ UavcanGnssBridge::gnss_fix_sub_cb(const uavcan::ReceivedDataStructure<uavcan::eq
|
||||
|
||||
process_fixx(msg, fix_type, pos_cov, vel_cov, valid_pos_cov, valid_vel_cov, NAN, NAN, NAN, -1, -1, 0, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX2)
|
||||
void
|
||||
UavcanGnssBridge::gnss_fix2_sub_cb(const uavcan::ReceivedDataStructure<uavcan::equipment::gnss::Fix2> &msg)
|
||||
{
|
||||
@@ -195,16 +246,26 @@ UavcanGnssBridge::gnss_fix2_sub_cb(const uavcan::ReceivedDataStructure<uavcan::e
|
||||
|
||||
const int8_t ch = get_channel_index_for_node(msg.getSrcNodeID().get());
|
||||
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX3)
|
||||
|
||||
// If this node is using Fix3, ignore Fix2 messages
|
||||
if (ch > -1 && _channel_using_fix3[ch]) {
|
||||
return;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX)
|
||||
|
||||
if (ch > -1 && !_channel_using_fix2[ch]) {
|
||||
PX4_WARN("GNSS Fix2 msg detected for ch %d; disabling Fix msg for this node", ch);
|
||||
_channel_using_fix2[ch] = true;
|
||||
}
|
||||
|
||||
#else
|
||||
(void)ch;
|
||||
#endif
|
||||
|
||||
uint8_t fix_type = msg.status;
|
||||
|
||||
switch (msg.mode) {
|
||||
@@ -365,12 +426,15 @@ UavcanGnssBridge::gnss_fix2_sub_cb(const uavcan::ReceivedDataStructure<uavcan::e
|
||||
process_fixx(msg, fix_type, pos_cov, vel_cov, valid_covariances, valid_covariances, heading, heading_offset,
|
||||
heading_accuracy, noise_per_ms, jamming_indicator, jamming_state, spoofing_state);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX3)
|
||||
void
|
||||
UavcanGnssBridge::gnss_fix3_sub_cb(const uavcan::ReceivedDataStructure<uavcan::equipment::gnss::Fix3> &msg)
|
||||
{
|
||||
using uavcan::equipment::gnss::Fix3;
|
||||
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX) || defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX2)
|
||||
const int8_t ch = get_channel_index_for_node(msg.getSrcNodeID().get());
|
||||
|
||||
if (ch > -1 && !_channel_using_fix3[ch]) {
|
||||
@@ -378,6 +442,8 @@ UavcanGnssBridge::gnss_fix3_sub_cb(const uavcan::ReceivedDataStructure<uavcan::e
|
||||
_channel_using_fix3[ch] = true;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
sensor_gps_s sensor_gps{};
|
||||
|
||||
sensor_gps.device_id = make_uavcan_device_id(msg);
|
||||
@@ -526,6 +592,7 @@ UavcanGnssBridge::gnss_fix3_sub_cb(const uavcan::ReceivedDataStructure<uavcan::e
|
||||
|
||||
publish(msg.getSrcNodeID().get(), &sensor_gps);
|
||||
}
|
||||
#endif
|
||||
|
||||
void UavcanGnssBridge::gnss_relative_sub_cb(const
|
||||
uavcan::ReceivedDataStructure<ardupilot::gnss::RelPosHeading> &msg)
|
||||
@@ -570,6 +637,7 @@ void UavcanGnssBridge::moving_baseline_data_sub_cb(const
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX) || defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX2)
|
||||
template <typename FixType>
|
||||
void UavcanGnssBridge::process_fixx(const uavcan::ReceivedDataStructure<FixType> &msg,
|
||||
uint8_t fix_type,
|
||||
@@ -699,11 +767,15 @@ void UavcanGnssBridge::process_fixx(const uavcan::ReceivedDataStructure<FixType>
|
||||
|
||||
sensor_gps.satellites_used = msg.sats_used;
|
||||
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_AUXILIARY)
|
||||
|
||||
if (hrt_elapsed_time(&_last_gnss_auxiliary_timestamp) < 2_s) {
|
||||
sensor_gps.hdop = _last_gnss_auxiliary_hdop;
|
||||
sensor_gps.vdop = _last_gnss_auxiliary_vdop;
|
||||
|
||||
} else {
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
// Using PDOP for HDOP and VDOP
|
||||
// Relevant discussion: https://github.com/PX4/Firmware/issues/5153
|
||||
sensor_gps.hdop = msg.pdop;
|
||||
@@ -736,6 +808,7 @@ void UavcanGnssBridge::process_fixx(const uavcan::ReceivedDataStructure<FixType>
|
||||
|
||||
publish(msg.getSrcNodeID().get(), &sensor_gps);
|
||||
}
|
||||
#endif
|
||||
|
||||
void UavcanGnssBridge::update()
|
||||
{
|
||||
|
||||
@@ -35,9 +35,9 @@
|
||||
* @file gnss.hpp
|
||||
*
|
||||
* UAVCAN <--> ORB bridge for GNSS messages:
|
||||
* uavcan.equipment.gnss.Fix (deprecated, but still supported for backward compatibility)
|
||||
* uavcan.equipment.gnss.Fix2
|
||||
* uavcan.equipment.gnss.Fix3 (preferred, uses direct EPH/EPV fields)
|
||||
* uavcan.equipment.gnss.Fix (deprecated, disabled by default via CONFIG_UAVCAN_SENSOR_GNSS_FIX)
|
||||
* uavcan.equipment.gnss.Fix2 (enabled by default via CONFIG_UAVCAN_SENSOR_GNSS_FIX2)
|
||||
* uavcan.equipment.gnss.Fix3 (preferred, enabled by default via CONFIG_UAVCAN_SENSOR_GNSS_FIX3)
|
||||
*
|
||||
* @author Pavel Kirienko <pavel.kirienko@gmail.com>
|
||||
* @author Andrew Chambers <achamber@gmail.com>
|
||||
@@ -53,10 +53,18 @@
|
||||
#include <uORB/topics/gps_dump.h>
|
||||
|
||||
#include <uavcan/uavcan.hpp>
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_AUXILIARY)
|
||||
#include <uavcan/equipment/gnss/Auxiliary.hpp>
|
||||
#endif
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX)
|
||||
#include <uavcan/equipment/gnss/Fix.hpp>
|
||||
#endif
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX2)
|
||||
#include <uavcan/equipment/gnss/Fix2.hpp>
|
||||
#endif
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX3)
|
||||
#include <uavcan/equipment/gnss/Fix3.hpp>
|
||||
#endif
|
||||
#include <ardupilot/gnss/MovingBaselineData.hpp>
|
||||
#include <ardupilot/gnss/RelPosHeading.hpp>
|
||||
#include <uavcan/equipment/gnss/RTCMStream.hpp>
|
||||
@@ -83,14 +91,23 @@ private:
|
||||
/**
|
||||
* GNSS fix message will be reported via this callback.
|
||||
*/
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_AUXILIARY)
|
||||
void gnss_auxiliary_sub_cb(const uavcan::ReceivedDataStructure<uavcan::equipment::gnss::Auxiliary> &msg);
|
||||
#endif
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX)
|
||||
void gnss_fix_sub_cb(const uavcan::ReceivedDataStructure<uavcan::equipment::gnss::Fix> &msg);
|
||||
#endif
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX2)
|
||||
void gnss_fix2_sub_cb(const uavcan::ReceivedDataStructure<uavcan::equipment::gnss::Fix2> &msg);
|
||||
#endif
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX3)
|
||||
void gnss_fix3_sub_cb(const uavcan::ReceivedDataStructure<uavcan::equipment::gnss::Fix3> &msg);
|
||||
#endif
|
||||
void gnss_relative_sub_cb(const uavcan::ReceivedDataStructure<ardupilot::gnss::RelPosHeading> &msg);
|
||||
void moving_baseline_data_sub_cb(const uavcan::ReceivedDataStructure<ardupilot::gnss::MovingBaselineData> &msg);
|
||||
|
||||
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX) || defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX2)
|
||||
template <typename FixType>
|
||||
void process_fixx(const uavcan::ReceivedDataStructure<FixType> &msg,
|
||||
uint8_t fix_type,
|
||||
@@ -100,26 +117,35 @@ private:
|
||||
const float heading_accuracy, const int32_t noise_per_ms,
|
||||
const int32_t jamming_indicator, const uint8_t jamming_state,
|
||||
const uint8_t spoofing_state);
|
||||
#endif
|
||||
|
||||
void handleInjectDataTopic();
|
||||
bool PublishRTCMStream(const uint8_t *data, size_t data_len);
|
||||
bool PublishMovingBaselineData(const uint8_t *data, size_t data_len);
|
||||
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_AUXILIARY)
|
||||
typedef uavcan::MethodBinder < UavcanGnssBridge *,
|
||||
void (UavcanGnssBridge::*)(const uavcan::ReceivedDataStructure<uavcan::equipment::gnss::Auxiliary> &) >
|
||||
AuxiliaryCbBinder;
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX)
|
||||
typedef uavcan::MethodBinder < UavcanGnssBridge *,
|
||||
void (UavcanGnssBridge::*)(const uavcan::ReceivedDataStructure<uavcan::equipment::gnss::Fix> &) >
|
||||
FixCbBinder;
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX2)
|
||||
typedef uavcan::MethodBinder < UavcanGnssBridge *,
|
||||
void (UavcanGnssBridge::*)(const uavcan::ReceivedDataStructure<uavcan::equipment::gnss::Fix2> &) >
|
||||
Fix2CbBinder;
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX3)
|
||||
typedef uavcan::MethodBinder < UavcanGnssBridge *,
|
||||
void (UavcanGnssBridge::*)(const uavcan::ReceivedDataStructure<uavcan::equipment::gnss::Fix3> &) >
|
||||
Fix3CbBinder;
|
||||
#endif
|
||||
|
||||
typedef uavcan::MethodBinder<UavcanGnssBridge *,
|
||||
void (UavcanGnssBridge::*)(const uavcan::TimerEvent &)>
|
||||
@@ -135,10 +161,18 @@ private:
|
||||
|
||||
uavcan::INode &_node;
|
||||
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_AUXILIARY)
|
||||
uavcan::Subscriber<uavcan::equipment::gnss::Auxiliary, AuxiliaryCbBinder> _sub_auxiliary;
|
||||
#endif
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX)
|
||||
uavcan::Subscriber<uavcan::equipment::gnss::Fix, FixCbBinder> _sub_fix;
|
||||
#endif
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX2)
|
||||
uavcan::Subscriber<uavcan::equipment::gnss::Fix2, Fix2CbBinder> _sub_fix2;
|
||||
#endif
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX3)
|
||||
uavcan::Subscriber<uavcan::equipment::gnss::Fix3, Fix3CbBinder> _sub_fix3;
|
||||
#endif
|
||||
uavcan::Subscriber<ardupilot::gnss::RelPosHeading, RelPosHeadingCbBinder> _sub_gnss_heading;
|
||||
|
||||
// Used for MSM7 logging for PPK workflows
|
||||
@@ -147,9 +181,11 @@ private:
|
||||
uavcan::Publisher<ardupilot::gnss::MovingBaselineData> _pub_moving_baseline_data;
|
||||
uavcan::Publisher<uavcan::equipment::gnss::RTCMStream> _pub_rtcm_stream;
|
||||
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_AUXILIARY)
|
||||
uint64_t _last_gnss_auxiliary_timestamp{0};
|
||||
float _last_gnss_auxiliary_hdop{0.0f};
|
||||
float _last_gnss_auxiliary_vdop{0.0f};
|
||||
#endif
|
||||
|
||||
uORB::SubscriptionMultiArray<gps_inject_data_s, gps_inject_data_s::MAX_INSTANCES> _orb_inject_data_sub{ORB_ID::gps_inject_data};
|
||||
hrt_abstime _last_rtcm_injection_time{0}; ///< time of last rtcm injection
|
||||
@@ -159,8 +195,12 @@ private:
|
||||
|
||||
bool _system_clock_set{false}; ///< Have we set the system clock at least once from GNSS data?
|
||||
|
||||
bool *_channel_using_fix2; ///< Flag for whether each channel is using Fix2 or Fix msg
|
||||
bool *_channel_using_fix3; ///< Flag for whether each channel is using Fix3 (takes priority over Fix2 and Fix)
|
||||
#if defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX) && (defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX2) || defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX3))
|
||||
bool *_channel_using_fix2{nullptr}; ///< Flag for whether each channel is using Fix2 or Fix msg
|
||||
#endif
|
||||
#if (defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX) || defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX2)) && defined(CONFIG_UAVCAN_SENSOR_GNSS_FIX3)
|
||||
bool *_channel_using_fix3{nullptr}; ///< Flag for whether each channel is using Fix3 (takes priority over Fix2 and Fix)
|
||||
#endif
|
||||
|
||||
bool _publish_rtcm_stream{false};
|
||||
bool _publish_moving_baseline_data{false};
|
||||
|
||||
@@ -30,10 +30,18 @@ if DRIVERS_UAVCANNODE
|
||||
bool "Include flow measurement"
|
||||
default n
|
||||
|
||||
config UAVCANNODE_GNSS_FIX
|
||||
bool "Include GNSS fix"
|
||||
config UAVCANNODE_GNSS_AUXILIARY
|
||||
bool "Include GNSS Auxiliary publisher"
|
||||
default n
|
||||
|
||||
config UAVCANNODE_GNSS_FIX2
|
||||
bool "Include GNSS Fix2 publisher"
|
||||
default n
|
||||
|
||||
config UAVCANNODE_GNSS_FIX3
|
||||
bool "Include GNSS Fix3 publisher (preferred)"
|
||||
default y
|
||||
|
||||
config UAVCANNODE_HYGROMETER_MEASUREMENT
|
||||
bool "Include hygrometer measurement"
|
||||
default n
|
||||
|
||||
@@ -56,11 +56,17 @@
|
||||
#include "Publishers/HygrometerMeasurement.hpp"
|
||||
#endif // UAVCANNODE_HYGROMETER_MEASUREMENT
|
||||
|
||||
#if defined(CONFIG_UAVCANNODE_GNSS_FIX)
|
||||
#include "Publishers/GnssFix2.hpp"
|
||||
#include "Publishers/GnssFix3.hpp"
|
||||
#if defined(CONFIG_UAVCANNODE_GNSS_AUXILIARY)
|
||||
#include "Publishers/GnssAuxiliary.hpp"
|
||||
#endif // CONFIG_UAVCANNODE_GNSS_FIX
|
||||
#endif // CONFIG_UAVCANNODE_GNSS_AUXILIARY
|
||||
|
||||
#if defined(CONFIG_UAVCANNODE_GNSS_FIX2)
|
||||
#include "Publishers/GnssFix2.hpp"
|
||||
#endif // CONFIG_UAVCANNODE_GNSS_FIX2
|
||||
|
||||
#if defined(CONFIG_UAVCANNODE_GNSS_FIX3)
|
||||
#include "Publishers/GnssFix3.hpp"
|
||||
#endif // CONFIG_UAVCANNODE_GNSS_FIX3
|
||||
|
||||
#if defined(CONFIG_UAVCANNODE_INDICATED_AIR_SPEED)
|
||||
#include "Publishers/IndicatedAirspeed.hpp"
|
||||
@@ -379,11 +385,17 @@ int UavcanNode::init(uavcan::NodeID node_id, UAVCAN_DRIVER::BusEvent &bus_events
|
||||
_publisher_list.add(new HygrometerMeasurement(this, _node));
|
||||
#endif // UAVCANNODE_HYGROMETER_MEASUREMENT
|
||||
|
||||
#if defined(CONFIG_UAVCANNODE_GNSS_FIX)
|
||||
#if defined(CONFIG_UAVCANNODE_GNSS_FIX3)
|
||||
_publisher_list.add(new GnssFix3(this, _node));
|
||||
#endif // CONFIG_UAVCANNODE_GNSS_FIX3
|
||||
|
||||
#if defined(CONFIG_UAVCANNODE_GNSS_FIX2)
|
||||
_publisher_list.add(new GnssFix2(this, _node)); // Keep Fix2 for backwards compatibility
|
||||
#endif // CONFIG_UAVCANNODE_GNSS_FIX2
|
||||
|
||||
#if defined(CONFIG_UAVCANNODE_GNSS_AUXILIARY)
|
||||
_publisher_list.add(new GnssAuxiliary(this, _node));
|
||||
#endif // CONFIG_UAVCANNODE_GNSS_FIX
|
||||
#endif // CONFIG_UAVCANNODE_GNSS_AUXILIARY
|
||||
|
||||
#if defined(CONFIG_UAVCANNODE_MAGNETIC_FIELD_STRENGTH)
|
||||
int32_t cannode_pub_mag = 1;
|
||||
|
||||
Reference in New Issue
Block a user