PittSailbot / Sailbot

University of Pittsburgh's Sailbot Club (2019-2025)! Competing at the annual International Robotic Sailing Regatta. https://www.sailbot.org/
https://pittsailbot.github.io/Sailbot/
Other
4 stars 1 forks source link
robotics-competition

SailBot

Main codebase for the University of Pittsburgh's SailBot Club (2019-2024). Competition info here.

Onenote notebook containing boat startup steps, documentation and passwords can be found here

Installation

  1. Install Python 3.10

  2. Install Git

  3. Install your code editor of choice:

    • We recommend Pycharm or VSCode
    • Pycharm has lots of helpful features and is tailored specifically for Python
    • VSCode is light and works for any language but requires lots of plugins to be installed to compare to Pycharm
    • Personally, I use Pycharm for Python and VSCode for any other programming language
  4. In the terminal, navigate to the directory where you want to install the repository and enter:

    git clone https://github.com/PittSailbot/Sailbot.git
  5. In File Explorer, right-click the project directory and click 'Open with Pycharm/VSCode'

  6. In the app's integrated terminal, install the required dependencies with:

    pip install -r dev-requirements.txt

Scripts

Located in src/sailbot/sailbot

Logic

Events

Direct boat behavior depending on which competition challenge the boat is participating in

Sensors/Controls

Scripts which interface with the mechanical parts of the boat. Virtual versions of each sensor exist for debugging with fake values.

Utils

Miscellaneous functions used by the boat

Debug

Scripts used to test boat behavior

ROS2

The code uses ROS2 as our framework.

Launching on Pi

sudo -s
. init.sh
ros2 run sailbot [module name]

Compiling code changes

sudo -s
. compile.sh

and then

ros2 run sailbot [module name]

or

ros2 launch sailbot [launch file]

Docker

Docker allows everyone to run the code in the same environment limiting computer dependent conflicts. It also ensures that all necessary libraries and external files are accounted for on the github. (necessary for the CI/CD pipeline)

Running Docker

First you must install docker on your computer
(https://docs.docker.com/desktop/install/windows-install/)
The docker image can be created using the following commands in a terminal which is located in the same folder as this readme file. This may take awhile the first time (docker desktop must be running)

py ./Utils/docker.py create

launch the container using (add the -nd arg to prevent the container from being deleted when closed)

py ./Utils/docker.py run

connect to an already running container using

py ./Utils/docker.py connect

you can also run a docker container with vnc capabilities using

py ./Utils/docker.py runVNC

Running code in Docker container

the process is very similar to the pi, the only exception is that sudo -s is not necessary (nor will it work)

. compile.sh

or, if its already been compiled in another terminal:

. init.sh

and then

ros2 run sailbot [module name]

or

ros2 launch sailbot [launch file]