Skip to content

Arduino Environment Setup

ttchalakov edited this page Sep 27, 2023 · 5 revisions

Arduino IDE Setup

Install

sudo apt install libfuse2

Configuring for the Arduino Due

  • Make sure the Arduino is plugged into its programming port and select Due Programming Port under Tools > Port
  • If the Arduino SAM board Cores is not installed, click yes on the prompt to install it so you can program the Due

Testing the Install

  • In the IDE, go to File > Examples > Basic > Blink
  • Press the Arrow button in the upper left hand corner to upload to the Arduino
  • Make sure the onboard LED on the arduino is blinking
  • If you run into an error that says there is an error opening a serial port, follow the instructions found at this page: https://www.arduino.cc/en/guide/linux. Or run this command:
sudo usermod -a -G dialout iris

YOU MUST RESTART THE VM INSTEAD OF LOGGING IN AND OUT FOR THE CHANGES TO TAKE PLACE


Sabertooth Library setup

In order to control the motors on our robot, the arduino needs to interact with the sabertooth motor controller using a special library.

Install

  • Download the zip file for "Arduino Libraries for SyRen/Sabertooth Serial" from: https://www.dimensionengineering.com/info/arduino
  • Extract the zip file and then copy the subfolders into your arduino IDE's libraries folder
    • For windows the folder is usually in Documents/Arduino/libraries
    • For linux the folder is usually in ~/Arduino/libraries

Testing the install

  • Open the Arduino IDE and try uploading one of the example Sabertooth sketches
  • More documentation can be found from the dimension engineering website link above and from links in the example code

micro-ROS Setup

Install

Patching the Arduino to use pre-processed libraries

Testing the Install

  • Upload the micro-ros_publisher example file to the arduino
  • Terminal #1(Run the micro-ros agent to translate arduino serial to ros msgs): ros2 run micro_ros_agent micro_ros_agent serial --dev /dev/ttyACM0
  • Terminal #2(View the arduino's published messages): ros2 topic echo micro_ros_arduino_node_publisher
  • Make sure you see increasing numbers printing out when listening to the topic

Python CRC package