51 #include <uavcan/uavcan.hpp> 52 #include <uavcan/equipment/gnss/Auxiliary.hpp> 53 #include <uavcan/equipment/gnss/Fix.hpp> 54 #include <uavcan/equipment/gnss/Fix2.hpp> 63 static const char *
const NAME;
81 void gnss_fix_sub_cb(
const uavcan::ReceivedDataStructure<uavcan::equipment::gnss::Fix> &msg);
82 void gnss_fix2_sub_cb(
const uavcan::ReceivedDataStructure<uavcan::equipment::gnss::Fix2> &msg);
84 template <
typename FixType>
85 void process_fixx(
const uavcan::ReceivedDataStructure<FixType> &msg,
86 const float (&pos_cov)[9],
const float (&vel_cov)[9],
87 const bool valid_pos_cov,
const bool valid_vel_cov);
92 void (UavcanGnssBridge::*)(
const uavcan::ReceivedDataStructure<uavcan::equipment::gnss::Auxiliary> &) >
95 typedef uavcan::MethodBinder < UavcanGnssBridge *,
96 void (UavcanGnssBridge::*)(
const uavcan::ReceivedDataStructure<uavcan::equipment::gnss::Fix> &) >
99 typedef uavcan::MethodBinder < UavcanGnssBridge *,
100 void (UavcanGnssBridge::*)(
const uavcan::ReceivedDataStructure<uavcan::equipment::gnss::Fix2> &) >
103 typedef uavcan::MethodBinder<UavcanGnssBridge *,
104 void (UavcanGnssBridge::*)(
const uavcan::TimerEvent &)>
109 uavcan::Subscriber<uavcan::equipment::gnss::Auxiliary, AuxiliaryCbBinder>
_sub_auxiliary;
110 uavcan::Subscriber<uavcan::equipment::gnss::Fix, FixCbBinder>
_sub_fix;
111 uavcan::Subscriber<uavcan::equipment::gnss::Fix2, Fix2CbBinder>
_sub_fix2;
113 uavcan::Publisher<uavcan::equipment::gnss::Fix2>
_pub_fix2;
void gnss_fix2_sub_cb(const uavcan::ReceivedDataStructure< uavcan::equipment::gnss::Fix2 > &msg)
int init() override
Starts the bridge.
~UavcanGnssBridge()=default
bool _old_fix_subscriber_active
uavcan::MethodBinder< UavcanGnssBridge *, void(UavcanGnssBridge::*)(const uavcan::ReceivedDataStructure< uavcan::equipment::gnss::Auxiliary > &) > AuxiliaryCbBinder
uavcan::Publisher< uavcan::equipment::gnss::Fix2 > _pub_fix2
bool _system_clock_set
Have we set the system clock at least once from GNSS data?
static constexpr unsigned ORB_TO_UAVCAN_FREQUENCY_HZ
UavcanGnssBridge(uavcan::INode &node)
const char * get_name() const override
Returns ASCII name of the bridge.
uORB::Subscription _orb_sub_gnss
uavcan::TimerEventForwarder< TimerCbBinder > _orb_to_uavcan_pub_timer
void broadcast_from_orb(const uavcan::TimerEvent &)
uavcan::MethodBinder< UavcanGnssBridge *, void(UavcanGnssBridge::*)(const uavcan::TimerEvent &)> TimerCbBinder
static char msg[NUM_MSG][CONFIG_USART1_TXBUFSIZE]
uORB::PublicationMulti< vehicle_gps_position_s > _gps_pub
#define ORB_ID(_name)
Generates a pointer to the uORB metadata structure for a given topic.
void gnss_fix_sub_cb(const uavcan::ReceivedDataStructure< uavcan::equipment::gnss::Fix > &msg)
uavcan::MethodBinder< UavcanGnssBridge *, void(UavcanGnssBridge::*)(const uavcan::ReceivedDataStructure< uavcan::equipment::gnss::Fix > &) > FixCbBinder
uavcan::Subscriber< uavcan::equipment::gnss::Fix, FixCbBinder > _sub_fix
uavcan::MethodBinder< UavcanGnssBridge *, void(UavcanGnssBridge::*)(const uavcan::ReceivedDataStructure< uavcan::equipment::gnss::Fix2 > &) > Fix2CbBinder
unsigned get_num_redundant_channels() const override
Returns number of active redundancy channels.
uavcan::Subscriber< uavcan::equipment::gnss::Fix2, Fix2CbBinder > _sub_fix2
void gnss_auxiliary_sub_cb(const uavcan::ReceivedDataStructure< uavcan::equipment::gnss::Auxiliary > &msg)
GNSS fix message will be reported via this callback.
uavcan::Subscriber< uavcan::equipment::gnss::Auxiliary, AuxiliaryCbBinder > _sub_auxiliary
float _last_gnss_auxiliary_hdop
static const char *const NAME
float _last_gnss_auxiliary_vdop
uint64_t _last_gnss_auxiliary_timestamp
void print_status() const override
Prints current status in a human readable format to stdout.
void process_fixx(const uavcan::ReceivedDataStructure< FixType > &msg, const float(&pos_cov)[9], const float(&vel_cov)[9], const bool valid_pos_cov, const bool valid_vel_cov)
A sensor bridge class must implement this interface.