Framework for ASV autonomous control and river mapping (Oceanserver Q-Boat).
Contacts: John Lee ([email protected]), Jane Wu ([email protected])
tl;dr: Run code and figure out which python libraries you're missing by looking at the errors..
List of Python libraries (MUST use Python 3, use pip3 to install):
- xbee
- digi-xbee
- tkinter
- GDAL
- utm
- matplotlib
- numpy
- Pillow (aka PIL)
- pyserial (aka serial)
ASV_Controller
: Files used by shoreside computer and Raspberry Pi. The Pi is onboard the ASV, and communicates with the shore-side computer via X-Bee communication.Maps
: GEOTIFF files for various locations, including Caltech and Kern River.Motion_Planning
: RRT-type planner, sequentially plans trajectories to travel back and forth across river.pi_readwrite
: Arduino file for IMU and servo control. Communicates with the Raspberry Pi via serial.Deprecated Files
: Files that are no longer used.
- (Optional) To start the GUI in simulation mode, open
ASV_controller.py
and setself.mode = "SIM MODE"
. Make sure to change this back toself.mode = "HARDWARE MODE"
before real deployments. - Open
ASV_graphics.py
and make sure the variablesMAP_FILE, IMAGE_WIDTH, IMAGE_HEIGHT
are correct. - Start the GUI by running in a terminal window:
$ python3 ASV_gui.py
- (Optional) Use "Border Configuration" buttons to trace/clear/load/save border. This serves as a guide for determining where waypoints can be placed.
- Check compass offset under "Compass Calibration." The default offset is -12 degrees.
- Check/update control parameters under "Control" depending on mission. Most important values are "Fwd Limit/Bwd Limit" because this determines the max motor thrust (0-1000 rpm).
- Enable/disable "Transect Mission." If enabled, the ASV will repeat the specified waypoints until "Stop ASV" is pressed.
- In the "Mission Planning" panel, either load a mission or manually add waypoints. To change the type of controller used to reach a particular waypoint (point track=upstream vs. transect=across river), click on the point in the map (click "Done Add Waypoints" if necessary).
- Click "Start Mission." This WON'T start the ASV, but it will send all the mission waypoints to the ASV. Check the ASV ssh terminal window to make sure all waypoints were sent (checksum should be correct) AND the "!STARTMISSION" message MUST have been sent.
- If everything is good, click "Start ASV" and the mission will begin.
- At any point, click "Stop ASV" to stop the ASV from moving (but if ASV re-started, mission will resume). "Abort Mission" will clear all the waypoints on the ASV, but not in the GUI.
CURRENT BUG: IF MISSION RE-STARTED, FIRST POINT WILL BE POINT TRACK
NOTE: Once the RC transmitter is turned on, it CANNOT be turned off while the ASV is still on. Otherwise both motors will start spinning at max speed... On the other hand, the transmitter can be turned on while the ASV is already on.
-
Connect 3 batteries to the connectors labeled '24V' in the ASV.
IMPORTANT: connect red-red and black-black!!!
-
Connect Pi USB adapter to power bank inside ASV (should be near cardboard box).
-
Turn red key on VCU 90 degrees clockwise to turn on ASV. Servos will move - it's just initializing.
-
Optional (but mandatory when in river): Turn on RC transmitter. It should beep repeatedly for half a second to indicate it has connected to the ASV.
-
Turn on WiFi. Pi should automatically connect... Connect shoreshide computer to same Wifi and ssh into Pi.
-
Plug in X-Bee to a USB port on the shoreside computer.
-
On the Pi, run the following to start the ASV program:
$ cd Documents/asv-river-mapping/ASV_Controller
$ stty -echo #You won't be able to see what you type anymore!
$ python3 ASV_main.py
- In a different terminal window (locally), run the following to start the GUI:
$ cd ASV_Controller
$ python3 ASV_gui.py
- To terminate both programs, exit out of the GUI.
- Turn off RC transmitter.
- Turn red key on VCU 90 degrees counterclockwise (back to original position) to turn off ASV.
- Unplug the 3 battery connectors.
- Unplug the Pi USB adapter.