This is a rosserial demo for the STM32F407 discovery board.
From the root of this project, generate the ROS message headers:
rosrun rosserial_client make_libraries srcThen you can build and flash the board:
git submodule init
git submodule update
make
make flashNow we can run the node:
roscore &
rosrun rosserial_python serial_node.py _port:=/dev/ttyACM1Replace /dev/ttyACM1 by the port used to communicate with your board.
In a new terminal, you can try out the button:
rostopic echo /buttonEverytime you push the button, a message is published.
Or you can look at the accelerometer values being published:
rostopic echo /accelerometerFinally, you can control the LEDs intensities by publishing a std_msgs/UInt16 to one of these topics:
rostopic pub /led/red std_msgs/UInt16 --once 1000
rostopic pub /led/blue std_msgs/UInt16 --once 1000
rostopic pub /led/green std_msgs/UInt16 --once 1000
rostopic pub /led/orange std_msgs/UInt16 --once 1000