Arduino Teensy 3.5 Setup - olinrobotics/gravl GitHub Wiki

Introduction

GRAVL uses the Arduino Teensy 3.5 as the tractor's hindbrain. This choice was made because the Teensy is much faster than a convential arduino, has more storage space, and has multiple hardware serial ports. It requires a special setup to interface with the Arduino development environment. Although there are newer versions of the Teensy, they typically run on 3.2 volts, making them easy to fry. the 3.5 runs off of 5v, and is a bit more resilient to wiring accidents.

Setting up Arduino IDE

  1. Download Linux version of the Arduino IDE
  2. Extract arduino folder to the downloads folder, then move it to /opt: (eg: arduino-#.#.# is arduino-1.8.5 for arduino 1.8.5)
cd Downloads/
sudo mv arduino-#.#.# /opt
  1. Run the install.sh executable inside the arduino folder:
cd /opt/arduino-#.#.#/
sudo ./install.sh

Setting up for the Teensy

  1. Download latest Linux 64 bit version of Teensyduino
  2. Navigate to Downloads folder and make the Teensyduino file an executable:
cd Downloads/
chmod +x TeensyduinoInstall.linux64
  1. Run the executable and navigate the install window that follows:
./TeensyduinoInstall.linux64
  1. Upon being asked the location for install, select your newly installed arduino folder /opt/arduino-#.#.#:
  2. Go into teensy_patch (a folder in the gravl repository) and copy the resulting files into /opt//hardware/teensy/avr/cores/teensy3/
cd ~/catkin_ws/src/gravl/teensy_patch
cp * /opt/arduino-#.#.#/hardware/teensy/avr/cores/teensy3/
  1. Go into udev_rules and copy the resulting files into /etc/udev/rules.d/
cd ~/catkin_ws/src/gravl/udev_rules
sudo cp * /etc/udev/rules.d/

Setting up Rosserial

Kinetic

  1. Install rosserial through your systems package manager:
sudo apt-get install ros-kinetic-rosserial ros-kinetic-rosserial-arduino
  1. Go to the libraries folder in your arduino install and remove the ros_lib folder:
cd /opt/arduino-#.#.#/libraries/
rm -rf ros_lib
  1. Regenerate the ros_libfolder:
rosrun rosserial_arduino make_libraries.py .

Indigo

Note: This process is necessary because Rosserial on Indigo has not been updated to allow class members to be callbacks for subscribers. A pull request has been submitted to fix the problem, and these commands may be deprecated in the future.

  1. Clone olinrobotics/rosserial into your catkin workspace source directory:
cd catkin_ws/src/
git clone https://github.com/olinrobotics/rosserial.git
  1. Remove your current version of rosserial, if you have it:
sudo apt-get remove ros-indigo-rosserial
  1. Checkout the indigo devel branch within the rosserial directory that you just cloned.
git checkout indigo-devel
  1. Catkin make in your catkin workspace:
cd catkin_ws/
catkin_make
  1. Go to the libraries folder in your arduino install and remove the ros_lib folder:
cd /opt/arduino-#.#.#/libraries/
rm -rf ros_lib
  1. Regenerate the ros_libfolder:
rosrun rosserial_arduino make_libraries.py .

Kubo Hindbrain Further Setup

If you are setting up your system to be able to upload code to Kubo's hindbrain, you will need to download some other libraries. go to The RoboClaw Wiki Page for more info.

Uploading code using the NUC/via command-line

For more detailed information, visit this page

References

Troubleshooting

Error 1:

ERROR: Upon running Arduino IDE Step 3, got repeats of error:
touch: cannot touch '/home/cnovak/.local/share/icons/hicolor/.xdg-icon-resource-dummy': No such file or directory
IDE works fine, not sure if this error is important.

Error 2:

Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino

Solution 1: Change programmer to Arduino as ISP https://answers.ros.org/question/210875/arduino-rosserial-unable-to-sync-with-device/ ## Solution 2: Update rosserial
Solution 3: Check baud rates in launch file + arduino
Solution 4: Lower baud rates
Note: Still unsolved - only Nathan's computer works

Error 3:

stat /home/cnovak/Workspaces/catkin_ws/src/gravl/src/hind_brain/lib: no such file or directory

Error compiling for board Teensy 3.5.

This error is due to the broken symlink lib. The Arduino compiler is attempting to access the libraries/ folder of your arduino install and failing because the symlink no longer points to the correct location. to see where the symlink points, navigate to gravl/src/hind_brain and run the following command:

ls -l lib

This command lists the files in the directory, the -l means to use longlisting format, and using lib specifies the symlink.

The path on the right hand side of the -> arrow shows where the symlink points, a location that most likely doesn't exist. Mine was /opt/arduino/libraries. It didn't exist because I had updated my IDE, and that folder was now located at /lot/arduino-1.8.9/libraries.

Solution 1: Update the symlink lib:

  1. Remove current symlink:
rm lib
  1. Create new updated symlink (use the path to your arduino libraries/ directory here):
ln -s /opt/arduino-1.8.9/libraries lib

This command creates a new link called lib that points to the specified location. The -s arg means that the link will be symbolic, which holds arbitrary text and points to a location, rather than a specific file (more info here).

⚠️ **GitHub.com Fallback** ⚠️