Time of Flight sensor guide
Thanks to Tej, we now have support for the Pololu time-of-flight sensor in the latest update to TAMProxy. The sensors seem pretty accurate from well past a meter down to around 25mm. They also have a narrow beam width which enables more pinpoint distance measurements.
We recommend powering the sensor off the Teensy's 3.3V pin. If you want more than 1 on your robot, you can connect a bunch of them in parallel on the same I2C bus as long as you connect each sensor's chip enable pin to another digital input pin on the Teensy. In the end, you should have connections for VIN, GND, SDA, SCL, and GPIO0/CE. See the example sketch for an example with two sensors and more details.
If you're interested in upgrading, you'll need to update the TAMProxy firmware on the teensy (a one-time operation) and update the TAMProxy-pyHost python package.
Upgrading the firmware
This can be done on either the NUC or your personal computer, but it might be easier on the NUC since the firmware is already cloned there.
- Clone the firmware repo from scratch or pull the latest commit if you already have it cloned (It's at Code/TAMProxy-Firmware on the NUC).
- If you already had a previous version cloned and compiling, you'll need to:
- Make sure the new git submodule (the ToF sensor library) is initialized and updated
git submodule update --init, but if that doesn't work try
git submodule add email@example.com:gkanwar/vl53l0x-arduino.git libraries/vl53l0x-arduino(adding it manually)
Makefileand edit the
Makefileto specify the teensy version
TEENSY = 35on line 5
- If you are cloning from scratch, the steps are similar but it's easiest to follow the Quick Start instructions on the github page README
- With the repo as your working directory in a terminal, run
- Then run
If you're fairly new to git, these instructions may be a bit confusing, so definitely ask the staff if you have any questions. The main reason for the changes is that we're adding an Arduino library for the sensor as a dependency, which affects the compilation toolchain.
Alternate, simpler way to upgrade the firmware
- Download the lates precompiled firmware from the repository's releases page (the .hex file).
- Then, with the Teensy Loader application open (appears whenever you program the teensy through the Arduino IDE) open the .hex file and program the Teensy manually through the Teensy Loader
Upgrading the TAMProxy-pyHost
This should be done on the NUC for sure since it's what will command the Teensy during competition. Can also be done on your personal computer.
- Navigate to
Code/TAMProxy-pyHoston the terminal, where the repo is already cloned
- Pull the latest commits from master:
- If you're using the tamproxy package installed through pip, update the installation with
pip install -e .(note the period)
- Try running the
tof_read.pysketch to confirm the pyHost is working with the updated firmware.