-
Notifications
You must be signed in to change notification settings - Fork 0
Arduino Environment Setup
ttchalakov edited this page Sep 27, 2023
·
5 revisions
- For Arduino IDE 2: https://docs.arduino.cc/software/ide-v2/tutorials/getting-started/ide-v2-downloading-and-installing
- In Ubuntu 22 install the FUSE2 library as it is missing:
sudo apt install libfuse2
- 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
- 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
In order to control the motors on our robot, the arduino needs to interact with the sabertooth motor controller using a special library.
- 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
- For windows the folder is usually in
- 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
- Follow this link to download micro-ROS and create a publisher subscriber: https://micro.ros.org/docs/tutorials/core/first_application_linux/
- Follow this link to patch the Arduino to support micro-ROS library: https://github.com/micro-ROS/micro_ros_arduino/tree/foxy
- To find the folder with
platform.txt
for SAM boards, go to~/.arduino15/packages/hardware/sam/1.6.12
- Follow the instructions at the end of this page to make the Arduino publish to a topic and read the messages on your computer: https://micro.ros.org/docs/tutorials/core/teensy_with_arduino/
- 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