'Engine' for handling concurrency and other 'low-level' tasks
See ROS Humble documentation for details on how to use ros2.
This engine uses external dependencies that are located in the extern
directory.
To directly clone the repository with these submodules add the --recursive
flag to your git clone
command.
To clone the submodules after cloning the engine, run git submodule update --init --recursive
Python code should follow snake case, with proper public/private seperation in class development. Public/private in Python is done with an underscore at the front of an attribute. For example,
self._example: str = "example"
is private
self.example: str = "example"
is public
All Python code should also be type hinted. Type hints allow static checkers to analyze the
codebase for any errors before runtime. This is done during the make ci
command. Integrating
MyPy would enhance the static type checking further, but it is not done yet. Could be an item
for someone to work on. (See the other workflow files in the .github folder)
make help
Displays all possible commands for utilizing the Makefile.
The most used commands for typical work will be
make
or make all
builds all ros packages
make clean
removes build directories
make ci
Will run the continous integration and let you know if there are any linting errors.
These errors should be fixed before a pull request is opened to main, but are usually ok for the
testing and development phase.
make test_engine
runs the ROS tests for sgengine packages which are known to fail, for now
make check
runs ci
& test_engine
scripts
- Create a new branch
- Switch to using the new branch as the active one
- Create a subfolder with an init file
- Develop a class to add the given functionality OR a set of functions for the funcationality
- Create a test file which uses fake input to test the code
- Add the functionality to an existing node OR create a new node
- Open a pull request :)
- configuration: Reads some config file and either generates a dictionary or uses ROS param services. TBD
- gui: Launches a basic web app for starting and stopping the robots autonomous functions, as well as allowing remote control. If progress makes it far enough this will also allow "on-the-fly" adjustments of the Raspberry Pi's GPIO pins.
- hardware: This will contain code for handling all physical elements we will interact with. This includes RPi.GPIO, OAK-D cameras, RPi Picos, etc..
- map: This will handle aggregating data into a 2D map for pathfinding and/or planning to operate on.
- object_detection: The most open ended module, find objects from sensor data! Possible pathways include computer vision, machine learning, inferring on 3D maps, etc...
- odometry: This computes the robots current position in space.
- pathfinding: This module revolves around pathfinding algorithms. Classic examples are A* and Breadth-First-Search. These will all operate on some 2D plane.
- planning: This module contains tools for deciding how to move a robot given all other information. This could simply be algorithms for adjusting a map form object detections or something much more complex.
- utils: These contain generic utilities which are not explicity tied to a single module.
git branch {branchname}
Creates a new local branch for development
git checkout {branchname}
Switches your current branch to the given branch
git add {files}
Adds files to git for tracking or adds updates
git commit -m {message}
Makes a commit with the given files added with a given message
git push
Pushes any local commits to the remote repository (Github) on your working branch
git push --set-upstream origin {branchname}
Pushes changes to the given branchname remotely, if the branch was created locally
git reset {--hard}
Resets back to the latest pushed changes in the remote repository (Github), DO NOT use if you have uncommited work.
make
source install/setup.bash
Then you can call anything defined in the package.
For example: ros2 run sgengine pico
To enable the launch service:
Make sure that the SpaceGrantEngine
repository is located at /home/pi/SpaceGrantEngine
Run systemctl enable /home/pi/SpaceGrantEngine/scripts/engine_launch.service
to enable the service on boot.