Using Arduino with ROS

Introduction

These instructions were for how to create the package from scratch. if you are using the idealab_ros repository you will not have to do all the steps

Instructions

  1. add the arduino to the usb filter list in virtualbox on the host machine

  2. plug in usb device and find out device info, including port

    dmesg
    #dmesg | grep arduino
    
  3. boot ubuntu, open terminal (ctrl+t) navigate to /dev, and list devices

    cd /dev
    ls -la
    
  4. install arduino

    sudo apt update
    sudo apt install -y arduino
    
  5. clone hx711 library

    git clone https://github.com/idealabasu/HX711.git
    
  6. open arduino

  7. install hx711 library

  8. select port (/ttyACM0)

  9. select programmer (AVRisp mkII)

  10. make new directory in src/

    catkin_create_pkg force_plate std_msgs rospy roscpp
    
  11. edit package as before

    1. add message
    2. catkin_make
    3. commit git
  12. make scripts

    roscd force_plate/
    mkdir scripts
    cd scripts
    # pull talker
    wget https://raw.github.com/ros/ros_tutorials/kinetic-devel/rospy_tutorials/001_talker_listener/talker.py
    chmod +x talker.py
    #wget https://raw.github.com/ros/ros_tutorials/kinetic-devel/rospy_tutorials/001_talker_listener/listener.py
    #chmod +x listener.py
    
  13. Modify as needed