Skip to content
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

Port to ROS 2 #45

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f543778
update for colcon compilation
anasarrak Feb 7, 2019
7d91d5a
Merge pull request #1 from anasarrak/melodic-devel
ahcorde Feb 7, 2019
66f2eb8
Updates to comply with ROS 2 policies
vmayoral Feb 10, 2019
545faef
Port to ROS 2
vmayoral Feb 14, 2019
6899dc8
Minor changes to clean up code
vmayoral Feb 24, 2019
57f652d
Merge remote-tracking branch 'moveit2/ros2' into ros2
vmayoral Feb 24, 2019
ff6f9b8
Apply clang format
vmayoral Feb 24, 2019
59c935b
Use [[deprecated]] for better portability (#47)
seanyen Mar 9, 2019
5c174e6
Solve dependencies for testing
vmayoral Apr 7, 2019
36911be
Remove old dependency, update with ROS 2 one
vmayoral Apr 7, 2019
9ead202
Remove more unnecessary dependencies
vmayoral Apr 7, 2019
10835d2
Fix library installation
ahcorde Apr 24, 2019
29bd50d
Merge pull request #2 from AcutronicRobotics/fix_libray_installation
Apr 24, 2019
735f746
Converting into a SHARED library
ahcorde Apr 25, 2019
bd36fe6
Merge pull request #3 from AcutronicRobotics/fix_libray_installation
vmayoral Apr 26, 2019
7ec1996
export needed urdf
anasarrak May 28, 2019
16ce0f7
Merge pull request #4 from AcutronicRobotics/fixes
ahcorde May 31, 2019
7d86751
formating style
anasarrak Jun 14, 2019
bcd8914
Update package.xml
anasarrak Jul 3, 2019
1aa2c6c
Update urdf header on model.h
anasarrak Jul 3, 2019
4d3dd0d
Revert back srdf_writer comment
anasarrak Jul 3, 2019
23703b2
Merge branch 'ros2' into ros2
anasarrak Jul 3, 2019
5f2761e
Adding gtest fix to CMakelists
anasarrak Jul 3, 2019
9243d92
Update model.h
anasarrak Jul 3, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 43 additions & 29 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,57 +1,63 @@
cmake_minimum_required(VERSION 2.8.3)
cmake_minimum_required(VERSION 3.5)
project(srdfdom)

find_package(Boost REQUIRED)
# Default to C++14
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(Boost REQUIRED)
find_package(console_bridge REQUIRED)
find_package(urdfdom_headers REQUIRED)
find_package(ament_cmake REQUIRED)
find_package(urdf REQUIRED)
find_package(tinyxml_vendor REQUIRED)

find_package(catkin REQUIRED COMPONENTS cmake_modules urdf urdfdom_py)

find_package(TinyXML REQUIRED)

include_directories(
include
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
${urdf_INCLUDE_DIRS}
${std_msgs_INCLUDE_DIRS}
)

add_library(${PROJECT_NAME}
add_library(${PROJECT_NAME} SHARED
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
urdf
)

ament_export_libraries(${PROJECT_NAME})
ament_export_include_directories(include)

install(TARGETS ${PROJECT_NAME}
DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
DESTINATION lib
)
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
DESTINATION include/${PROJECT_NAME}
FILES_MATCHING PATTERN "*.h"
)

install(PROGRAMS
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_gtest REQUIRED)
ament_add_gtest(test_parser test/srdf_parser.test)

add_definitions(-DTEST_RESOURCE_LOCATION="${CMAKE_SOURCE_DIR}/test/resources")
execute_process(COMMAND bash -c "locale -a | grep -q ^nl_NL"
Expand All @@ -61,6 +67,14 @@ if(CATKIN_ENABLE_TESTING)
message(WARNING "Locale nl_NL not available. Locale test will not be meaningful.")
endif()

add_rostest_gtest(test_cpp test/srdf_parser_cpp.test test/test_parser.cpp)
ament_add_gtest(test_cpp test/srdf_parser_cpp.test test/test_parser.cpp)
target_link_libraries(test_cpp ${catkin_LIBRARIES} ${PROJECT_NAME})
endif()

ament_export_include_directories(include)
ament_export_libraries(${PROJECT_NAME})
ament_export_dependencies(tinyxml_vendor)
ament_export_dependencies(console_bridge)
ament_export_dependencies(urdfdom_headers)
ament_export_dependencies(urdf)
ament_package()
6 changes: 3 additions & 3 deletions include/srdfdom/model.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include <string>
#include <vector>
#include <utility>
#include <urdf/model.h> // TODO: replace with urdf_model/types.h in Lunar
#include <urdf/model.h>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this TODO by @rhaschke should be addressed per the original PR:
#27

#include <memory>
#include <tinyxml.h>

Expand Down Expand Up @@ -209,7 +209,7 @@ class Model
}

/// \deprecated{ Use the version returning DisabledCollision }
__attribute__((deprecated)) std::vector<std::pair<std::string, std::string> > getDisabledCollisions() const;
[[deprecated]] std::vector<std::pair<std::string, std::string> > getDisabledCollisions() const;

/// Get the list of groups defined for this model
const std::vector<Group>& getGroups() const
Expand Down Expand Up @@ -270,5 +270,5 @@ class Model
};
typedef std::shared_ptr<Model> ModelSharedPtr;
typedef std::shared_ptr<const Model> ModelConstSharedPtr;
}
} // namespace srdf
#endif
2 changes: 1 addition & 1 deletion include/srdfdom/srdf_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,6 @@ class SRDFWriter
// Typedef
// ******************************************************************************************
typedef std::shared_ptr<SRDFWriter> SRDFWriterPtr;
}
} // namespace srdf

#endif
29 changes: 16 additions & 13 deletions package.xml
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
<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>
<author email="[email protected]">Ioan Sucan</author>
<author email="[email protected]">Guillaume Walck</author>

<maintainer email="[email protected]">Dave Coleman</maintainer>maintainer>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im happy to be removed as a maintainer. notably, the XML appears broken for some reason

<maintainer email="[email protected]">Isaac I. Y. Saito</maintainer>maintainer>
<license>BSD</license>
<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>
<build_depend>boost</build_depend>
<build_depend>cmake_modules</build_depend>
<build_depend>libconsole-bridge-dev</build_depend>
<build_depend>urdf</build_depend>
<build_depend>liburdfdom-headers-dev</build_depend>
<build_depend>urdfdom_headers</build_depend>
<build_depend>urdfdom_py</build_depend>
<build_depend>tinyxml</build_depend>
<build_depend>urdf</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>

<test_depend>rostest</test_depend>
<exec_depend>urdf</exec_depend>
<exec_depend>boost</exec_depend>
<exec_depend>libconsole-bridge-dev</exec_depend>
<exec_depend>tinyxml</exec_depend>
<exec_depend>urdfdom_py</exec_depend>

<test_depend>ament_cmake_gtest</test_depend>
<export>
<build_type>ament_cmake</build_type>
</export>
</package>
2 changes: 1 addition & 1 deletion src/srdf_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,4 +436,4 @@ void SRDFWriter::createPassiveJointsXML(TiXmlElement* root)
root->LinkEndChild(p_joint);
}
}
}
} // namespace srdf