Skip to content

Commit ceb8c02

Browse files
committed
Add rotorS mavlink build test for PX4
This commit adds rotorS as a submodule of PX4 and adds a build test
1 parent fabf702 commit ceb8c02

File tree

4 files changed

+79
-0
lines changed

4 files changed

+79
-0
lines changed

.github/workflows/rotors_tests.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: RotorS PX4 Build Test
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
pull_request:
8+
branches:
9+
- '*'
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
container:
18+
- 'px4io/px4-dev-simulation-bionic:2020-11-18' # Gazebo 9
19+
container:
20+
image: ${{ matrix.container }}
21+
options: --privileged --ulimit core=-1 --security-opt seccomp=unconfined
22+
steps:
23+
- uses: actions/checkout@v1
24+
with:
25+
token: ${{ secrets.ACCESS_TOKEN }}
26+
- name: Prepare ccache timestamp
27+
id: ccache_cache_timestamp
28+
shell: cmake -P {0}
29+
run: |
30+
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
31+
message("::set-output name=timestamp::${current_date}")
32+
- name: ccache cache files
33+
uses: actions/cache@v2
34+
with:
35+
path: ~/.ccache
36+
key: rotors_tests-RelWithDebInfo-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
37+
restore-keys: rotors_tests-RelWithDebInfo-ccache-
38+
- name: setup ccache
39+
run: |
40+
mkdir -p ~/.ccache
41+
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
42+
echo "compression = true" >> ~/.ccache/ccache.conf
43+
echo "compression_level = 5" >> ~/.ccache/ccache.conf
44+
echo "max_size = 100M" >> ~/.ccache/ccache.conf
45+
ccache -s
46+
ccache -z
47+
- name: Install glog
48+
run: apt update && apt install -y libgoogle-glog-dev libyaml-cpp-dev
49+
- name: Build PX4 RotorS
50+
env:
51+
PX4_CMAKE_BUILD_TYPE: RelWithDebInfo
52+
DONT_RUN: 1
53+
run: make px4_sitl rotors
54+
- name: ccache post-run px4/firmware
55+
run: ccache -s

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,6 @@
6363
[submodule "src/drivers/uavcannode_gps_demo/libcanard"]
6464
path = src/drivers/uavcannode_gps_demo/libcanard
6565
url = https://github.com/UAVCAN/libcanard
66+
[submodule "Tools/rotors_simulator"]
67+
path = Tools/rotors_simulator
68+
url = https://github.com/ethz-asl/rotors_simulator.git

Tools/rotors_simulator

Submodule rotors_simulator added at 06fb8b2

platforms/posix/cmake/sitl_target.cmake

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,29 @@ ExternalProject_Add(jsbsim_bridge
8585
BUILD_ALWAYS 1
8686
)
8787

88+
px4_add_git_submodule(TARGET git_rotors PATH "${PX4_SOURCE_DIR}/Tools/rotors_simulator")
89+
ExternalProject_Add(rotors_simulator
90+
SOURCE_DIR ${PX4_SOURCE_DIR}/Tools/rotors_simulator/rotors_gazebo_plugins
91+
CMAKE_ARGS
92+
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
93+
-DNO_ROS=true
94+
BINARY_DIR ${PX4_BINARY_DIR}/build_rotors
95+
INSTALL_COMMAND ""
96+
DEPENDS
97+
git_rotors
98+
USES_TERMINAL_CONFIGURE true
99+
USES_TERMINAL_BUILD true
100+
EXCLUDE_FROM_ALL true
101+
BUILD_ALWAYS 1
102+
BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> -- -j1
103+
)
104+
88105
# create targets for each viewer/model/debugger combination
89106
set(viewers
90107
none
91108
jmavsim
92109
gazebo
110+
rotors
93111
)
94112

95113
set(debuggers
@@ -178,6 +196,8 @@ foreach(viewer ${viewers})
178196
add_dependencies(${_targ_name} px4 sitl_gazebo)
179197
elseif(viewer STREQUAL "jmavsim")
180198
add_dependencies(${_targ_name} px4 git_jmavsim)
199+
elseif(viewer STREQUAL "rotors")
200+
add_dependencies(${_targ_name} px4 rotors_simulator)
181201
endif()
182202
else()
183203
if(viewer STREQUAL "gazebo")

0 commit comments

Comments
 (0)