https://github.com/shiukaheng/rosa
🌹 Rosa — ROS2 Automation Macros
https://github.com/shiukaheng/rosa
build-tool cli deno macros robotics ros ros2
Last synced: about 2 months ago
JSON representation
🌹 Rosa — ROS2 Automation Macros
- Host: GitHub
- URL: https://github.com/shiukaheng/rosa
- Owner: shiukaheng
- Created: 2022-12-31T11:09:32.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-05T14:38:34.000Z (over 3 years ago)
- Last Synced: 2025-10-02T04:38:05.903Z (9 months ago)
- Topics: build-tool, cli, deno, macros, robotics, ros, ros2
- Language: TypeScript
- Homepage:
- Size: 108 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🌹 `rosa` — ROS2 Automation Macros
> ⚠️ WARNING: Still under active development
`rosa` is a thin wrapper on ROS2 tools to streamline common ROS2 development tasks. It automatically sources the correct files, and provides a file watcher to automatiaclly build packages upon file changes.
## 📦 Installation
REQUIREMENT: Make sure you have `deno` installed on your system ([instructions](https://deno.land/manual/getting_started/installation))
```bash
deno install --allow-sys --allow-env --allow-run --allow-read --allow-write --unstable -f https://deno.land/x/rosa@v0.0.2/rosa.ts
# Installation (bash)
FILE="${HOME}/.bashrc"
LINE='export PATH="/home/$USER/.deno/bin:$PATH"' # Add deno bin to .bashrc if it doesn't exist (tested on ubuntu)
grep -qF -- "$LINE" "$FILE" || echo "$LINE" >> "$FILE"
LINE='source <(rosa completions bash)' # Add rosa bash completions to .bashrc if it doesn't exist
grep -qF -- "$LINE" "$FILE" || echo "$LINE" >> "$FILE"
```
## 👨💻 Sample usage
> ℹ️ NOTE: Make sure your current working directory is inside of a ROS2 workspace (could be any sub-directory of the workspace). During first use of any `rosa` commands in a new workspace, it prompts for user configuration (mainly choosing which ROS2 installation to use).
### Creating a new package
Click to show original steps...
```bash
# Open a new terminal
source /opt/ros//setup.sh
cd ../../ # (cd'ing to workspace root)
ros2 pkg create --build-type ament_cmake
```
```bash
# Run this from any existing terminal inside the workspace
rosa init-pkg
# ? Enter the name of the package › new_package
# ? Enter the description of the package › A sample package
# ? Select the build type › ament_python
# ? Create empty node? (y/n) › Yes
# ? Enter the name of the node › new_node
# ? Select a license? (y/n) › Yes
# ? Select a license › MIT
# ...
```
### Building the current package
Click to show original steps...
```bash
# Open a new terminal
source /opt/ros//setup.sh
cd ../../ # (cd'ing to workspace root)
colcon build --packages-select
```
```bash
rosa build # Automatically builds the package folder you are in
```
Or, if you want to automatically build the package upon file changes:
```bash
rosa watch
```
### Setting up terminal environment to use `ros2` CLI
Click to show original steps...
```bash
source /opt/ros//setup.sh
source ../../install/setup.sh
ros2
```
```bash
rosa wsh # wsh = workspace shell
ros2
```
For more information, run `rosa --help` or `rosa --help`
## Todo
### General
- [ ] Compatibility with more shell environments (currently only bash is supported)
### Watcher
- [ ] Allow per package configuration of build options (e.g., always use --symlink-install)
- [ ] Make watcher dependency aware and automatically dependent packages