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 ros_lib_kinetic
Revision 0:bd7941d8c490, committed 2019-10-16
- Comitter:
- scarter1
- Date:
- Wed Oct 16 09:18:47 2019 +0000
- Commit message:
- ros blinky example;
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Oct 16 09:18:47 2019 +0000 @@ -0,0 +1,26 @@ +/* + * rosserial Subscriber Example + * Blinks an LED on callback + */ +#include "mbed.h" +#include <ros.h> +#include <std_msgs/Empty.h> + +ros::NodeHandle nh; +DigitalOut myled(LED1); + +void messageCb(const std_msgs::Empty& toggle_msg){ + myled = !myled; // blink the led +} + +ros::Subscriber<std_msgs::Empty> sub("toggle_led", &messageCb); + +int main() { + nh.initNode(); + nh.subscribe(sub); + + while (1) { + nh.spinOnce(); + wait_ms(1); + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Oct 16 09:18:47 2019 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ros_lib_kinetic.lib Wed Oct 16 09:18:47 2019 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/garyservin/code/ros_lib_kinetic/#a849bf78d77f