Skip to content

Commit

Permalink
Merge pull request #1 from tpoignonec/(tpoignonec)refractor_after_rep…
Browse files Browse the repository at this point in the history
…os_switch

refractor all after repos switch
  • Loading branch information
tpoignonec authored Feb 14, 2024
2 parents b10d05c + 0cd5be9 commit c45d7e1
Show file tree
Hide file tree
Showing 34 changed files with 54 additions and 47 deletions.
8 changes: 4 additions & 4 deletions .docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@
To use it, make sure you have [Docker](https://docs.docker.com/get-docker/) installed, then build and run the image :

```shell
$ docker build --tag acados_controllers_ros2:humble --file .docker/run/Dockerfile .
$ docker build --tag acados_solver_ros2:humble --file .docker/run/Dockerfile .
```

### Run with GUI
To run the docker image with GUI, use the [rocker tool](https://github.com/osrf/rocker):
```shell
$ sudo apt install python3-rocker
$ rocker --net=host --x11 acados_controllers_ros2:humble ros2 run sandbox test_urdf2casadi
$ rocker --net=host --x11 acados_solver_ros2:humble ros2 run sandbox test_urdf2casadi
```

### Run with bash
To interact with the environment, run docker using:
```shell
$ docker run -it acados_controllers_ros2:humble
$ docker run -it acados_solver_ros2:humble
```
and inside docker run:
```shell
$ cd ros2_dev/acados_controllers_ros2/
$ cd ros2_dev/acados_solver_ros2/
$ source install/local_setup.bash
$ ros2 run sandbox test_urdf2casadi
```
4 changes: 2 additions & 2 deletions .docker/ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ARG ROS_DISTRO="humble"
FROM ros:${ROS_DISTRO}

# COPY . /ros2_dev/src/acados_controllers_ros2
# COPY . /ros2_dev/src/acados_solver_ros2
RUN apt update && apt upgrade -y
RUN apt install -y python3-pip git tree
# RUN apt update && \
# cd ros2_dev/src/acados_controllers_ros2 && \
# cd ros2_dev/src/acados_solver_ros2 && \
# git submodule update --init --recursive \
6 changes: 3 additions & 3 deletions .docker/run/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
ARG ROS_DISTRO="humble"
FROM ros:${ROS_DISTRO}

COPY . /ros2_dev/src/acados_controllers_ros2
COPY . /ros2_dev/src/acados_solver_ros2
RUN apt update && apt upgrade -y
RUN apt install -y python3-pip
RUN apt install -y git clang-format-14 cppcheck
RUN pip install pre-commit
RUN apt update && \
cd ros2_dev/src/acados_controllers_ros2 && \
cd ros2_dev/src/acados_solver_ros2 && \
git submodule update --init --recursive
RUN cd ros2_dev/src && \
vcs import . < acados_controllers_ros2/acados_controllers_ros2.repos
vcs import . < acados_solver_ros2/acados_solver_ros2.repos
RUN cd ros2_dev/ && \
. /opt/ros/${ROS_DISTRO}/setup.sh && \
rosdep install --ignore-src --from-paths . -y -r
Expand Down
2 changes: 1 addition & 1 deletion .docker/run/ros_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ set -e
# setup ros environment
export ROS_LOCALHOST_ONLY=1
source "/opt/ros/$ROS_DISTRO/setup.bash"
source "/ros2_dev/acados_controllers_ros2/install/setup.bash"
source "/ros2_dev/acados_solver_ros2/install/setup.bash"
exec "$@"
2 changes: 1 addition & 1 deletion .github/workflows/ci-iron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ jobs:
- uses: ros-tooling/action-ros-ci@v0.3
with:
target-ros2-distro: iron
vcs-repo-file-url: ./acados_controllers_ros2.repos
vcs-repo-file-url: ./acados_solver_ros2.repos
import-token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/ci-rolling.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ jobs:
- uses: ros-tooling/action-ros-ci@v0.3
with:
target-ros2-distro: rolling
vcs-repo-file-url: ./acados_controllers_ros2.repos
vcs-repo-file-url: ./acados_solver_ros2.repos
import-token: ${{ secrets.GITHUB_TOKEN }}
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,28 @@ jobs:
mkdir -p ${{github.workspace}}/src
- uses: actions/checkout@v4
with:
path: src/acados_controllers_ros2
path: src/acados_solver_ros2

- name: Build Docker Image
uses: docker/build-push-action@v5
with:
tags: acados_controllers_ros2:humble
tags: acados_solver_ros2:humble
file: .docker/ci/Dockerfile
push: false

- name: Build
uses: addnab/docker-run-action@v3
with:
image: acados_controllers_ros2:humble
image: acados_solver_ros2:humble
options: -v ${{github.workspace}}/:/ros/
run: |
cd /ros # structure = <...>/ros/src/acados_controllers_ros2/<...>
cd /ros # structure = <...>/ros/src/acados_solver_ros2/<...>
. /opt/ros/humble/setup.sh
cd src/acados_controllers_ros2
cd src/acados_solver_ros2
git config --global --add safe.directory '*'
git submodule update --init --recursive
cd .. # = ros/src/
vcs import . < acados_controllers_ros2/acados_controllers_ros2.repos
vcs import . < acados_solver_ros2/acados_solver_ros2.repos
cd .. # = ros/
tree -L 4
rosdep install --ignore-src --from-paths . -y -r
Expand All @@ -49,7 +49,7 @@ jobs:
- name: Tests
uses: addnab/docker-run-action@v3
with:
image: acados_controllers_ros2:humble
image: acados_solver_ros2:humble
options: -v ${{github.workspace}}/:/ros/
run: |
cd /ros
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ jobs:
run: |
sudo apt-get update -qq
sudo apt-get install -y -qq python3-sphinx doxygen doxygen-gui doxygen-doc graphviz plantuml
cd ./acados_controllers_ros2/
cd ./acados_solver_ros2/
pip install -r requirements.txt
- name: Build documentation
run: |
cd ./acados_controllers_ros2
cd ./acados_solver_ros2
sphinx-build -b html sphinx sphinx/_build
cd ../
- name: Create commit
run: |
git clone https://github.com/tpoignonec/acados_controllers_ros2.git --branch gh-pages --single-branch gh-pages
git clone https://github.com/tpoignonec/acados_solver_ros2.git --branch gh-pages --single-branch gh-pages
cd gh-pages && rm -r * && cd ..
mkdir -p gh-pages/docs/
mkdir -p gh-pages/api/
cp -r ./acados_controllers_ros2/sphinx/_build/* gh-pages/
cp -r ./acados_controllers_ros2/doxygen/_build/html/* gh-pages/api/
cp -r ./acados_solver_ros2/sphinx/_build/* gh-pages/
cp -r ./acados_solver_ros2/doxygen/_build/html/* gh-pages/api/
cd gh-pages
touch .nojekyll
git config --local user.email "action@github.com"
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
acados_controllers_ros2/*/_build/*
acados_solver_ros2/*/_build/*

# Python
**/__pycache__/**
Expand Down
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "acados_controllers_ros2/doxygen/extras/doxygen-awesome-css"]
path = acados_controllers_ros2/doxygen/extras/doxygen-awesome-css
[submodule "acados_solver_ros2/doxygen/extras/doxygen-awesome-css"]
path = acados_solver_ros2/doxygen/extras/doxygen-awesome-css
url = https://github.com/jothepro/doxygen-awesome-css.git
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@

# Change Log

## [Unreleased] - XXXX-XX-XX
## [0.2.0] - XXXX-XX-XX

Note: the URL has changed from `https://github.com/tpoignonec/acados_controllers_ros2` to `https://github.com/tpoignonec/acados_solver_ros2`. See [PR #1](https://github.com/tpoignonec/acados_solver_ros2/pull/1)

### Added

- [PR #32](https://github.com/tpoignonec/acados_controllers_ros2/pull/32) An example package for plugin export.
- Some more documentation in the "getting started" section.

### Changed

- [PR #32](https://github.com/tpoignonec/acados_controllers_ros2/pull/32) Package export namespace.

### Fixed

## [0.1.2] - 2023-11-15
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# acados_controllers_ros2
# acados_solver_ros2

[![Licence](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![CI](https://github.com/tpoignonec/acados_controllers_ros2/actions/workflows/ci.yml/badge.svg)](https://github.com/tpoignonec/acados_controllers_ros2/actions/workflows/ci.yml)
[![CI](https://github.com/tpoignonec/acados_solver_ros2/actions/workflows/ci.yml/badge.svg)](https://github.com/tpoignonec/acados_solver_ros2/actions/workflows/ci.yml)
[![Build tests (iron)](../../actions/workflows/ci-iron.yaml/badge.svg?branch=main)](../../actions/workflows/ci-iron.yaml?query=branch:main)
[![Build tests (rolling)](../../actions/workflows/ci-rolling.yaml/badge.svg?branch=main)](../../actions/workflows/ci-rolling.yaml?query=branch:main)

Expand All @@ -16,7 +16,7 @@ To date, the stack includes:
- `acados_solver_plugins_example`: a package to be used as a demo and as a template when starting a project using the acados solvers.


**For more information, please check the [documentation](https://tpoignonec.github.io/acados_controllers_ros2/).**
**For more information, please check the [documentation](https://tpoignonec.github.io/acados_solver_ros2/).**

## Contacts ##
![icube](https://icube.unistra.fr/fileadmin/templates/DUN/icube/images/logo.png)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#
# Author: Thibault Poignonec (thibault.poignonec@gmail.com)

# Part of the 'acados_controller_ros2' package
# Part of the 'acados_solver_ros2' package

function(regenerate_if_flag_modified)
set( FLAG_FILE_REBUILD ${CMAKE_CURRENT_SOURCE_DIR}/src/plugins/.flag_regenerate_cmake )
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.8)
project(acados_controllers_ros2 NONE)
project(acados_solver_ros2 NONE)
find_package(ament_cmake REQUIRED)


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### Acados Controllers for ROS2 control
### Acados solver utils for ROS2 applications

## Meta-package `acados_controllers_ros2`
## Meta-package `acados_solver_ros2`

This is a meta-package Acados ROS2 controllers stack.

Expand All @@ -14,7 +14,7 @@ sudo apt install python3-sphinx doxygen doxygen-gui doxygen-doc

2) Install the necessary sphinx extensions
```bash
cd acados_controllers_ros2/acados_controllers_ros2
cd acados_solver_ros2/acados_solver_ros2
pip install -r requirements.txt
```

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# All settings not listed here will use the Doxygen default values.

PROJECT_NAME = "acados_controllers_ros2"
PROJECT_NAME = "acados_solver_ros2"
PROJECT_NUMBER = main
PROJECT_BRIEF = "Acados-based NMPC controllers for ROS2 control"

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>acados_controllers_ros2</name>
<name>acados_solver_ros2</name>
<version>0.1.2</version>
<description>Meta-package aggregating the acados_controllers_ros2 packages and documentation</description>
<description>Meta-package aggregating the acados_solver_ros2 packages and documentation</description>
<maintainer email="tpoignonec@unistra.fr">Thibault Poignonec</maintainer>
<license>Apache License 2.0</license>

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

# -- Project information -----------------------------------------------------

project = "acados_controllers_ros2"
project = "acados_solver_ros2"
copyright = "2023, ICUBE Laboratory, University of Strasbourg"
author = "Thibault Poignonec"

Expand All @@ -60,7 +60,7 @@
"breathe",
]

breathe_default_project = "acados_controllers_ros2"
breathe_default_project = "acados_solver_ros2"


def get_package(package: str):
Expand All @@ -79,9 +79,9 @@ def get_package(package: str):
highlight_language = "cpp"

breathe_projects = {
"acados_controllers_ros2": "_build/xml/",
"acados_solver_ros2": "_build/xml/",
}
breathe_default_project = "acados_controllers_ros2"
breathe_default_project = "acados_solver_ros2"
breathe_default_members = ('members', 'undoc-members')


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ To date, the stack includes:
A minimalistic Python library provides simple generation of C++ solver plugins from Python Acados models;
* ``acados_solver_plugins_example``: a package to be used as a demo and as a template when starting a project using the acados solvers.

**Project GitHub repository:** `acados_controllers_ros2 <https://github.com/tpoignonec/acados_controllers_ros2>`_
**Project GitHub repository:** `acados_solver_ros2 <https://github.com/tpoignonec/acados_solver_ros2>`_

.. toctree::
:maxdepth: 1
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ See the `official documentation <https://docs.ros.org/en/humble/Installation.htm
sudo apt install python3-colcon-common-extensions
cd ~/ros2_ws
cd src
git clone https://github.com/tpoignonec/acados_controllers_ros2.git
vcs import . < acados_controllers_ros2/acados_controllers_ros2.repos
git clone https://github.com/tpoignonec/acados_solver_ros2.git
vcs import . < acados_solver_ros2/acados_solver_ros2.repos
rosdep install --ignore-src --from-paths . -y -r
4. Build stack and source
Expand All @@ -46,7 +46,7 @@ First, export the Acados solver plugin:
cd ~/ros2_ws
source install/setup.bash
cd src/acados_controllers_ros2/acados_solver_plugins_example/script
cd src/acados_solver_ros2/acados_solver_plugins_example/script
python3 -m demo_export_plugin_to_custom_pkg
# Note: if used for the first time, Acados will ask you to install "Tera renderer"
Expand Down

0 comments on commit c45d7e1

Please sign in to comment.