-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d87c941
commit 3114b5a
Showing
55 changed files
with
234 additions
and
639 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
cmake_minimum_required(VERSION 3.16) | ||
project(ros2_control_demo_example_7 LANGUAGES CXX) | ||
|
||
if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)") | ||
add_compile_options(-Wall -Wextra) | ||
endif() | ||
|
||
# find dependencies | ||
set(HW_IF_INCLUDE_DEPENDS | ||
pluginlib | ||
rcpputils | ||
hardware_interface | ||
) | ||
set(REF_GEN_INCLUDE_DEPENDS | ||
kdl_parser | ||
rclcpp | ||
trajectory_msgs | ||
) | ||
set(CONTROLLER_INCLUDE_DEPENDS | ||
pluginlib | ||
rcpputils | ||
controller_interface | ||
realtime_tools | ||
trajectory_msgs | ||
) | ||
|
||
# find dependencies | ||
find_package(ament_cmake REQUIRED) | ||
foreach(Dependency IN ITEMS ${HW_IF_INCLUDE_DEPENDS}) | ||
find_package(${Dependency} REQUIRED) | ||
endforeach() | ||
foreach(Dependency IN ITEMS ${REF_GEN_INCLUDE_DEPENDS}) | ||
find_package(${Dependency} REQUIRED) | ||
endforeach() | ||
foreach(Dependency IN ITEMS ${CONTROLLER_INCLUDE_DEPENDS}) | ||
find_package(${Dependency} REQUIRED) | ||
endforeach() | ||
|
||
|
||
## COMPILE | ||
add_executable(send_trajectory reference_generator/send_trajectory.cpp) | ||
|
||
ament_target_dependencies( | ||
send_trajectory PUBLIC | ||
${REF_GEN_INCLUDE_DEPENDS} | ||
) | ||
|
||
add_library( | ||
ros2_control_demo_example_7 | ||
SHARED | ||
hardware/r6bot_hardware.cpp | ||
controller/r6bot_controller.cpp | ||
) | ||
|
||
target_compile_features(ros2_control_demo_example_7 PUBLIC cxx_std_17) | ||
target_include_directories(ros2_control_demo_example_7 PUBLIC | ||
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/hardware/include> | ||
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/controller/include> | ||
$<INSTALL_INTERFACE:include/ros2_control_demo_example_7> | ||
) | ||
ament_target_dependencies( | ||
ros2_control_demo_example_7 PUBLIC | ||
${HW_IF_INCLUDE_DEPENDS} | ||
${CONTROLLER_INCLUDE_DEPENDS} | ||
) | ||
|
||
# Causes the visibility macros to use dllexport rather than dllimport, | ||
# which is appropriate when building the dll but not consuming it. | ||
target_compile_definitions(${PROJECT_NAME} PRIVATE "ROS2_CONTROL_DEMO_EXAMPLE_7_BUILDING_DLL") | ||
|
||
# Export hardware plugins | ||
pluginlib_export_plugin_description_file(hardware_interface ros2_control_demo_example_7.xml) | ||
# Export controller plugins | ||
pluginlib_export_plugin_description_file(controller_interface ros2_control_demo_example_7.xml) | ||
|
||
# INSTALL | ||
install( | ||
DIRECTORY hardware/include/ | ||
DESTINATION include/ros2_control_demo_example_7 | ||
) | ||
install( | ||
DIRECTORY description/launch description/ros2_control description/urdf description/rviz description/srdf description/meshes | ||
DESTINATION share/ros2_control_demo_example_7 | ||
) | ||
install( | ||
DIRECTORY bringup/launch bringup/config | ||
DESTINATION share/ros2_control_demo_example_7 | ||
) | ||
|
||
install( | ||
TARGETS send_trajectory | ||
RUNTIME DESTINATION lib/ros2_control_demo_example_7 | ||
) | ||
|
||
install(TARGETS ros2_control_demo_example_7 | ||
EXPORT export_ros2_control_demo_example_7 | ||
ARCHIVE DESTINATION lib | ||
LIBRARY DESTINATION lib | ||
RUNTIME DESTINATION bin | ||
) | ||
|
||
if(BUILD_TESTING) | ||
find_package(ament_cmake_gtest REQUIRED) | ||
endif() | ||
|
||
## EXPORTS | ||
ament_export_targets(export_ros2_control_demo_example_7 HAS_LIBRARY_TARGET) | ||
ament_export_dependencies(${HW_IF_INCLUDE_DEPENDS} ${REF_GEN_INCLUDE_DEPENDS} ${CONTROLLER_INCLUDE_DEPENDS}) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# ros2_control_demo_example_7 | ||
|
||
A full tutorial for a 6 DOF robot for intermediate ROS 2 users. | ||
|
||
It consists of the following: | ||
* bringup: launch files and ros2_controller configuration | ||
* controller: a controller for the 6-DOF robot | ||
* description: the 6-DOF robot description | ||
* hardware: ros2_control hardware interface | ||
* reference_generator: A KDL-based reference generator for a fixed trajectory | ||
|
||
Find the documentation in [doc/userdoc.rst](doc/userdoc.rst) or on [control.ros.org](https://control.ros.org/master/doc/ros2_control_demos/example_7/doc/userdoc.html). |
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
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.