-
Notifications
You must be signed in to change notification settings - Fork 0
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 #4 from marip8/update/ros2-dev
Port to ROS2
- Loading branch information
Showing
12 changed files
with
141 additions
and
130 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
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,58 @@ | ||
cmake_minimum_required(VERSION 2.8.3) | ||
cmake_minimum_required(VERSION 3.5.0) | ||
project(trajectory_preview) | ||
|
||
add_compile_options(-std=c++11) | ||
|
||
find_package(catkin REQUIRED COMPONENTS rviz sensor_msgs trajectory_msgs) | ||
add_compile_options(-std=c++17) | ||
|
||
find_package(Qt5 REQUIRED COMPONENTS Widgets) | ||
|
||
catkin_package( | ||
INCLUDE_DIRS | ||
include | ||
LIBRARIES | ||
${PROJECT_NAME}_widget | ||
${PROJECT_NAME}_panel | ||
CATKIN_DEPENDS | ||
rviz | ||
sensor_msgs | ||
trajectory_msgs) | ||
set(ROS2_DEPS | ||
rviz_common | ||
sensor_msgs | ||
trajectory_msgs | ||
pluginlib) | ||
|
||
find_package(ament_cmake REQUIRED) | ||
foreach(dep ${ROS2_DEPS}) | ||
find_package(${dep} REQUIRED) | ||
endforeach() | ||
|
||
# ###################################################################################################################### | ||
# Build ## | ||
# ###################################################################################################################### | ||
|
||
include_directories(include ${catkin_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR}) | ||
|
||
qt5_wrap_ui(UI_MOC ui/trajectory_preview_widget.ui) | ||
|
||
qt5_wrap_cpp(WIDGET_MOC include/${PROJECT_NAME}/trajectory_preview_widget.h src/trajectory_preview_impl.h) | ||
|
||
qt5_wrap_cpp(PANEL_MOC include/${PROJECT_NAME}/trajectory_preview_panel.h) | ||
|
||
# Widget Library | ||
add_library(${PROJECT_NAME}_widget src/trajectory_preview_widget.cpp ${UI_MOC} ${WIDGET_MOC}) | ||
target_link_libraries(${PROJECT_NAME}_widget ${catkin_LIBRARIES} Qt5::Widgets) | ||
add_library(${PROJECT_NAME}_widget SHARED src/trajectory_preview_widget.cpp ${UI_MOC} ${WIDGET_MOC}) | ||
target_include_directories(${PROJECT_NAME}_widget PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>" | ||
"$<INSTALL_INTERFACE:include>") | ||
target_include_directories(${PROJECT_NAME}_widget PRIVATE "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>") | ||
target_link_libraries(${PROJECT_NAME}_widget Qt5::Widgets) | ||
ament_target_dependencies(${PROJECT_NAME}_widget ${ROS2_DEPS}) | ||
|
||
# Panel Library | ||
add_library(${PROJECT_NAME}_panel src/trajectory_preview_panel.cpp ${PANEL_MOC}) | ||
target_link_libraries( | ||
${PROJECT_NAME}_panel | ||
${catkin_LIBRARIES} | ||
Qt5::Widgets | ||
${PROJECT_NAME}_widget) | ||
add_library(${PROJECT_NAME}_panel SHARED src/trajectory_preview_panel.cpp ${PANEL_MOC}) | ||
target_link_libraries(${PROJECT_NAME}_panel Qt5::Widgets ${PROJECT_NAME}_widget) | ||
|
||
# ###################################################################################################################### | ||
# Install ## | ||
# ###################################################################################################################### | ||
|
||
install( | ||
TARGETS ${PROJECT_NAME}_widget ${PROJECT_NAME}_panel | ||
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} | ||
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} | ||
RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}) | ||
# Install the headers | ||
install(DIRECTORY include/${PROJECT_NAME} DESTINATION include) | ||
|
||
# Install the library(ies) | ||
install(TARGETS ${PROJECT_NAME}_widget ${PROJECT_NAME}_panel EXPORT ${PROJECT_NAME}-targets DESTINATION lib) | ||
|
||
install(FILES plugin_description.xml DESTINATION share/${PROJECT_NAME}) | ||
|
||
install(DIRECTORY launch DESTINATION share/${PROJECT_NAME}) | ||
|
||
pluginlib_export_plugin_description_file(rviz_common plugin_description.xml) | ||
|
||
install(DIRECTORY include/${PROJECT_NAME}/ DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}) | ||
install(DIRECTORY launch DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) | ||
install(FILES plugin_description.xml DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) | ||
ament_export_targets(${PROJECT_NAME}-targets HAS_LIBRARY_TARGET) | ||
ament_export_dependencies(${ROS2_DEPS}) | ||
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
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,18 +1,18 @@ | ||
<?xml version="1.0."?> | ||
<launch> | ||
<arg name="root_frame" doc="Root frame of the nominal TF tree, at which to connect the preview TF tree" /> | ||
<arg name="prefix" default="preview"/> | ||
<arg name="robot_description" description="Robot description string" /> | ||
<arg name="root_frame" description="Root frame of the nominal TF tree, at which to connect the preview TF tree" /> | ||
<arg name="preview_joint_states_topic" default="/preview"/> | ||
|
||
<node pkg="joint_state_publisher" type="joint_state_publisher" name="$(arg prefix)_joint_state_publisher"> | ||
<remap from="joint_states" to="$(arg prefix)/joint_states"/> | ||
<rosparam param="source_list">[trajectory/joint_states]</rosparam> | ||
<node pkg="joint_state_publisher" exec="joint_state_publisher" namespace="preview"> | ||
<param name="source_list" value="[$(var preview_joint_states_topic)]"/> | ||
</node> | ||
|
||
<node pkg="robot_state_publisher" type="robot_state_publisher" name="$(arg prefix)_robot_state_publisher"> | ||
<remap from="joint_states" to="$(arg prefix)/joint_states"/> | ||
<param name="tf_prefix" value="$(arg prefix)"/> | ||
<node pkg="robot_state_publisher" exec="robot_state_publisher" namespace="preview"> | ||
<param name="robot_description" value="$(var robot_description)"/> | ||
<param name="frame_prefix" value="preview/"/> | ||
</node> | ||
|
||
<node pkg="tf2_ros" type="static_transform_publisher" args="0 0 0 0 0 0 $(arg root_frame) preview/$(arg root_frame)" name="$(arg prefix)_static_tf2_pub"/> | ||
<node pkg="tf2_ros" exec="static_transform_publisher" args="0 0 0 0 0 0 $(var root_frame) preview/$(var root_frame)" namespace="preview"/> | ||
|
||
</launch> |
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
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
Oops, something went wrong.