diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2015-01-23 15:24:32 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2015-01-23 15:24:32 +0100 |
commit | de2d73987f00377b0b230a1bc77cfbe62f693da1 (patch) | |
tree | e57709e1151b73ec9eb03ece0419f0af40925b34 | |
parent | 6c0b5cf1259a0560a5adc966c4ca306f998c2c86 (diff) | |
parent | 73f342616e275ca726d70807212a733f9971bf66 (diff) | |
download | px4-firmware-de2d73987f00377b0b230a1bc77cfbe62f693da1.tar.gz px4-firmware-de2d73987f00377b0b230a1bc77cfbe62f693da1.tar.bz2 px4-firmware-de2d73987f00377b0b230a1bc77cfbe62f693da1.zip |
Merge branch 'ros_messagelayer_merge' of github.com:PX4/Firmware into ros_messagelayer_merge
-rw-r--r-- | src/examples/subscriber/subscriber_example.cpp | 2 | ||||
-rw-r--r-- | src/platforms/px4_subscriber.h | 10 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/examples/subscriber/subscriber_example.cpp b/src/examples/subscriber/subscriber_example.cpp index 215336c17..781dde486 100644 --- a/src/examples/subscriber/subscriber_example.cpp +++ b/src/examples/subscriber/subscriber_example.cpp @@ -81,5 +81,5 @@ void SubscriberExample::rc_channels_callback(const px4_rc_channels &msg) { PX4_INFO("Callback (method): [%llu]", msg.data().timestamp_last_valid); 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); } diff --git a/src/platforms/px4_subscriber.h b/src/platforms/px4_subscriber.h index 6a81ef8d2..6ca35b173 100644 --- a/src/platforms/px4_subscriber.h +++ b/src/platforms/px4_subscriber.h @@ -84,7 +84,15 @@ public: /** * 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: T _msg_current; /**< Current Message value */ |