diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2014-12-03 12:31:37 +0100 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2014-12-03 12:31:37 +0100 |
commit | 6a99b04fb74f6da3faea54c93d234a9b57d7bd0e (patch) | |
tree | 06edbbc5ce55463a1b1cffe8cfb8e0d877b759b7 /src/examples | |
parent | 905913986a03cdb31d056b278cadc2d6f6421e38 (diff) | |
download | px4-firmware-6a99b04fb74f6da3faea54c93d234a9b57d7bd0e.tar.gz px4-firmware-6a99b04fb74f6da3faea54c93d234a9b57d7bd0e.tar.bz2 px4-firmware-6a99b04fb74f6da3faea54c93d234a9b57d7bd0e.zip |
add parameter wrapper macros for ros
Diffstat (limited to 'src/examples')
-rw-r--r-- | src/examples/subscriber/subscriber.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/examples/subscriber/subscriber.cpp b/src/examples/subscriber/subscriber.cpp index a29f9ab93..a8ecd4a7d 100644 --- a/src/examples/subscriber/subscriber.cpp +++ b/src/examples/subscriber/subscriber.cpp @@ -74,6 +74,14 @@ PX4_MAIN_FUNCTION(subscriber) { */ px4::NodeHandle n; + /* Define a parameter */ + PX4_PARAM_INIT("SUB_INTERV", 100); + + /* Read the parameter back for testing */ + int32_t sub_interval; + PX4_PARAM_GET("SUB_INTERV", &sub_interval); + PX4_INFO("Param SUB_INTERV = %d", sub_interval); + /** * The subscribe() call is how you tell ROS that you want to receive messages * on a given topic. This invokes a call to the ROS |