-
Notifications
You must be signed in to change notification settings - Fork 68
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 #48
ROS2 port #48
Changes from all commits
27cd1d9
9cf1b24
d2a2a12
3daf790
8549826
47ef93e
f32c5e9
efc6f39
e8d055c
dde1989
eb9adfa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
build | ||
__pycache__ | ||
*.pyc |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,91 @@ | ||
cmake_minimum_required(VERSION 2.8.3) | ||
cmake_minimum_required(VERSION 3.5) | ||
project(srdfdom) | ||
|
||
find_package(Boost REQUIRED) | ||
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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These shouldn't be part of a CMakeLists file, but rather defined by the user. |
||
endif() | ||
|
||
find_package(ament_cmake REQUIRED) | ||
find_package(console_bridge_vendor REQUIRED) # Provides console_bridge 0.4.0 on platforms without it. | ||
find_package(console_bridge REQUIRED) | ||
find_package(urdfdom_headers REQUIRED) | ||
find_package(urdf REQUIRED) | ||
find_package(tinyxml_vendor REQUIRED) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What are these |
||
find_package(TinyXML REQUIRED) # provided by tinyxml_vendor | ||
find_package(ament_index_cpp REQUIRED) | ||
|
||
find_package(catkin REQUIRED COMPONENTS cmake_modules urdf urdfdom_py) | ||
|
||
find_package(TinyXML REQUIRED) | ||
find_package(Boost REQUIRED) | ||
|
||
include_directories( | ||
include | ||
${rclcpp_INCLUDE_DIRS} | ||
${rmw_implementation_INCLUDE_DIRS} | ||
${Boost_INCLUDE_DIR} | ||
${TinyXML_INCLUDE_DIRS} | ||
${catkin_INCLUDE_DIRS} | ||
${console_bridge_INCLUDE_DIRS} | ||
${urdfdom_headers_INCLUDE_DIRS} | ||
) | ||
|
||
add_compile_options(-std=c++11) | ||
|
||
catkin_python_setup() | ||
|
||
catkin_package( | ||
LIBRARIES ${PROJECT_NAME} | ||
INCLUDE_DIRS include | ||
DEPENDS TinyXML console_bridge urdfdom_headers | ||
${std_msgs_INCLUDE_DIRS} | ||
) | ||
|
||
add_library(${PROJECT_NAME} | ||
ament_python_install_package(${PROJECT_NAME} | ||
PACKAGE_DIR src/${PROJECT_NAME}) | ||
|
||
add_library(${PROJECT_NAME} | ||
src/model.cpp | ||
src/srdf_writer.cpp | ||
) | ||
target_link_libraries(${PROJECT_NAME} ${TinyXML_LIBRARIES} ${catkin_LIBRARIES} ${console_bridge_LIBRARIES} ${urdfdom_headers_LIBRARIES}) | ||
|
||
ament_target_dependencies(${PROJECT_NAME} | ||
${TinyXML_LIBRARIES} | ||
${console_bridge_LIBRARIES} | ||
${urdfdom_headers_LIBRARIES} | ||
${urdf_LIBRARIES} | ||
) | ||
|
||
install(TARGETS ${PROJECT_NAME} | ||
DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} | ||
install( | ||
TARGETS | ||
${PROJECT_NAME} | ||
DESTINATION lib | ||
) | ||
|
||
install(DIRECTORY include/${PROJECT_NAME}/ | ||
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} | ||
FILES_MATCHING PATTERN "*.h" | ||
DESTINATION include/${PROJECT_NAME} | ||
) | ||
|
||
install(PROGRAMS | ||
# Mark resources for installation | ||
install(DIRECTORY test/resources | ||
DESTINATION share/${PROJECT_NAME} | ||
) | ||
|
||
install(PROGRAMS | ||
scripts/display_srdf | ||
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} | ||
DESTINATION lib/${PROJECT_NAME} | ||
) | ||
|
||
if(CATKIN_ENABLE_TESTING) | ||
find_package(rostest REQUIRED) | ||
add_rostest(test/srdf_parser.test) | ||
if(BUILD_TESTING) | ||
find_package(ament_cmake_pytest REQUIRED) | ||
find_package(ament_cmake_gtest REQUIRED) | ||
|
||
add_definitions(-DTEST_RESOURCE_LOCATION="${CMAKE_SOURCE_DIR}/test/resources") | ||
execute_process(COMMAND bash -c "locale -a | grep -q ^nl_NL" | ||
RESULT_VARIABLE TEST_LOCALE | ||
OUTPUT_QUIET ERROR_QUIET) | ||
if (TEST_LOCALE) | ||
message(WARNING "Locale nl_NL not available. Locale test will not be meaningful.") | ||
endif() | ||
ament_add_gtest(test_parser test/test_parser.cpp) | ||
target_link_libraries(test_parser | ||
${PROJECT_NAME} | ||
${rclcpp_LIBRARIES} | ||
${TinyXML_LIBRARIES} | ||
${console_bridge_LIBRARIES} | ||
${urdfdom_headers_LIBRARIES} | ||
${urdf_LIBRARIES} | ||
ament_index_cpp::ament_index_cpp | ||
) | ||
|
||
add_rostest_gtest(test_cpp test/srdf_parser_cpp.test test/test_parser.cpp) | ||
target_link_libraries(test_cpp ${catkin_LIBRARIES} ${PROJECT_NAME}) | ||
# python tests with python interfaces of message filters | ||
find_package(ament_cmake_pytest REQUIRED) | ||
ament_add_pytest_test(test.py "test/test.py" | ||
APPEND_ENV PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR} | ||
TIMEOUT 90) | ||
endif() | ||
|
||
ament_package() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
<package> | ||
<?xml version="1.0"?> | ||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> | ||
<package format="3"> | ||
<name>srdfdom</name> | ||
<version>0.5.1</version> | ||
<description>Parser for Semantic Robot Description Format (SRDF).</description> | ||
|
@@ -10,23 +12,32 @@ | |
<url type="website">http://ros.org/wiki/srdfdom</url> | ||
<url type="bugtracker">https://github.com/ros-planning/srdfdom/issues</url> | ||
<url type="repository">https://github.com/ros-planning/srdfdom</url> | ||
|
||
<buildtool_depend>catkin</buildtool_depend> | ||
|
||
<buildtool_depend>ament_cmake</buildtool_depend> | ||
|
||
<buildtool_depend>python_cmake_module</buildtool_depend> | ||
|
||
<depend>console_bridge_vendor</depend> | ||
|
||
<build_depend>boost</build_depend> | ||
<build_depend>cmake_modules</build_depend> | ||
<build_depend>python_cmake_module</build_depend> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cmake_modules wasn't related to python in ROS1. Do you really need this package? What does it do? |
||
<build_depend>libconsole-bridge-dev</build_depend> | ||
<build_depend>urdf</build_depend> | ||
<build_depend>liburdfdom-headers-dev</build_depend> | ||
<build_depend>urdfdom_py</build_depend> | ||
<build_depend>tinyxml</build_depend> | ||
|
||
<run_depend>boost</run_depend> | ||
<run_depend>libconsole-bridge-dev</run_depend> | ||
<run_depend>liburdfdom-headers-dev</run_depend> | ||
<run_depend>tinyxml</run_depend> | ||
<run_depend>urdfdom_py</run_depend> | ||
<exec_depend>boost</exec_depend> | ||
<exec_depend>libconsole-bridge-dev</exec_depend> | ||
<exec_depend>liburdfdom-headers-dev</exec_depend> | ||
<exec_depend>tinyxml</exec_depend> | ||
<exec_depend>urdfdom_py</exec_depend> | ||
|
||
<test_depend>rostest</test_depend> | ||
<test_depend>ament_index_cpp</test_depend> | ||
<test_depend>ament_cmake_pytest</test_depend> | ||
<test_depend>python3-pytest</test_depend> | ||
|
||
<export> | ||
<build_type>ament_cmake</build_type> | ||
</export> | ||
</package> |
This file was deleted.
This file was deleted.
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.
One
--branch ros2
is sufficient 😉