Skip to content

Commit a5d5b76

Browse files
committed
px4_msgs overhaul corresponding with new PX4-Autopilot microdds_client
1 parent daee121 commit a5d5b76

File tree

98 files changed

+143
-1543
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+143
-1543
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ on:
55
push:
66
branches:
77
- 'main'
8-
- 'ros2'
9-
pull_request:
10-
branches-ignore:
11-
- '**ros1**'
128

139
defaults:
1410
run:
@@ -21,7 +17,7 @@ jobs:
2117
container: px4io/px4-dev-ros2-${{ matrix.ros2_distro }}:2021-05-31
2218
strategy:
2319
matrix:
24-
ros2_distro: [dashing, eloquent, foxy, galactic, rolling]
20+
ros2_distro: [foxy, humble, rolling]
2521
steps:
2622
- uses: actions/checkout@v3
2723
- name: build

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
build/
12
msg/idl.cc

CMakeLists.txt

Lines changed: 6 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,14 @@ project(px4_msgs)
44

55
list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
66

7-
include(EnableC++XX)
8-
97
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
10-
add_compile_options(-Wall -Wextra)
8+
add_compile_options(-Wall -Wextra)
119
endif()
1210

1311
find_package(ament_cmake REQUIRED)
1412
find_package(builtin_interfaces REQUIRED)
1513
find_package(rosidl_default_generators REQUIRED)
1614

17-
# find ROS distro
18-
set(ROS_DISTRO)
19-
if(DEFINED ENV{ROS2_DISTRO})
20-
set(ROS_DISTRO $ENV{ROS2_DISTRO})
21-
else()
22-
set(ROS_DISTRO $ENV{ROS_DISTRO})
23-
endif()
24-
25-
if(${ROS_DISTRO} MATCHES "ardent" OR ${ROS_DISTRO} MATCHES "bouncy" OR
26-
${ROS_DISTRO} MATCHES "crystal")
27-
find_package(rosidl_generator_dds_idl REQUIRED)
28-
endif()
29-
3015
# ##############################################################################
3116
# Generate ROS messages, ROS2 interfaces and IDL files #
3217
# ##############################################################################
@@ -39,32 +24,11 @@ file(GLOB ROS_MSG_DIR_LIST "${MSGS_DIR}/*.msg")
3924

4025
set(ROS_MSG_DIR_LIST "${ROS_MSG_DIR_LIST}" CACHE INTERNAL "ROS_MSG_DIR_LIST")
4126

42-
if(NOT "${PX4_MSGS}" STREQUAL "")
43-
# Generate introspection typesupport for C and C++ and IDL files
44-
rosidl_generate_interfaces(${PROJECT_NAME}
45-
${PX4_MSGS}
46-
DEPENDENCIES
47-
builtin_interfaces
48-
ADD_LINTER_TESTS)
49-
50-
# Generate Fast RTPS IDL files (previous to Dashing, so to make the IDL
51-
# compatible with the upstream PX4 IDL generator)
52-
if(${ROS_DISTRO} MATCHES "ardent" OR ${ROS_DISTRO} MATCHES "bouncy" OR
53-
${ROS_DISTRO} MATCHES "crystal")
54-
rosidl_generate_dds_interfaces(${PROJECT_NAME}__fastrtps_idl
55-
IDL_FILES
56-
${ROS_MSG_DIR_LIST}
57-
OUTPUT_SUBFOLDERS
58-
"dds_fastrtps")
59-
# rosidl_generator_dds_idl requires a target to generate the IDL files
60-
# as we don't have one, we create a dummy target to serve the purpose
61-
file(WRITE ${MSGS_DIR}/idl.cc "int main() { return 0; }")
62-
add_executable(idl_target ${MSGS_DIR}/idl.cc)
63-
add_dependencies(idl_target ${PROJECT_NAME}__fastrtps_idl)
64-
endif()
65-
else()
66-
message(FATAL_ERROR "No PX4 msgs found to generate interfaces to!")
67-
endif()
27+
# Generate introspection typesupport for C and C++ and IDL files
28+
rosidl_generate_interfaces(${PROJECT_NAME} ${PX4_MSGS}
29+
DEPENDENCIES builtin_interfaces
30+
ADD_LINTER_TESTS
31+
)
6832

6933
ament_export_dependencies(rosidl_default_runtime)
7034

cmake/EnableC++XX.cmake

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

msg/ActionRequest.msg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ uint8 SOURCE_RC_SWITCH = 1
1616
uint8 SOURCE_RC_BUTTON = 2
1717
uint8 SOURCE_RC_MODE_SLOT = 3
1818

19-
uint8 mode # for ACTION_SWITCH_MODE what mode is requested according to commander_state.MAIN_STATE_
19+
uint8 mode # for ACTION_SWITCH_MODE what mode is requested according to vehicle_status_s::NAVIGATION_STATE_*

msg/ActuatorControls.msg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ uint8 GROUP_INDEX_GIMBAL = 2
2020
uint64 timestamp_sample # the timestamp the data this control response is based on was sampled
2121
float32[9] control
2222

23+
# TOPICS actuator_controls_0 actuator_controls_1 actuator_controls_2
24+
# TOPICS actuator_controls_virtual_fw actuator_controls_virtual_mc

msg/ActuatorControls0.msg

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

msg/ActuatorControls1.msg

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

msg/ActuatorControls2.msg

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

msg/ActuatorControlsStatus.msg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ uint8 INDEX_THROTTLE = 3
77

88
float32[4] control_power
99

10+
# TOPICS actuator_controls_status_0 actuator_controls_status_1

0 commit comments

Comments
 (0)