Add action server implementation (#323)
* Implement action server init, fini, and is_valid functions * Add macros for initializing services and publishers * Implement rcl_action_server_get_default_options() * Implement rcl_action_accept_new_goal() * Add function, rcl_action_server_goal_exists(), for checking if goal is already being tracked by an action server * Add unit tests * Implement rcl_action_server_get_goal_handles() * Implement rcl_action_server_get_options() * Implement rcl_action_server_get_action_name() * Implement rcl_action_get_goal_status_array() * Bugfix: reset pointers and size in type finalize functions Also let finalize functions be called on already finalized objects * Implement send/take functions for action server services * Implement action server publishers for feedback and status * Implement rcl_action_process_cancel_request() * Add partial communication tests * Define UUID_SIZE * Use type-erased pointer for rcl_action_publish_status() * Implement rcl_action_clear_expired_goals() Introduce rcl_clock_t to action server implementation. * Change internal goal handle array to be an array of pointers. * Add check for invalid action names * Do heap allocation of temporary array to satisfy MSVC compiler * Bugfix: finalize node in test tear downs and reset expected errors * Update documentation * Update package.xml * Pass in rcl_clock_t to action server Rather than initializing internally. * Do not finalize goal handles in expire function Instead, leave it up to the caller to finalize goal handles. Renamed the function to rcl_action_expire_goals.
This commit is contained in:
parent
d86d1c4135
commit
acc974e43b
11 changed files with 1879 additions and 94 deletions
|
@ -4,8 +4,11 @@ project(rcl_action)
|
|||
|
||||
find_package(ament_cmake_ros REQUIRED)
|
||||
|
||||
find_package(rosidl_generator_c REQUIRED)
|
||||
find_package(action_msgs REQUIRED)
|
||||
find_package(rcl REQUIRED)
|
||||
find_package(rcutils REQUIRED)
|
||||
find_package(rmw REQUIRED)
|
||||
|
||||
include_directories(
|
||||
include
|
||||
|
@ -33,6 +36,7 @@ add_executable(test_compile_headers
|
|||
|
||||
set(rcl_action_sources
|
||||
src/${PROJECT_NAME}/action_client.c
|
||||
src/${PROJECT_NAME}/action_server.c
|
||||
src/${PROJECT_NAME}/goal_handle.c
|
||||
src/${PROJECT_NAME}/goal_state_machine.c
|
||||
src/${PROJECT_NAME}/names.c
|
||||
|
@ -49,8 +53,11 @@ add_library(${PROJECT_NAME}
|
|||
)
|
||||
|
||||
ament_target_dependencies(${PROJECT_NAME}
|
||||
"rcl"
|
||||
"rosidl_generator_c"
|
||||
"action_msgs"
|
||||
"rmw"
|
||||
"rcutils"
|
||||
"rcl"
|
||||
)
|
||||
# Causes the visibility macros to use dllexport rather than dllimport,
|
||||
# which is appropriate when building the dll but not consuming it.
|
||||
|
@ -68,6 +75,7 @@ install(TARGETS ${PROJECT_NAME}
|
|||
)
|
||||
|
||||
if(BUILD_TESTING)
|
||||
find_package(test_msgs REQUIRED)
|
||||
find_package(ament_cmake_gtest REQUIRED)
|
||||
find_package(ament_lint_auto REQUIRED)
|
||||
find_package(test_msgs REQUIRED)
|
||||
|
@ -86,6 +94,34 @@ if(BUILD_TESTING)
|
|||
)
|
||||
ament_target_dependencies(test_action_client "rcl" "test_msgs")
|
||||
endif()
|
||||
ament_add_gtest(test_action_communication
|
||||
test/rcl_action/test_action_communication.cpp
|
||||
)
|
||||
if(TARGET test_action_communication)
|
||||
target_include_directories(test_action_communication PUBLIC
|
||||
include
|
||||
${rcl_INCLUDE_DIRS}
|
||||
${test_msgs_INCLUDE_DIRS}
|
||||
)
|
||||
target_link_libraries(test_action_communication
|
||||
${PROJECT_NAME}
|
||||
)
|
||||
ament_target_dependencies(test_action_communication "test_msgs")
|
||||
endif()
|
||||
ament_add_gtest(test_action_server
|
||||
test/rcl_action/test_action_server.cpp
|
||||
)
|
||||
if(TARGET test_action_server)
|
||||
target_include_directories(test_action_server PUBLIC
|
||||
include
|
||||
${rcl_INCLUDE_DIRS}
|
||||
${test_msgs_INCLUDE_DIRS}
|
||||
)
|
||||
target_link_libraries(test_action_server
|
||||
${PROJECT_NAME}
|
||||
)
|
||||
ament_target_dependencies(test_action_server "test_msgs")
|
||||
endif()
|
||||
ament_add_gtest(test_goal_handle
|
||||
test/rcl_action/test_goal_handle.cpp
|
||||
)
|
||||
|
@ -139,5 +175,8 @@ ament_export_include_directories(include)
|
|||
ament_export_libraries(${PROJECT_NAME})
|
||||
ament_export_dependencies(ament_cmake)
|
||||
ament_export_dependencies(rcl)
|
||||
ament_export_dependencies(rcutils)
|
||||
ament_export_dependencies(rmw)
|
||||
ament_export_dependencies(action_msgs)
|
||||
ament_export_dependencies(rosidl_generator_c)
|
||||
ament_package()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue