Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed X_NUCLEO_PLC01A1 ros_lib_melodic
main.cpp@0:43eb9ccc1583, 2020-08-08 (annotated)
- Committer:
- yamadola
- Date:
- Sat Aug 08 23:54:01 2020 +0000
- Revision:
- 0:43eb9ccc1583
- Child:
- 1:ef4b86795d79
Uncomplete
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| yamadola | 0:43eb9ccc1583 | 1 | #include "mbed.h" |
| yamadola | 0:43eb9ccc1583 | 2 | //#include <ros.h> |
| yamadola | 0:43eb9ccc1583 | 3 | //#include <std_msgs/Float32.h> |
| yamadola | 0:43eb9ccc1583 | 4 | |
| yamadola | 0:43eb9ccc1583 | 5 | // |
| yamadola | 0:43eb9ccc1583 | 6 | //ros::NodeHandle nh; |
| yamadola | 0:43eb9ccc1583 | 7 | //std_msgs::Float32 msg; |
| yamadola | 0:43eb9ccc1583 | 8 | //ros::Publisher responser("response", &msg); |
| yamadola | 0:43eb9ccc1583 | 9 | // |
| yamadola | 0:43eb9ccc1583 | 10 | //void messageCb(const std_msgs::Float32& msg_sub) |
| yamadola | 0:43eb9ccc1583 | 11 | //{ |
| yamadola | 0:43eb9ccc1583 | 12 | // msg.data =msg_sub.data; |
| yamadola | 0:43eb9ccc1583 | 13 | // responser.publish( &msg ); |
| yamadola | 0:43eb9ccc1583 | 14 | // |
| yamadola | 0:43eb9ccc1583 | 15 | //} |
| yamadola | 0:43eb9ccc1583 | 16 | // |
| yamadola | 0:43eb9ccc1583 | 17 | //ros::Subscriber<std_msgs::Float32> sub("request", &messageCb); |
| yamadola | 0:43eb9ccc1583 | 18 | |
| yamadola | 0:43eb9ccc1583 | 19 | int main() |
| yamadola | 0:43eb9ccc1583 | 20 | { |
| yamadola | 0:43eb9ccc1583 | 21 | // nh.initNode(); |
| yamadola | 0:43eb9ccc1583 | 22 | // nh.subscribe(sub); |
| yamadola | 0:43eb9ccc1583 | 23 | // nh.advertise(responser); |
| yamadola | 0:43eb9ccc1583 | 24 | // |
| yamadola | 0:43eb9ccc1583 | 25 | // while (1) |
| yamadola | 0:43eb9ccc1583 | 26 | // { |
| yamadola | 0:43eb9ccc1583 | 27 | // nh.spinOnce(); |
| yamadola | 0:43eb9ccc1583 | 28 | // wait_ms(1); |
| yamadola | 0:43eb9ccc1583 | 29 | // } |
| yamadola | 0:43eb9ccc1583 | 30 | } |