mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-26 17:36:40 +08:00
add base class and template subscriber class as well to improve interface to get last msg value
This commit is contained in:
@@ -78,5 +78,5 @@ SubscriberExample::SubscriberExample() :
|
||||
void SubscriberExample::rc_channels_callback(const PX4_TOPIC_T(rc_channels) &msg) {
|
||||
PX4_INFO("Subscriber callback: [%llu], value of _sub_rc_chan: [%llu]",
|
||||
msg.timestamp_last_valid,
|
||||
((PX4_SUBSCRIBER_T(rc_channels) *)_sub_rc_chan)->get_msg().timestamp_last_valid);
|
||||
_sub_rc_chan->get_msg().timestamp_last_valid);
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ protected:
|
||||
int32_t _interval;
|
||||
px4_param_t _p_test_float;
|
||||
float _test_float;
|
||||
px4::Subscriber * _sub_rc_chan;
|
||||
px4::PX4_SUBSCRIBER(rc_channels) * _sub_rc_chan;
|
||||
|
||||
void rc_channels_callback(const PX4_TOPIC_T(rc_channels) &msg);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user