Skip to content

Commit

Permalink
hotfix: include patched JTC back
Browse files Browse the repository at this point in the history
  • Loading branch information
BarisYazici committed Nov 16, 2023
1 parent 3c3f29c commit 7ca51cd
Show file tree
Hide file tree
Showing 23 changed files with 6,931 additions and 10 deletions.
1 change: 0 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ RUN apt-get update && \
ros-humble-joint-state-broadcaster \
ros-humble-ament-cmake-clang-tidy \
libignition-gazebo6-dev \
ros-humble-joint-trajectory-controller \
libpoco-dev \
libeigen3-dev \
&& rm -rf /var/lib/apt/lists/*
Expand Down
10 changes: 1 addition & 9 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,7 @@
"bungcip.better-toml",
"ms-vscode.cpptools",
"ms-vscode.cpptools-extension-pack"
],
"settings": {
"terminal.integrated.defaultProfile.linux": "bash",
"terminal.integrated.profiles.linux": {
"bash": {
"path": "/bin/bash"
}
}
}
]
}
}
}
286 changes: 286 additions & 0 deletions joint_trajectory_controller/CHANGELOG.rst

Large diffs are not rendered by default.

122 changes: 122 additions & 0 deletions joint_trajectory_controller/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
cmake_minimum_required(VERSION 3.5)
project(joint_trajectory_controller)

if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra)
endif()

set(THIS_PACKAGE_INCLUDE_DEPENDS
angles
control_msgs
control_toolbox
controller_interface
generate_parameter_library
hardware_interface
pluginlib
rclcpp
rclcpp_lifecycle
realtime_tools
rsl
tl_expected
trajectory_msgs
)

find_package(ament_cmake REQUIRED)
find_package(backward_ros REQUIRED)
foreach(Dependency IN ITEMS ${THIS_PACKAGE_INCLUDE_DEPENDS})
find_package(${Dependency} REQUIRED)
endforeach()

generate_parameter_library(joint_trajectory_controller_parameters
src/joint_trajectory_controller_parameters.yaml
include/joint_trajectory_controller/validate_jtc_parameters.hpp
)

add_library(joint_trajectory_controller SHARED
src/joint_trajectory_controller.cpp
src/trajectory.cpp
)
target_compile_features(joint_trajectory_controller PUBLIC cxx_std_17)
target_include_directories(joint_trajectory_controller PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include/joint_trajectory_controller>
)
target_link_libraries(joint_trajectory_controller PUBLIC
joint_trajectory_controller_parameters
)
ament_target_dependencies(joint_trajectory_controller PUBLIC ${THIS_PACKAGE_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(joint_trajectory_controller PRIVATE "JOINT_TRAJECTORY_CONTROLLER_BUILDING_DLL" "_USE_MATH_DEFINES")
pluginlib_export_plugin_description_file(controller_interface joint_trajectory_plugin.xml)

if(BUILD_TESTING)
find_package(ament_cmake_gmock REQUIRED)
find_package(controller_manager REQUIRED)
find_package(ros2_control_test_assets REQUIRED)

ament_add_gmock(test_trajectory test/test_trajectory.cpp)
target_include_directories(test_trajectory PRIVATE include)
target_link_libraries(test_trajectory ${PROJECT_NAME})

ament_add_gmock(test_trajectory_controller
test/test_trajectory_controller.cpp
ENV config_file=${CMAKE_CURRENT_SOURCE_DIR}/test/config/test_joint_trajectory_controller.yaml)
set_tests_properties(test_trajectory_controller PROPERTIES TIMEOUT 220)
target_include_directories(test_trajectory_controller PRIVATE include)
target_link_libraries(test_trajectory_controller
${PROJECT_NAME}
)
ament_target_dependencies(test_trajectory_controller
${THIS_PACKAGE_INCLUDE_DEPENDS}
)

ament_add_gmock(
test_load_joint_trajectory_controller
test/test_load_joint_trajectory_controller.cpp
)
target_include_directories(test_load_joint_trajectory_controller PRIVATE include)
ament_target_dependencies(test_load_joint_trajectory_controller
controller_manager
control_toolbox
realtime_tools
ros2_control_test_assets
)

# TODO(andyz): Disabled due to flakiness
# ament_add_gmock(
# test_trajectory_actions
# test/test_trajectory_actions.cpp
# )
# target_include_directories(test_trajectory_actions PRIVATE include)
# target_link_libraries(test_trajectory_actions
# ${PROJECT_NAME}
# )
# ament_target_dependencies(test_trajectory_actions
# ${THIS_PACKAGE_INCLUDE_DEPENDS}
# )
endif()


install(
DIRECTORY include/
DESTINATION include/joint_trajectory_controller
)
install(TARGETS
joint_trajectory_controller
joint_trajectory_controller_parameters
EXPORT export_joint_trajectory_controller
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
)

ament_export_targets(export_joint_trajectory_controller HAS_LIBRARY_TARGET)
ament_export_dependencies(${THIS_PACKAGE_INCLUDE_DEPENDS})
ament_package()

10 changes: 10 additions & 0 deletions joint_trajectory_controller/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
**This package is from [this Pull Request](https://github.com/ros-controls/ros2_controllers/pull/558/).
This PR contains features to ensure that the current robot configuration is used as a goal when the JTC hasn't already been passed a goal**

# Original README

# joint_trajectory_controllers package

The package implements controllers to interpolate joint's trajectory.

For detailed documentation check the `docs` folder or [ros2_control documentation](https://ros-controls.github.io/control.ros.org/).
Loading

0 comments on commit 7ca51cd

Please sign in to comment.