-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ROS2] Port kindr_ros and kindr_msgs #26
Open
SivertHavso
wants to merge
8
commits into
ANYbotics:ros2
Choose a base branch
from
SivertHavso:galactic
base: ros2
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
51b18ec
Lint kindr_ros and kindr_msgs
SivertHavso f022c41
Use tf2 instead of tf
SivertHavso 1dea2a6
Update to package.xml format 3
SivertHavso 03858ce
Update kindr_msgs package.xml format
SivertHavso 0a5b5e8
Replace catkin with ament_cmake
SivertHavso b3a6e9b
Port kindr_ros to ROS2
SivertHavso 250f0e0
Remove unused but set variables
SivertHavso af5667c
Fix formatting
SivertHavso File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,163 +1,17 @@ | ||
cmake_minimum_required(VERSION 3.5.1) | ||
project(kindr_msgs) | ||
|
||
## Find catkin macros and libraries | ||
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) | ||
## is used, also find other catkin packages | ||
find_package(catkin REQUIRED COMPONENTS | ||
message_generation | ||
geometry_msgs | ||
std_msgs | ||
) | ||
|
||
## System dependencies are found with CMake's conventions | ||
# find_package(Boost REQUIRED COMPONENTS system) | ||
|
||
|
||
## Uncomment this if the package has a setup.py. This macro ensures | ||
## modules and global scripts declared therein get installed | ||
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html | ||
# catkin_python_setup() | ||
find_package(ament_cmake_auto) | ||
ament_auto_find_build_dependencies() | ||
|
||
################################################ | ||
## Declare ROS messages, services and actions ## | ||
################################################ | ||
|
||
## To declare and build messages, services or actions from within this | ||
## package, follow these steps: | ||
## * Let MSG_DEP_SET be the set of packages whose message types you use in | ||
## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...). | ||
## * In the file package.xml: | ||
## * add a build_depend and a run_depend tag for each package in MSG_DEP_SET | ||
## * If MSG_DEP_SET isn't empty the following dependencies might have been | ||
## pulled in transitively but can be declared for certainty nonetheless: | ||
## * add a build_depend tag for "message_generation" | ||
## * add a run_depend tag for "message_runtime" | ||
## * In this file (CMakeLists.txt): | ||
## * add "message_generation" and every package in MSG_DEP_SET to | ||
## find_package(catkin REQUIRED COMPONENTS ...) | ||
## * add "message_runtime" and every package in MSG_DEP_SET to | ||
## catkin_package(CATKIN_DEPENDS ...) | ||
## * uncomment the add_*_files sections below as needed | ||
## and list every .msg/.srv/.action file to be processed | ||
## * uncomment the generate_messages entry below | ||
## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...) | ||
|
||
## Generate messages in the 'msg' folder | ||
add_message_files( | ||
FILES | ||
VectorAtPosition.msg | ||
rosidl_generate_interfaces(${PROJECT_NAME} | ||
"msg/VectorAtPosition.msg" | ||
ADD_LINTER_TESTS | ||
) | ||
|
||
## Generate services in the 'srv' folder | ||
# add_service_files( | ||
# FILES | ||
# Service1.srv | ||
# Service2.srv | ||
# ) | ||
|
||
## Generate actions in the 'action' folder | ||
# add_action_files( | ||
# FILES | ||
# Action1.action | ||
# Action2.action | ||
# ) | ||
|
||
## Generate added messages and services with any dependencies listed here | ||
generate_messages( | ||
DEPENDENCIES | ||
geometry_msgs | ||
std_msgs | ||
) | ||
|
||
################################### | ||
## catkin specific configuration ## | ||
################################### | ||
## The catkin_package macro generates cmake config files for your package | ||
## Declare things to be passed to dependent projects | ||
## INCLUDE_DIRS: uncomment this if you package contains header files | ||
## LIBRARIES: libraries you create in this project that dependent projects also need | ||
## CATKIN_DEPENDS: catkin_packages dependent projects also need | ||
## DEPENDS: system dependencies of this project that dependent projects also need | ||
catkin_package( | ||
# INCLUDE_DIRS include | ||
# LIBRARIES kindr_msgs | ||
CATKIN_DEPENDS message_runtime geometry_msgs std_msgs | ||
# DEPENDS system_lib | ||
) | ||
|
||
########### | ||
## Build ## | ||
########### | ||
|
||
## Specify additional locations of header files | ||
## Your package locations should be listed before other locations | ||
# include_directories(include) | ||
include_directories( | ||
${catkin_INCLUDE_DIRS} | ||
) | ||
|
||
## Declare a cpp library | ||
# add_library(kindr_msgs | ||
# src/${PROJECT_NAME}/kindr_msgs.cpp | ||
# ) | ||
|
||
## Declare a cpp executable | ||
# add_executable(kindr_msgs_node src/kindr_msgs_node.cpp) | ||
|
||
## Add cmake target dependencies of the executable/library | ||
## as an example, message headers may need to be generated before nodes | ||
# add_dependencies(kindr_msgs_node kindr_msgs_generate_messages_cpp) | ||
|
||
## Specify libraries to link a library or executable target against | ||
# target_link_libraries(kindr_msgs_node | ||
# ${catkin_LIBRARIES} | ||
# ) | ||
|
||
############# | ||
## Install ## | ||
############# | ||
|
||
# all install targets should use catkin DESTINATION variables | ||
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html | ||
|
||
## Mark executable scripts (Python etc.) for installation | ||
## in contrast to setup.py, you can choose the destination | ||
# install(PROGRAMS | ||
# scripts/my_python_script | ||
# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} | ||
# ) | ||
|
||
## Mark executables and/or libraries for installation | ||
# install(TARGETS kindr_msgs kindr_msgs_node | ||
# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} | ||
# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} | ||
# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} | ||
# ) | ||
|
||
## Mark cpp header files for installation | ||
# install(DIRECTORY include/${PROJECT_NAME}/ | ||
# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} | ||
# FILES_MATCHING PATTERN "*.h" | ||
# PATTERN ".svn" EXCLUDE | ||
# ) | ||
|
||
## Mark other files for installation (e.g. launch and bag files, etc.) | ||
# install(FILES | ||
# # myfile1 | ||
# # myfile2 | ||
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} | ||
# ) | ||
|
||
############# | ||
## Testing ## | ||
############# | ||
|
||
## Add gtest based cpp test target and link libraries | ||
# catkin_add_gtest(${PROJECT_NAME}-test test/test_kindr_msgs.cpp) | ||
# if(TARGET ${PROJECT_NAME}-test) | ||
# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME}) | ||
# endif() | ||
if(BUILD_TESTING) | ||
find_package(ament_lint_auto REQUIRED) | ||
ament_lint_auto_find_test_dependencies() | ||
endif() | ||
|
||
## Add folders to be run by python nosetests | ||
# catkin_add_nosetests(test) | ||
ament_auto_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 |
---|---|---|
@@ -1,21 +1,32 @@ | ||
<?xml version="1.0"?> | ||
<package> | ||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> | ||
<package format="3"> | ||
<name>kindr_msgs</name> | ||
<version>0.3.4</version> | ||
<description>Kindr common msgs</description> | ||
<maintainer email="[email protected]">Remo Diethelm</maintainer> | ||
<maintainer email="[email protected]">Philipp Leemann</maintainer> | ||
<author email="[email protected]">Peter Fankhauser</author> | ||
|
||
<license>BSD</license> | ||
<url>https://github.com/anybotics/kindr_ros</url> | ||
<buildtool_depend>catkin</buildtool_depend> | ||
<url type="website">https://github.com/anybotics/kindr_ros</url> | ||
|
||
<author email="[email protected]">Peter Fankhauser</author> | ||
|
||
<build_depend>message_generation</build_depend> | ||
<buildtool_depend>ament_cmake_auto</buildtool_depend> | ||
|
||
<build_depend>rosidl_default_generators</build_depend> | ||
<build_depend>geometry_msgs</build_depend> | ||
<build_depend>std_msgs</build_depend> | ||
|
||
<run_depend>message_runtime</run_depend> | ||
<run_depend>geometry_msgs</run_depend> | ||
<run_depend>std_msgs</run_depend> | ||
<exec_depend>rosidl_default_runtime</exec_depend> | ||
<exec_depend>geometry_msgs</exec_depend> | ||
<exec_depend>std_msgs</exec_depend> | ||
|
||
<test_depend>ament_lint_auto</test_depend> | ||
|
||
<member_of_group>rosidl_interface_packages</member_of_group> | ||
|
||
<export> | ||
<build_type>ament_cmake</build_type> | ||
</export> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,68 @@ | ||
cmake_minimum_required(VERSION 3.5.1) | ||
cmake_minimum_required(VERSION 3.5) | ||
project(kindr_ros) | ||
|
||
add_definitions(-std=c++11) | ||
|
||
find_package(catkin REQUIRED COMPONENTS | ||
geometry_msgs tf | ||
) | ||
|
||
# Attempt to find catkinized kindr | ||
find_package(kindr QUIET) | ||
if(NOT kindr_FOUND) | ||
# Attempt to find package-based kindr | ||
find_package(PkgConfig REQUIRED) | ||
pkg_check_modules(kindr kindr REQUIRED) | ||
# Use C++14 standard | ||
if(NOT CMAKE_CXX_STANDARD) | ||
set(CMAKE_CXX_STANDARD 14) | ||
endif() | ||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||
add_compile_options(-Wall -Wextra -Wpedantic) | ||
endif() | ||
|
||
find_package(ament_cmake REQUIRED) | ||
find_package(tf2 REQUIRED) | ||
find_package(geometry_msgs REQUIRED) | ||
find_package(kindr REQUIRED) | ||
|
||
find_package(eigen3_cmake_module REQUIRED) | ||
find_package(Eigen3 REQUIRED) | ||
|
||
catkin_package( | ||
INCLUDE_DIRS include ${EIGEN3_INCLUDE_DIR} | ||
# LIBRARIES kindr_ros | ||
CATKIN_DEPENDS geometry_msgs tf | ||
DEPENDS kindr | ||
set(dependencies | ||
eigen3_cmake_module | ||
Eigen3 | ||
tf2 | ||
geometry_msgs | ||
) | ||
|
||
include_directories(include) | ||
include_directories(${catkin_INCLUDE_DIRS}) | ||
include_directories(${EIGEN3_INCLUDE_DIR}) | ||
include_directories(${kindr_INCLUDE_DIRS}) | ||
install(DIRECTORY include/${PROJECT_NAME}/ | ||
DESTINATION include/${PROJECT_NAME}) | ||
|
||
if(BUILD_TESTING) | ||
find_package(ament_lint_auto REQUIRED) | ||
|
||
############# | ||
## Testing ## | ||
############# | ||
ament_lint_auto_find_test_dependencies() | ||
|
||
if(CATKIN_ENABLE_TESTING) | ||
catkin_add_gtest(${PROJECT_NAME}-test | ||
find_package(ament_cmake_gtest REQUIRED) | ||
|
||
ament_add_gtest(${PROJECT_NAME}-test | ||
test/test_main.cpp | ||
test/RosGeometryMsgPhysicalQuantitiesTest.cpp | ||
test/RosGeometryMsgRotationTest.cpp | ||
test/RosGeometryMsgPoseTest.cpp | ||
test/RosTfPoseTest.cpp | ||
test/TfConventionTest.cpp | ||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/test | ||
) | ||
) | ||
|
||
if(TARGET ${PROJECT_NAME}-test) | ||
target_link_libraries(${PROJECT_NAME}-test ${catkin_LIBRARIES}) | ||
find_package(cmake_code_coverage QUIET) | ||
if(cmake_code_coverage_FOUND) | ||
add_gtest_coverage(TEST_BUILD_TARGETS ${PROJECT_NAME}-test) | ||
endif(cmake_code_coverage_FOUND) | ||
target_include_directories(${PROJECT_NAME}-test PUBLIC | ||
include | ||
${EIGEN3_INCLUDE_DIRS}) | ||
ament_target_dependencies(${PROJECT_NAME}-test | ||
${dependencies} | ||
) | ||
# TODO(SivertHavso): add back code coverage: | ||
# find_package(cmake_code_coverage QUIET) | ||
# if(cmake_code_coverage_FOUND) | ||
# add_gtest_coverage(TEST_BUILD_TARGETS ${PROJECT_NAME}-test) | ||
# endif() | ||
endif() | ||
endif() | ||
|
||
install(DIRECTORY include/${PROJECT_NAME}/ | ||
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} | ||
) | ||
ament_export_include_directories(include) | ||
|
||
ament_export_dependencies( | ||
${dependencies} | ||
) | ||
|
||
ament_package() |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this something you intended to do before merging the MR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will have to wait until I've finished porting the elevation_mapping package. I'd say merge it now since it "only" affects quality assurance and not the API or ABI. The tests themself still run and there shouldn't be a notable difference in code coverage between the ROS1 and ROS2 branch for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, why is this a dependency of the porting of
elevation_mapping
? This is a downstream dependency, right?