58 DEVICE_LOG(
"failed to start uavcan sub: %d", res);
71 flow.integration_timespan = 1.e6f * msg.integration_interval;
72 flow.pixel_flow_x_integral = msg.flow_integral[0];
73 flow.pixel_flow_y_integral = msg.flow_integral[1];
75 flow.gyro_x_rate_integral = msg.rate_gyro_integral[0];
76 flow.gyro_y_rate_integral = msg.rate_gyro_integral[1];
78 flow.quality = msg.quality;
79 flow.max_flow_rate = 5.0f;
80 flow.min_ground_distance = 0.1f;
81 flow.max_ground_distance = 30.0f;
83 publish(msg.getSrcNodeID().get(), &flow);
void flow_sub_cb(const uavcan::ReceivedDataStructure< com::hex::equipment::flow::Measurement > &msg)
UavcanFlowBridge(uavcan::INode &node)
static const char *const NAME
High-resolution timer with callouts and timekeeping.
static char msg[NUM_MSG][CONFIG_USART1_TXBUFSIZE]
#define ORB_ID(_name)
Generates a pointer to the uORB metadata structure for a given topic.
This is the base class for redundant sensors with an independent ORB topic per each redundancy channe...
int init() override
Starts the bridge.
#define DEVICE_LOG(FMT,...)
uavcan::MethodBinder< UavcanFlowBridge *, void(UavcanFlowBridge::*)(const uavcan::ReceivedDataStructure< com::hex::equipment::flow::Measurement > &) > FlowCbBinder
uavcan::Subscriber< com::hex::equipment::flow::Measurement, FlowCbBinder > _sub_flow
void publish(const int node_id, const void *report)
Sends one measurement into appropriate ORB topic.
__EXPORT hrt_abstime hrt_absolute_time(void)
Get absolute time in [us] (does not wrap).