-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from MaximilienNaveau/topic/mnaveau/humble-dev…
…el/packaging migrate to ROS2
- Loading branch information
Showing
8 changed files
with
154 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Ubuntu20.04, ROS2 Continuous Integration | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
include: | ||
- ros_version: "humble" | ||
ubuntu_version: "ubuntu-22.04" | ||
- ros_version: "iron" | ||
ubuntu_version: "ubuntu-22.04" | ||
runs-on: ${{ matrix.ubuntu_version }} | ||
steps: | ||
# | ||
# Setup the machines and build environment | ||
# | ||
- name: Install ROS. | ||
uses: ros-tooling/setup-ros@0.7.9 | ||
with: | ||
required-ros-distributions: ${{ matrix.ros_version }} | ||
|
||
# | ||
# Checkout the current branch | ||
# | ||
- uses: actions/checkout@v2 | ||
|
||
# | ||
# Build and test the repo | ||
# | ||
- uses: ros-tooling/action-ros-ci@0.3.14 | ||
with: | ||
package-name: linear_feedback_controller_msgs | ||
target-ros2-distro: ${{ matrix.ros_version }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,79 +1,65 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
cmake_minimum_required(VERSION 3.22.1) | ||
|
||
# | ||
# Choosing to build the unittest (Catkin vs Modern CMake vs Ament). | ||
# | ||
if(DEFINED CATKIN_ENABLE_TESTING) | ||
set(BUILD_TESTING ${CATKIN_ENABLE_TESTING}) | ||
endif() | ||
project(linear_feedback_controller_msgs) | ||
|
||
# | ||
# Project definition | ||
# | ||
project(linear_feedback_controller_msgs LANGUAGES CXX) | ||
find_package(ament_cmake REQUIRED) | ||
find_package(rosidl_default_generators REQUIRED) | ||
|
||
# | ||
# Dependencies | ||
# | ||
find_package(eigen3_cmake_module REQUIRED) | ||
find_package(Eigen3 REQUIRED) | ||
find_package(catkin REQUIRED COMPONENTS std_msgs sensor_msgs geometry_msgs | ||
eigen_conversions message_generation) | ||
find_package(tf2_eigen REQUIRED) | ||
find_package(builtin_interfaces REQUIRED) | ||
find_package(std_msgs REQUIRED) | ||
find_package(sensor_msgs REQUIRED) | ||
find_package(geometry_msgs REQUIRED) | ||
|
||
# | ||
# Generate the messages | ||
# | ||
add_message_files(DIRECTORY msg FILES Contact.msg Control.msg Sensor.msg) | ||
generate_messages(DEPENDENCIES std_msgs sensor_msgs geometry_msgs) | ||
|
||
# | ||
# Export as catkin package (For ROS1 compatibility...). | ||
# | ||
# cmake-format: off | ||
catkin_package( | ||
INCLUDE_DIRS include | ||
CATKIN_DEPENDS std_msgs sensor_msgs geometry_msgs message_runtime eigen_conversions | ||
DEPENDS EIGEN3) | ||
# cmake-format: on | ||
rosidl_generate_interfaces(${PROJECT_NAME} | ||
"msg/Contact.msg" | ||
"msg/Control.msg" | ||
"msg/Sensor.msg" | ||
DEPENDENCIES builtin_interfaces std_msgs sensor_msgs geometry_msgs | ||
ADD_LINTER_TESTS | ||
) | ||
rosidl_get_typesupport_target(cpp_typesupport_target | ||
${PROJECT_NAME} rosidl_typesupport_cpp) | ||
|
||
# | ||
# Main lib. | ||
# | ||
set(${PROJECT_NAME}_HEADERS include/${PROJECT_NAME}/eigen_conversions.hpp) | ||
set(${PROJECT_NAME}_SOURCES "") | ||
add_library(${PROJECT_NAME} INTERFACE) | ||
target_link_libraries( | ||
${PROJECT_NAME} | ||
INTERFACE Eigen3::Eigen ${std_msgs_LIBRARIES} ${sensor_msgs_LIBRARIES} | ||
${eigen_conversions_LIBRARIES} ${geometry_msgs_LIBRARIES} | ||
${message_generation_LIBRARIES}) | ||
add_library(${PROJECT_NAME}_conversion INTERFACE) | ||
target_link_libraries(${PROJECT_NAME}_conversion | ||
INTERFACE Eigen3::Eigen tf2_eigen::tf2_eigen "${cpp_typesupport_target}") | ||
target_include_directories( | ||
${PROJECT_NAME} SYSTEM | ||
INTERFACE ${std_msgs_INCLUDE_DIRS} ${sensor_msgs_INCLUDE_DIRS} | ||
${eigen_conversions_INCLUDE_DIRS} ${geometry_msgs_INCLUDE_DIRS} | ||
${message_generation_INCLUDE_DIRS}) | ||
target_include_directories( | ||
${PROJECT_NAME} | ||
${PROJECT_NAME}_conversion | ||
INTERFACE $<INSTALL_INTERFACE:include/> | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>) | ||
|
||
# | ||
# Unit tests | ||
# | ||
if(BUILD_TESTING) | ||
catkin_add_gtest(test_eigen_conversions tests/test_eigen_conversions.cpp | ||
tests/gtest_main.cpp) | ||
target_link_libraries(test_eigen_conversions ${PROJECT_NAME}) | ||
ament_add_gtest(test_eigen_conversions tests/test_eigen_conversions.cpp | ||
tests/gtest_main.cpp) | ||
target_link_libraries(test_eigen_conversions ${PROJECT_NAME}_conversion) | ||
endif() | ||
|
||
# | ||
# Install | ||
# | ||
install( | ||
TARGETS ${PROJECT_NAME} | ||
TARGETS ${PROJECT_NAME}_conversion | ||
EXPORT ${TARGETS_EXPORT_NAME} | ||
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}) | ||
install(FILES package.xml DESTINATION share/${PROJECT_NAME}) | ||
install( | ||
DIRECTORY include/${PROJECT_NAME} | ||
DESTINATION include | ||
PATTERN "third_party" EXCLUDE) | ||
|
||
ament_export_dependencies(rosidl_default_runtime) | ||
ament_export_dependencies(eigen3_cmake_module) | ||
ament_export_dependencies(Eigen3) | ||
|
||
ament_package() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ | |
# Metadata | ||
########## | ||
|
||
Header header | ||
std_msgs/Header header | ||
|
||
# Control data | ||
############## | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ | |
# Metadata | ||
########## | ||
|
||
Header header | ||
std_msgs/Header header | ||
|
||
# Sensory data: | ||
############### | ||
|
Oops, something went wrong.