This is the basic ros2 workspace for the Smarty project. It contains useful setups and configurations for the project.
.vscode/
: Contains the vscode settings and configurations for the workspacec_cpp_properties.json
: Contains the c/c++ properties for the workspaceextensions.json
: Contains the list of extensions to installlaunch.json
: Contains the launch configurations for the workspacesettings.json
: Contains the settings for the workspacetasks.json
: Contains the tasks for the workspace
scripts/
: Contains useful scripts for the workspacebuild.sh
: Build script for the workspaceinstall_dependencies.sh
: Install script for the ros dependenciestest.sh
: Test script for the ros packages
src/
: Contains the source code for the project (clone here the ros2 packages)smarty_utils/
: Contains the utility packages for the project (after setup available)camera_preprocessing/
: Contains the camera preprocessing package for the project (after setup available)- ... other packages
.gitignore
: Gitignore file for the workspace (ignores the build and install folders).pre-commit-config.yaml
: Configuration file for the pre-commit hooksdefault.repos
: Default repos file for the vcs tool (clones the base packages)LICENSE
: License fileREADME.md
: This filesetup.sh
: Setup script for the workspace
The setup is divided into two parts:
- Setup repository and workspace
- Setup VSCode
- Clone the repository
- Run the setup script
#If not activated:
pyenv activate default # or your private environment
pip install -r requirements.txt
./setup.sh
This script clones the base packages and installs the dependencies. Currently, the following packages are cloned:
Furthermore, the pre-commit hooks are installed. More about the pre-commit hooks can be found here.
- Install the recommended extensions:
cd <path/to/smarty_workspace>
./scripts/install_extensions.sh
- Open the workspace in VSCode and check if the extensions are installed.
- If the extensions are not installed, install them manually:
- Open the extensions tab in VSCode
- Search for
@recommended
and install all workspace recommendations - Reload the workspace
- Check if the extensions are installed
Open the folder in VSCode and start developing. The workspace is configured to use the pre-commit hooks. This means that the code is checked before committing. If the code is not compliant with the rules, the commit is rejected and the files are changed accordingly. We use the following pre-commit hooks:
black
: Code formatter for python to have a consistent code styleflake8
: Linter for python to check the code for errors and stylepep257
: Linter for python to check the docstrings (we use the pydocstyle formatter)isort
: Import sorter for python to have a consistent import ordercheck-yaml
: Linter for yaml files to check the syntaxend-of-file-fixer
: Linter to check if the files end with a newlinetrailing-whitespace
: Linter to check for trailing whitespaces
To run the pre-commit hooks manually, use the following command:
pre-commit run --all-files
To run the tests, use the following command:
./scripts/test.sh
To build the workspace, use the following command:
./scripts/build.sh
To install the dependencies, use the following command:
./scripts/install_dependencies.sh
To run the setup script again, use the following command:
./setup.sh -f # Force the copy of the .pre-commit-config.yaml file
Please create a pull request for any changes you want to make:
- Fork the repository
- Create a new branch
- Make your changes
- Commit your changes
- Push your changes
- Create a pull request
It is welcome to create issues for any bugs or feature requests and required to use the pre-commit hooks.
This project is licensed under the MIT License - see the LICENSE file for details.