mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-29 12:23:33 +08:00
Merge branch 'ros_messagelayer_merge' of github.com:PX4/Firmware into ros_messagelayer_merge
This commit is contained in:
@@ -81,5 +81,5 @@ void SubscriberExample::rc_channels_callback(const px4_rc_channels &msg) {
|
|||||||
PX4_INFO("Callback (method): [%llu]",
|
PX4_INFO("Callback (method): [%llu]",
|
||||||
msg.data().timestamp_last_valid);
|
msg.data().timestamp_last_valid);
|
||||||
PX4_INFO("Callback (method): value of _sub_rc_chan: [%llu]",
|
PX4_INFO("Callback (method): value of _sub_rc_chan: [%llu]",
|
||||||
_sub_rc_chan->get().data().timestamp_last_valid);
|
_sub_rc_chan->data().timestamp_last_valid);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,7 +84,15 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Get the last message value
|
* Get the last message value
|
||||||
*/
|
*/
|
||||||
virtual T get() {return _msg_current;}
|
virtual T& get() {return _msg_current;}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the last native message value
|
||||||
|
*/
|
||||||
|
virtual decltype(((T*)nullptr)->data()) data()
|
||||||
|
{
|
||||||
|
return _msg_current.data();
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
T _msg_current; /**< Current Message value */
|
T _msg_current; /**< Current Message value */
|
||||||
|
|||||||
Reference in New Issue
Block a user