-
Sensors: click here to see the sensors we need to keep and not keep
-
Never do
ROS2
xconda
:ROS2
does not work withconda
(source 👀! runconda deactivate
in your terminal before running anything. Make sure there's no(base)
sign in your terminal -
Read the Migration Guide from ROS2 Official Documentation
- There are things that will not be covered in this guide, e.g. what exceptions to throw for service (since ROS2 doesn't have the ones ROS1 uses), in these cases, consult the following sources (in this order)
- Official Documentation. e.g., see what exception type is used in its tutorial for service
- GitHub Repo Issues Page for ROS packages, such as
rclpy
- ConstuctSim (Reach out on Discord if you don't have access)
- StackOverflow (with a pinch of salt)
- ChatGPT (with a pinch of salt)
- There are things that will not be covered in this guide, e.g. what exceptions to throw for service (since ROS2 doesn't have the ones ROS1 uses), in these cases, consult the following sources (in this order)
This codebase is developed and tested on python=3.8.10
.
- Clone this repository
- Download
test_data/
and move it totest_data/
The following repo structure is from robosub_2023.
cv/
, test_data
, tests/
are currently implemented in this development branch.
Repo Structure is subject to change.
roboboat2024
├── asv
│ ├── device
│ │ ├── # everything related to the sensors
│ │ ├── # each device should have its own file/folder
│ ├── localization
│ │ ├── # TODO
│ ├── mission
│ │ ├── # Mission classes
│ │ ├── # see asv/mission/template_mission.py for an example
│ ├── motion
│ │ ├── # Actuators code
│ │ ├── # each actuator should have its own file/folder
│ ├── cv
│ │ ├── # All CV classes and functions
│ │ ├── # see asv/cv/template_cv.py for an example
│ ├── utils
│ │ ├── # utility functions
├── scripts
│ ├── # bash scripts
├── mission
│ ├── # Mission files (calling mission classes)
├── tests
│ ├── # Unit tests (pytest)
├── config.json # where all the config values used in mission files are stored
├── setup.py # setup file for pip install
├── .gitignore
├── README.md
This will run all the tests in the tests folder using pytest
.
Any file that has the name test_*.py
will be run.
pytest
The idea behind the CV classes is that they are run in a separate thread and they publish their results to a ROS topic.
You can run individually CV classes for debugging purpose (if they have a if __name__ == "__main__"
block) by running:
python3 -m asv.cv.<cv_name>
We use pytest for unit tests. Please write unit tests for your code and make sure that they pass before pushing your code. This is to make sure that we don't break anything when we add new features. Tests are mainly there to make sure that there is no syntax error and that the code runs without crashing, not necessarily to make sure that the code is doing what it is supposed to do (although it is a plus).
It is always pleasant to read code that is well formatted and well commented. Ideally we would want to format our code using black, so try to run regularly on your code:
black .
If you have trouble running this command, you can use the following command instead:
python3 -m black .