Skip to content

Commit 93feeb9

Browse files
authored
Fix jazzy and rolling CI jobs (#37)
* allow pip installs * use ros-base images * use correct tera renderer version * use tera binaries instead of building from source * cleanup pkg.xml and readme
1 parent d3dca37 commit 93feeb9

File tree

8 files changed

+62
-123
lines changed

8 files changed

+62
-123
lines changed

.github/workflows/ci-humble.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: CI (humble)
2+
on:
3+
push:
4+
branches: [ main ]
5+
pull_request:
6+
branches: [ main ]
7+
workflow_dispatch:
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
container:
12+
image: rostooling/setup-ros-docker:ubuntu-jammy-ros-humble-ros-base-latest
13+
steps:
14+
- uses: ros-tooling/action-ros-ci@v0.4
15+
continue-on-error: false
16+
with:
17+
target-ros2-distro: humble

.github/workflows/ci-jazzy.yaml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,10 @@ jobs:
99
build:
1010
runs-on: ubuntu-latest
1111
container:
12-
image: ubuntu:noble
12+
image: rostooling/setup-ros-docker:ubuntu-noble-ros-jazzy-ros-base-latest
1313
steps:
14-
- uses: actions/checkout@v4
15-
- uses: ros-tooling/setup-ros@v0.7
16-
with:
17-
required-ros-distributions: jazzy
18-
use-ros2-testing: true
14+
- name: Allow pip to install packages
15+
run: printf "[install]\nbreak-system-packages = true\n" | sudo tee -a /etc/pip.conf
1916
- uses: ros-tooling/action-ros-ci@v0.4
20-
continue-on-error: true
2117
with:
2218
target-ros2-distro: jazzy

.github/workflows/ci-rolling.yaml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,10 @@ jobs:
99
build:
1010
runs-on: ubuntu-latest
1111
container:
12-
image: ubuntu:noble
12+
image: rostooling/setup-ros-docker:ubuntu-noble-ros-rolling-ros-base-latest
1313
steps:
14-
- uses: actions/checkout@v4
15-
- uses: ros-tooling/setup-ros@v0.7
16-
with:
17-
required-ros-distributions: rolling
18-
use-ros2-testing: true
14+
- name: Allow pip to install packages
15+
run: printf "[install]\nbreak-system-packages = true\n" | sudo tee -a /etc/pip.conf
1916
- uses: ros-tooling/action-ros-ci@v0.4
20-
continue-on-error: true
2117
with:
2218
target-ros2-distro: rolling

.github/workflows/ci.yml

Lines changed: 0 additions & 69 deletions
This file was deleted.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
build/
2+
install/
3+
log/

CMakeLists.txt

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -85,36 +85,31 @@ if(${BUILD_ACADOS_TEMPLATE})
8585
if(NOT EXISTS "${TERA_RENDERER}")
8686
# Add empty bin directory (used to download the tera renderer)
8787
install(DIRECTORY DESTINATION "opt/${PROJECT_NAME}/bin")
88-
set(TERA_VERSION "0.0.35")
89-
# Clone the tera renderer
90-
message(STATUS "Cloning Tera renderer")
91-
if(NOT EXISTS "${ACADOS_SOURCE_BUILD_DIR}/tera_renderer")
92-
execute_process(COMMAND git clone --quiet https://github.com/acados/tera_renderer -b v${TERA_VERSION}
93-
WORKING_DIRECTORY "${ACADOS_SOURCE_BUILD_DIR}"
94-
RESULT_VARIABLE TERA_GIT_OUT
95-
OUTPUT_VARIABLE TERA_GIT_OUT)
96-
if(NOT TERA_GIT_OUT EQUAL 0)
97-
message(FATAL_ERROR "Failed to clone Tera renderer")
98-
endif()
99-
else()
100-
message(STATUS "${ACADOS_SOURCE_BUILD_DIR}/tera_renderer already exists")
88+
set(TERA_VERSION "0.0.34")
89+
set(TERA_URL_BASE "https://github.com/acados/tera_renderer")
90+
set(TERA_URL "${TERA_URL_BASE}/releases/download/v${TERA_VERSION}/t_renderer-v${TERA_VERSION}-linux")
91+
message(STATUS "Tera renderer not found, downloading version ${TERA_VERSION} from ${TERA_URL}")
92+
93+
# Download binaries for the tera renderer
94+
file(DOWNLOAD
95+
"${TERA_URL}"
96+
"${TERA_RENDERER}"
97+
SHOW_PROGRESS
98+
STATUS TERA_DOWNLOAD_STATUS
99+
)
100+
list(GET TERA_DOWNLOAD_STATUS 0 TERA_DOWNLOAD_CODE)
101+
if(NOT TERA_DOWNLOAD_CODE EQUAL 0)
102+
message(FATAL_ERROR "Failed to download Tera renderer: ${TERA_DOWNLOAD_STATUS}")
101103
endif()
102-
# Compile the tera renderer
103-
message(STATUS "Building Tera renderer")
104-
execute_process(COMMAND cargo build --quiet --release
105-
WORKING_DIRECTORY "${ACADOS_SOURCE_BUILD_DIR}/tera_renderer"
106-
RESULT_VARIABLE TERA_BUILD_OUT
107-
OUTPUT_VARIABLE TERA_BUILD_OUT)
108-
if(NOT TERA_BUILD_OUT EQUAL 0)
109-
message(FATAL_ERROR "Failed to build Tera renderer")
110-
endif()
111-
# Copy the tera renderer
112-
file(COPY "${ACADOS_SOURCE_BUILD_DIR}/tera_renderer/target/release/t_renderer"
113-
DESTINATION "${ACADOS_SOURCE_DIR}/bin")
104+
105+
# Make the tera renderer executable
114106
file(CHMOD
115107
${TERA_RENDERER}
116108
PERMISSIONS
117-
OWNER_READ OWNER_WRITE GROUP_READ GROUP_WRITE OWNER_EXECUTE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
109+
OWNER_READ OWNER_WRITE OWNER_EXECUTE
110+
GROUP_READ GROUP_EXECUTE
111+
WORLD_READ WORLD_EXECUTE
112+
)
118113
endif()
119114
endif()
120115
ament_environment_hooks("${CMAKE_CURRENT_SOURCE_DIR}/env-hooks/${PROJECT_NAME}.sh.in")

README.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,31 @@
22
Simple ros2 vendor for Acados.
33

44
![version](https://img.shields.io/badge/version-0.3.6-blue)
5-
[![CI (humble)](https://github.com/ICube-Robotics/acados_vendor_ros2/actions/workflows/ci.yml/badge.svg)](https://github.com/ICube-Robotics/acados_vendor_ros2/actions/workflows/ci.yml)
5+
[![CI (humble)](https://github.com/ICube-Robotics/acados_vendor_ros2/actions/workflows/ci-humble.yml/badge.svg)](https://github.com/ICube-Robotics/acados_vendor_ros2/actions/workflows/ci-humble.yml)
66
[![Build tests (jazzy)](../../actions/workflows/ci-jazzy.yaml/badge.svg?branch=main)](../../actions/workflows/ci-jazzy.yaml?query=branch:main)
77
[![Build tests (rolling)](../../actions/workflows/ci-rolling.yaml/badge.svg?branch=main)](../../actions/workflows/ci-rolling.yaml?query=branch:main)
88

9-
10-
## Installation
9+
## Installation (humble)
1110

1211
```bash
13-
mkdir ros2_ws/src
14-
cd ros2_ws/src
1512
git clone https://github.com/ICube-Robotics/acados_vendor_ros2.git
13+
cd acados_vendor_ros2
1614

17-
# Download the source and install the c interface (lib "acados")
18-
cd ..
19-
rosdep install --ignore-src --from-paths . -y -r
15+
rosdep install --from-paths . -y --ignore-src
2016
colcon build
2117
```
2218

23-
>**NOTE:** If the `ament_cmake_vendor_package` is missing, you can install it manually:
19+
## Installation (jazzy and later)
20+
2421
```bash
25-
sudo apt install ros-<ROS_DISTRO>-ament-cmake-vendor-package
22+
git clone https://github.com/ICube-Robotics/acados_vendor_ros2.git
23+
cd acados_vendor_ros2
24+
25+
PIP_BREAK_SYSTEM_PACKAGES=1 rosdep install --from-paths . -y --ignore-src
26+
colcon build
2627
```
28+
> [!TIP] Since Ubuntu 24.04, pip restricts installing Python packages to system locations by default. The `PIP_BREAK_SYSTEM_PACKAGES=1` flag allows `rosdep` to install Python dependencies even when system Python is used.
29+
> You can avoid using the flag if you manually install the `casadi` binaries beforehand as a system package or if you use a virtual environment (**later option recommended**).
2730
2831
## Usage
2932

package.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,15 @@
1313
<author email="thibault.poignonec@gmail.com">Thibault Poignonec</author>
1414

1515
<buildtool_depend>ament_cmake</buildtool_depend>
16-
<buildtool_depend>ament_cmake_python</buildtool_depend>
17-
<buildtool_depend>ament_cmake_test</buildtool_depend>
1816
<buildtool_depend>ament_cmake_vendor_package</buildtool_depend>
17+
<buildtool_depend>ament_cmake_python</buildtool_depend>
1918
<buildtool_depend>pkg-config</buildtool_depend>
2019

21-
<build_depend>cargo</build_depend>
22-
2320
<exec_depend>casadi-pip</exec_depend>
2421

2522
<buildtool_export_depend>pkg-config</buildtool_export_depend>
2623

24+
<test_depend>ament_cmake_test</test_depend>
2725
<test_depend>ament_cmake_copyright</test_depend>
2826
<test_depend>ament_cmake_lint_cmake</test_depend>
2927
<test_depend>ament_cmake_xmllint</test_depend>

0 commit comments

Comments
 (0)