Test Drive
RPI3+Arduino+ROS(Robot Operating System) Test Drive
既然在玩 RPI, Arduino 跟農業機器人,那怎麼可以不試玩一下跟 ROS 接。
目標很簡單,在 RPI3 用 ROS 的方式,點 Arduino 上的燈
1.PI Using ROS enabled Raspberry Pi 3 Image
http://www.german-robot.com/2016/05/26/raspberry-pi-sd-card-image/
2. setup missing packages
http://wiki.ros.org/rosserial_arduino/Tutorials/Arduino%20IDE%20Setup
sudo apt install ros-kinetic-rosserial ros-kinetic-rosserial-arduino
sudo apt install rosbash
sudo apt install rospack-tools
3. Generate arduino library for ROS
rosrun rosserial_arduino make_libraries.py .
4. Install Arduino IDE
apt install arduino
5. Install arduino library to IDE
mv ros_lib/ ~/sketchbook/libraries/
6. Setup blink on Arduino
http://wiki.ros.org/rosserial_arduino/Tutorials/Blink
Install Arduino UNO with blink sample code (in ros_lib)
7. Pi: ROS run
rosrun rosserial_python serial_node.py _port:=/dev/ttyACM0 _baud:=57600
8. Test blink per second on Arduino
rostopic pub toggle_led std_msgs/Empty -r 1