8000 New runner by Rezenders · Pull Request #170 · kas-lab/suave · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000

New runner #170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 30 commits into from
May 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
a8df9a0
remove ros_gz from suave.rosinstall
Rezenders May 13, 2025
79c747d
update mavros
Rezenders May 13, 2025
335e4e3
revert mavros version
Rezenders May 16, 2025
73b3c0f
🚧 new suave_runner
Rezenders May 16, 2025
a795b07
update remaro_worlds version
Rezenders May 16, 2025
dd0e38b
add silent argument to simulation launch
Rezenders May 16, 2025
2e0b573
🙈 ignore error.owl
Rezenders May 16, 2025
a9722c6
add silent arg to suave and suave_metacontrol
Rezenders May 16, 2025
071787d
add mission and metric nodes to suave_metacontrol
Rezenders May 16, 2025
3617543
🔧 adjust setup.py and package.xml
Rezenders May 16, 2025
b36c092
📝 update readme
Rezenders May 16, 2025
be85fb3
🐋 update suave_runner dockerfile
Rezenders May 16, 2025
436fc2f
✨ suave_runner.py working
Rezenders May 16, 2025
0950a7a
handle termination better
Rezenders May 19, 2025
3d9ca5e
add suave_none package
Rezenders May 19, 2025
c3c1906
update suave_bt launch file
Rezenders May 19, 2025
eab8ad3
update suave_metacontrol and suave_random launch
Rezenders May 19, 2025
7e670a6
🐋 update dockerfile
Rezenders May 19, 2025
6869c86
update suave_runner prints
Rezenders May 19, 2025
a4be321
add suave_runner launch and config files
Rezenders May 19, 2025
6ca2f29
📝🚧 update suave_runner README
Rezenders May 19, 2025
90350fe
update suave_mission launch file
Rezenders May 19, 2025
34b4312
👷 update docker CI to also build the suave_runner docker img
Rezenders May 19, 2025
09d3f05
👷 Doc CI
Rezenders May 20, 2025
2cf2c04
UPDATE doc CI and documentation
Rezenders May 20, 2025
2f844a7
.rosinstall -> .repos
Rezenders May 20, 2025
5d65895
update dockerfiles and CI
Rezenders May 20, 2025
6e72b83
🐋 update dockerfile
Rezenders May 20, 2025
99b99ae
📝 update changelog
Rezenders May 20, 2025
ad0d07a
Merge remote-tracking branch 'origin' into new_runner
Rezenders May 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,12 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: BASE_IMAGE=${{ env.REGISTRY }}/kas-lab/kasm-jammy:latest

- name: Build and push suave image
uses: docker/build-push-action@v4
with:
context: suave_runner/docker/
file: suave_runner/docker/Dockerfile
push: true
tags: ${{ env.REGISTRY }}/kas-lab/suave-headless
labels: ${{ steps.meta.outputs.labels }}
7 changes: 5 additions & 2 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ permissions:
jobs:
docs:
runs-on: ubuntu-latest
container: ubuntu:22.04
steps:
- uses: actions/checkout@v3.3.0
- uses: ros-tooling/setup-ros@0.7.1
Expand All @@ -20,16 +21,18 @@ jobs:
- uses: ros-tooling/action-ros-ci@0.3.5
id: action_ros_ci_step
with:
package-name: suave suave_monitor suave_metrics suave_msgs suave_missions suave_metacontrol system_modes mavros mavros_wrapper mros2_reasoner mros2_msgs
package-name: suave suave_monitor suave_metrics suave_msgs suave_missions suave_metacontrol system_modes mavros mavros_wrapper mros2_reasoner mros2_msgs suave_runner
target-ros2-distro: humble
skip-tests: true
vcs-repo-file-url: https://raw.githubusercontent.com/kas-lab/suave/main/suave.repos
- name: Install dependencies
run: |
pip install sphinx sphinx_rtd_theme myst_parser sphinx-autopackagesummary myst-parser
- name: Sphinx build
shell: bash
run: |
source ${{ steps.action_ros_ci_step.outputs.ros-workspace-directory-name }}/install/setup.bash && sphinx-build docs/source docs/build
source ${{ steps.action_ros_ci_step.outputs.ros-workspace-directory-name }}/install/setup.bash
sphinx-build docs/source docs/build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*error.owl
docs/source/_autosummary/
docs/build/

Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## 1.4.0

### Added

1. New suave_runner package containing a new python-based runner script

2. A new docker image without vnc, allowing it to be executed without the web interface

3. Move to gazebo harmonic

## 1.3.0

### Added
Expand Down
25 changes: 21 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,22 @@ To build the docker images locally, run:
```

## Install SUAVE locally
To install the exemplar locally, you have to [install Gazebo Garden](#install-gazebo-garden), [install ROS2 Humble](#install-ros2-humble), [install ArduSub](#install-ardusub), [install the ArduSub plugin](#install-ardusub_plugin), and finally [install the SUAVE workspace](#install-suave-workspace).
To install the exemplar locally, you have to [install Gazebo Harmonic](#install-gazebo-harmonic), [install ROS2 Humble](#install-ros2-humble), [install ArduSub](#install-ardusub), [install the ArduSub plugin](#install-ardusub_plugin), and finally [install the SUAVE workspace](#install-suave-workspace).

#### Install Gazebo Garden
#### Install Gazebo Harmonic

Follow the [official instructions](https://gazebosim.org/docs/garden/install_ubuntu) for installing Gazebo Garden.
Follow the [official instructions](https://gazebosim.org/docs/harmonic/install_ubuntu/#binary-installation-on-ubuntu) for installing Gazebo Harmonic.

#### Install ROS2 Humble

Follow the [official instructions](https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html) for installing ROS2 Humble.

#### Install ROS_GZ

```Bash
apt install ros-humble-ros-gzharmonic
```

#### Install ArduSub
ArduSub is a subproject within ArduPilot for piloting underwater vehicles.

Expand Down Expand Up @@ -135,7 +141,18 @@ ArduPilot SITL should open and a console plus a map should appear.
Install the dependencies:

```Bash
sudo apt install libgz-sim7-dev rapidjson-dev
sudo apt update
sudo apt install libgz-sim8-dev rapidjson-dev
sudo apt install libopencv-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-gl
```

```Bash
export GZ_VERSION=harmonic
sudo bash -c 'wget https://raw.githubusercontent.com/osrf/osrf-rosdep/master/gz/00-gazebo.list -O /etc/ros/rosdep/sources.list.d/00-gazebo.list'
rosdep update
rosdep resolve gz-harmonic
# Navigate to your ROS workspace before the next command.
rosdep install --from-paths src --ignore-src -y
```

Clone and build the repository:
Expand Down
64 changes: 28 additions & 36 deletions docker/dockerfile-suave
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ FROM $BASE_IMAGE

USER root


### Envrionment config
ENV DEBIAN_FRONTEND noninteractive
ENV DEBIAN_FRONTEND=noninteractive

###Add Sudo
RUN add-apt-repository ppa:kisak/kisak-mesa \
Expand All @@ -31,21 +30,9 @@ RUN add-apt-repository ppa:kisak/kisak-mesa \
# Set the locale
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
locale-gen
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
### Install Visual Studio Code
# COPY ./docker/src/ubuntu/install/vs_code $INST_SCRIPTS/vs_code/
# RUN bash $INST_SCRIPTS/vs_code/install_vs_code.sh && rm -rf $INST_SCRIPTS/vs_code/

### Install Gazebo
RUN wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg
RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null

RUN apt update && apt install -y \
# gz-garden \
gz-harmonic \
&& rm -rf /var/lib/apt/lists/
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8

RUN pip uninstall empy && pip install empy==3.3.4 && pip install -U colcon-common-extensions

Expand All @@ -61,12 +48,25 @@ RUN apt update && apt install -y \
python3-vcstool \
&& rm -rf /var/lib/apt/lists/

RUN rosdep init

### Install Gazebo
RUN curl https://packages.osrfoundation.org/gazebo.gpg --output /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null

RUN bash -c 'curl https://raw.githubusercontent.com/osrf/osrf-rosdep/master/gz/00-gazebo.list --output /etc/ros/rosdep/sources.list.d/00-gazebo.list'
ENV GZ_VERSION=harmonic

RUN apt update && apt install -y \
gz-harmonic \
ros-humble-ros-gzharmonic \
&& rm -rf /var/lib/apt/lists/

###Add the USER env var
RUN echo 'kasm-user ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
ENV HOME /home/kasm-user
ENV HOME=/home/kasm-user
USER kasm-user
ENV DEBIAN_FRONTEND noninteractive
ENV DEBIAN_FRONTEND=noninteractive

WORKDIR $HOME

Expand All @@ -86,7 +86,7 @@ ENV PATH=/opt/gcc-arm-none-eabi-10-2020-q4-major/bin:$PATH
ENV PATH=$PATH:$HOME/ardupilot/Tools/autotest
ENV PATH=/usr/lib/ccache:$PATH

RUN ["/bin/bash","-c","./waf configure && make sub"]
RUN ["/bin/bash","-c","cd $HOME/ardupilot && ./waf configure && make sub"]

# install ardupilot gazebo plugin
RUN sudo apt update && sudo apt install -y \
Expand All @@ -101,26 +101,18 @@ RUN sudo apt update && sudo apt install -y \
gstreamer1.0-gl \
&& sudo rm -rf /var/lib/apt/list/

WORKDIR $HOME
RUN git clone https://github.com/ArduPilot/ardupilot_gazebo

ENV GZ_VERSION=harmonic
RUN ["/bin/bash", "-c", "source /opt/ros/humble/setup.bash \
&& sudo rosdep init \
&& sudo wget https://raw.githubusercontent.com/osrf/osrf-rosdep/master/gz/00-gazebo.list -O /etc/ros/rosdep/sources.list.d/00-gazebo.list \
&& rosdep update \
&& rosdep resolve gz-$GZ_VERSION"]

WORKDIR $HOME/ardupilot_gazebo
RUN [ "/bin/bash","-c","mkdir build && cd build \
&& cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo\
&& make"]
WORKDIR $HOME
RUN git clone https://github.com/ArduPilot/ardupilot_gazebo && \
cd ardupilot_gazebo && \
mkdir build && cd build && \
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo && \
make -j4

ENV GZ_SIM_SYSTEM_PLUGIN_PATH=$HOME/ardupilot_gazebo/build:${GZ_SIM_SYSTEM_PLUGIN_PATH}
ENV GZ_SIM_RESOURCE_PATH=$HOME/ardupilot_gazebo/models:$HOME/ardupilot_gazebo/worlds:${GZ_SIM_RESOURCE_PATH}
ENV GZ_SIM_SYSTEM_PLUGIN_PATH=$HOME/ardupilot_gazebo/build
ENV GZ_SIM_RESOURCE_PATH=$HOME/ardupilot_gazebo/models:$HOME/ardupilot_gazebo/worlds

# Copy suave files
ENV GZ_VERSION=harmonic
RUN mkdir -p $HOME/suave_ws/src
COPY --chown=kasm-user:kasm-user suave.repos $HOME/suave_ws/suave.repos
WORKDIR $HOME/suave_ws/
Expand Down
38 changes: 38 additions & 0 deletions docs/source/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,44 @@ A dialog will request a username and password, these are shown below, with the p

<!-- Now you can proceed to [run the exemplar](#run-suave). -->

## Headless docker image

We also provide a docker image without VCN/Web interface, so you can just run the experiments directly from your terminal without needing to log in into the web interface.

Pull image:
```Bash
docker pull ghcr.io/kas-lab/suave-headless:main
```

Run image (without gpu):
```Bash
docker run -it --rm --name suave_runner -e DISPLAY=$DISPLAY -e QT_X11_NO_MITSHM=1 -v /tmp/.X11-unix:/tmp/.X11-unix -v /etc/localtime:/etc/localtime:ro -v $HOME/suave_ws/src/suave:/home/ubuntu-user/suave_ws/src/suave suave-headless
```

Run image (with nvidia)(don't forget to install nvidia docker toolkit)[https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html]:
```Bash
docker run -it --rm --gpus all --runtime=nvidia --name suave_runner -e DISPLAY=$DISPLAY -e QT_X11_NO_MITSHM=1 -e NVIDIA_VISIBLE_DEVICES=all -e NVIDIA_DRIVER_CAPABILITIES=all -v /dev/dri:/dev/dri -v /tmp/.X11-unix:/tmp/.X11-unix -v /etc/localtime:/etc/localtime:ro -v $HOME/suave_ws/src/suave:/home/ubuntu-user/suave_ws/src/suave suave-headless
```

You can try by running:

```Bash
ros2 run suave_runner suave_runner \
--ros-args \
-p gui:=False \
-p experiments:='[
"{\"experiment_launch\": \"ros2 launch suave_bt suave_bt.launch.py\", \
\"num_runs\": 2, \
\"adaptation_manager\": \"bt\", \
\"mission_name\": \"suave\"}"
]'
```

If you want the image to have acess to the host GUI run the following command before running the image:
```Bash
xhost +
```

## Build Docker images locally
To build the docker images locally, run:

Expand Down
46 changes: 30 additions & 16 deletions docs/source/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,48 @@ To follow the robot as it progresses along its m 10000 ission make sure to right click

### Full Runner

To run the exemplar with the runner, first make sure you are in the suave workspace:
To run the exemplar with the runner, first make sure you source the suave workspace:

```Bash
cd ~/suave_ws/src/suave/runner/
cd ~/suave_ws/
source ~/suave_ws/install/setup.bash
```

Then run:

Without gui:
```Bash
./runner.sh false metacontrol time 2
ros2 run suave_runner suave_runner \
--ros-args \
-p gui:=False \
-p experiments:='[
"{\"experiment_launch\": \"ros2 launch suave_bt suave_bt.launch.py\", \
\"num_runs\": 2, \
\"adaptation_manager\": \"bt\", \
\"mission_name\": \"suave\"}"
]'
```

With gui:
```Bash
./runner.sh true metacontrol time 2
ros2 run suave_runner suave_runner \
--ros-args \
-p gui:=True \
-p experiments:='[
"{\"experiment_launch\": \"ros2 launch suave_bt suave_bt.launch.py\", \
\"num_runs\": 2, \
\"adaptation_manager\": \"bt\", \
\"mission_name\": \"suave\"}"
]'
```

The runner script takes 4 positional parameters:
1. true or false -> indicates if the gui should be used
2. metacontrol or random or none -> indicates which managing subsystem to use
3. time or distance -> indicates which mission to run
4. number of runs
You can also use a launch file with a [config file](https://github.com/kas-lab/suave/blob/main/suave_runner/config/runner_config.yml) to make it easier to run the experiments:

```Bash
ros2 launch suave_runner suave_runner.launch.py
```

To run SUAVE with different managing subsystems. Just replace the `experiment_launch` with the proper launch file.

## Without the runner

Expand Down Expand Up @@ -86,14 +105,9 @@ Launching the mission file without launch arguments will start a time-constraine
```
'adaptation_manager':
Managing subsystem to be used
available values: none/metacontrol/random
available values: none/metacontrol/random/bt
(default: 'none')

'mission_type':
Type of mission to be executed
available values: time_constrained_mission/const_dist_mission
(default: 'time_constrained_mission')

'result_filename':
Filename for the mission measured metrics
available values: any name
Expand All @@ -105,5 +119,5 @@ The arguments can be defined by adding the above arguments with the notation `<n
An example of running the constant distance mission with metacontrol saving to a file called 'measurement_1':

```Bash
ros2 launch suave_missions mission.launch.py adaptation_manager:=metacontrol mission_type:=const_dist_mission result_filename:=measurement_1
ros2 launch suave_missions mission.launch.py adaptation_manager:=metacontrol result_filename:=measurement_1
```
8 changes: 2 additions & 6 deletions suave.repos
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repositories:
remaro_worlds:
type: git
url: https://github.com/remaro-network/remaro_worlds.git
version: 2650f19
version: 0e50a98
mc_mdl_tomasys:
type: git
url: https://github.com/meta-control/mc_mdl_tomasys.git
Expand All @@ -30,8 +30,4 @@ repositories:
system_modes:
type: git
url: https://github.com/micro-ROS/system_modes
version: 682ecb7
ros_gz:
type: git
url: https://github.com/gazebosim/ros_gz.git
version: 5cc92f8
version: 682ecb7
Loading
Loading
0