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

Migration of rviz_tool_path_display from ROS 1 to ROS 2 #4

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
61 changes: 46 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,27 +1,58 @@
cmake_minimum_required(VERSION 2.8.3)
cmake_minimum_required(VERSION 3.5)
project(rviz_tool_path_display)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Default to C99
if(NOT CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 99)
endif()

find_package(Qt5 REQUIRED COMPONENTS Widgets)
find_package(catkin REQUIRED COMPONENTS rviz pluginlib)
# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()

catkin_package(CATKIN_DEPENDS rviz pluginlib)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

include_directories(${catkin_INCLUDE_DIRS})
set(CMAKE_AUTOMOC ON)

find_package(ament_cmake REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(pluginlib REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rviz_common REQUIRED)

qt5_wrap_cpp(MOC_FILES src/rviz_tool_path_display.h)
add_library(${PROJECT_NAME} src/rviz_tool_path_display.cpp ${MOC_FILES})
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} Qt5::Widgets)
add_library(${PROJECT_NAME} SHARED src/rviz_tool_path_display.cpp ${MOC_FILES})

target_include_directories(${PROJECT_NAME} PUBLIC
${OGRE_INCLUDE_DIRS}
)

target_link_libraries(${PROJECT_NAME}
rviz_common::rviz_common
)

pluginlib_export_plugin_description_file(rviz_common plugin_description.xml)

ament_target_dependencies(${PROJECT_NAME} rviz_common pluginlib)
ament_export_targets(${PROJECT_NAME} HAS_LIBRARY_TARGET)
ament_export_dependencies(
rviz_common
geometry_msgs
rclcpp
pluginlib
)

install(
TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION})
EXPORT ${PROJECT_NAME}
DESTINATION lib
)

install(DIRECTORY icons DESTINATION include/${PROJECT_NAME}/)

install(DIRECTORY icons DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
install(FILES plugin_description.xml DESTINATION share/${PROJECT_NAME}/)

install(FILES plugin_description.xml DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
ament_package()
14 changes: 7 additions & 7 deletions package.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<?xml version="1.0"?>
<package format="2">
<package format="3">
<name>rviz_tool_path_display</name>
<version>0.1.1</version>
<version>1.0.0</version>
<description>The rviz_tool_path_display package</description>

<maintainer email="michael.ripperger@swri.org">Michael Ripperger</maintainer>
<author email="michael.ripperger@swri.org">Michael Ripperger</author>
<license>Apache 2.0</license>

<buildtool_depend>catkin</buildtool_depend>
<depend>rviz</depend>
<buildtool_depend>ament_cmake</buildtool_depend>
<depend>rclcpp</depend>
<depend>rviz_common</depend>
<depend>pluginlib</depend>
<build_depend>qtbase5-dev</build_depend>
<depend>libqt5-widgets</depend>
<depend>geometry_msgs</depend>

<export>
<rviz plugin="${prefix}/plugin_description.xml"/>
<build_type>ament_cmake</build_type>
</export>
</package>
9 changes: 6 additions & 3 deletions plugin_description.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<?xml version="1.0"?>
<library path="lib/librviz_tool_path_display">
<class name="rviz_tool_path_display/ToolPath" type="rviz::ToolPathDisplay" base_class_type="rviz::Display">
<library path="rviz_tool_path_display">
<class
name="rviz_tool_path_display/ToolPath"
type="rviz_common::ToolPathDisplay"
base_class_type="rviz_common::Display">
<description>
Rviz display for visualizing tool paths
</description>
<message_type>geometry_msgs/msg/PoseArray</message_type>
</class>
</library>
Loading