-
Notifications
You must be signed in to change notification settings - Fork 182
Add Action graph API #411
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
Merged
Merged
Add Action graph API #411
Changes from 7 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
2fb614e
Add action graph API
jacobperron 6207578
Enable multiple rmw action graph API tests
jacobperron 11f3229
Use ament_target_dependencies for osrf_testing_tools_cpp
jacobperron fdcfe29
Fix lint errors
jacobperron ec69e91
Refactor
jacobperron 1f77808
Disable graph tests with OpenSplice
jacobperron 689a051
Include graph.h in rcl_action.h
jacobperron f9c7161
Remove duplicate test
jacobperron e738aaa
Prefix increment operators
jacobperron 91c10ca
Rename 'suffix' -> 'identifier'
jacobperron 2923012
Add missing finalize calls and remove redundant branch
jacobperron 57e2280
Finalize names and types struct on error
jacobperron a70eac7
Fix bugs in tests
jacobperron 3adab6b
Add zero allocator tests
jacobperron 9e9c238
Fix indentation
jacobperron 661cab0
Check if action identifiers are the suffix
jacobperron File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,162 @@ | ||
| // Copyright 2019 Open Source Robotics Foundation, Inc. | ||
| // | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| #ifndef RCL_ACTION__GRAPH_H_ | ||
| #define RCL_ACTION__GRAPH_H_ | ||
|
|
||
| #ifdef __cplusplus | ||
| extern "C" | ||
| { | ||
| #endif | ||
|
|
||
| #include "rcl/graph.h" | ||
| #include "rcl/node.h" | ||
|
|
||
| #include "rcl_action/visibility_control.h" | ||
|
|
||
| /// Get a list of action names and types for action clients associated with a node. | ||
| /** | ||
| * The `node` parameter must point to a valid node. | ||
| * | ||
| * The `action_names_and_types` parameter must be allocated and zero initialized. | ||
| * This function allocates memory for the returned list of names and types and so it is the | ||
| * callers responsibility to pass `action_names_and_types` to rcl_names_and_types_fini() | ||
| * when it is no longer needed. | ||
| * Failing to do so will result in leaked memory. | ||
| * | ||
| * The returned names are not automatically remapped by this function. | ||
| * Attempting to create action clients or action servers with names returned by this function may | ||
| * not result in the desired action name depending on the remap rules in use. | ||
| * | ||
| * <hr> | ||
| * Attribute | Adherence | ||
| * ------------------ | ------------- | ||
| * Allocates Memory | Yes | ||
| * Thread-Safe | No | ||
| * Uses Atomics | No | ||
| * Lock-Free | Maybe [1] | ||
| * <i>[1] implementation may need to protect the data structure with a lock</i> | ||
| * | ||
| * \param[in] node the handle to the node being used to query the ROS graph | ||
| * \param[in] allocator allocator for allocating space for strings | ||
| * \param[in] node_name the node name of the actions to return | ||
| * \param[in] node_namespace the node namespace of the actions to return | ||
| * \param[out] action_names_and_types list of action names and their types | ||
| * \return `RCL_RET_OK` if the query was successful, or | ||
| * \return `RCL_RET_NODE_INVALID` if the node is invalid, or | ||
| * \return `RCL_RET_INVALID_ARGUMENT` if any arguments are invalid, or | ||
| * \return `RCL_RET_ERROR` if an unspecified error occurs. | ||
| */ | ||
| RCL_ACTION_PUBLIC | ||
| RCL_WARN_UNUSED | ||
| rcl_ret_t | ||
| rcl_action_get_client_names_and_types_by_node( | ||
| const rcl_node_t * node, | ||
| rcl_allocator_t * allocator, | ||
| const char * node_name, | ||
| const char * node_namespace, | ||
| rcl_names_and_types_t * action_names_and_types); | ||
|
|
||
| /// Get a list of action names and types for action servers associated with a node. | ||
| /** | ||
| * This function returns a list of action names and types for action servers associated with | ||
| * the provided node name. | ||
| * | ||
| * The `node` parameter must point to a valid node. | ||
| * | ||
| * The `action_names_and_types` parameter must be allocated and zero initialized. | ||
| * This function allocates memory for the returned list of names and types and so it is the | ||
| * callers responsibility to pass `action_names_and_types` to rcl_names_and_types_fini() | ||
| * when it is no longer needed. | ||
| * Failing to do so will result in leaked memory. | ||
| * | ||
| * The returned names are not automatically remapped by this function. | ||
| * Attempting to create action clients or action servers with names returned by this function may | ||
| * not result in the desired action name depending on the remap rules in use. | ||
| * | ||
| * <hr> | ||
| * Attribute | Adherence | ||
| * ------------------ | ------------- | ||
| * Allocates Memory | Yes | ||
| * Thread-Safe | No | ||
| * Uses Atomics | No | ||
| * Lock-Free | Maybe [1] | ||
| * <i>[1] implementation may need to protect the data structure with a lock</i> | ||
| * | ||
| * \param[in] node the handle to the node being used to query the ROS graph | ||
| * \param[in] allocator allocator for allocating space for strings | ||
| * \param[in] node_name the node name of the actions to return | ||
| * \param[in] node_namespace the node namespace of the actions to return | ||
| * \param[out] action_names_and_types list of action names and their types | ||
| * \return `RCL_RET_OK` if the query was successful, or | ||
| * \return `RCL_RET_NODE_INVALID` if the node is invalid, or | ||
| * \return `RCL_RET_INVALID_ARGUMENT` if any arguments are invalid, or | ||
| * \return `RCL_RET_ERROR` if an unspecified error occurs. | ||
| */ | ||
| RCL_ACTION_PUBLIC | ||
| RCL_WARN_UNUSED | ||
| rcl_ret_t | ||
| rcl_action_get_server_names_and_types_by_node( | ||
| const rcl_node_t * node, | ||
| rcl_allocator_t * allocator, | ||
| const char * node_name, | ||
| const char * node_namespace, | ||
| rcl_names_and_types_t * action_names_and_types); | ||
|
|
||
| /// Return a list of action names and their types. | ||
| /** | ||
| * This function returns a list of action names and types in the ROS graph. | ||
| * | ||
| * The `node` parameter must point to a valid node. | ||
| * | ||
| * The `action_names_and_types` parameter must be allocated and zero initialized. | ||
| * This function allocates memory for the returned list of names and types and so it is the | ||
| * callers responsibility to pass `action_names_and_types` to rcl_names_and_types_fini() | ||
| * when it is no longer needed. | ||
| * Failing to do so will result in leaked memory. | ||
| * | ||
| * The returned names are not automatically remapped by this function. | ||
| * Attempting to create action clients or action servers with names returned by this function may | ||
| * not result in the desired action name depending on the remap rules in use. | ||
| * | ||
| * <hr> | ||
| * Attribute | Adherence | ||
| * ------------------ | ------------- | ||
| * Allocates Memory | Yes | ||
| * Thread-Safe | No | ||
| * Uses Atomics | No | ||
| * Lock-Free | Maybe [1] | ||
| * <i>[1] implementation may need to protect the data structure with a lock</i> | ||
| * | ||
| * \param[in] node the handle to the node being used to query the ROS graph | ||
| * \param[in] allocator allocator for allocating space for strings | ||
| * \param[out] action_names_and_types list of action names and types | ||
| * \return `RCL_RET_OK` if the query was successful, or | ||
| * \return `RCL_RET_NODE_INVALID` if the node is invalid, or | ||
| * \return `RCL_RET_INVALID_ARGUMENT` if any arguments are invalid, or | ||
| * \return `RCL_RET_ERROR` if an unspecified error occurs. | ||
| */ | ||
| RCL_ACTION_PUBLIC | ||
| RCL_WARN_UNUSED | ||
| rcl_ret_t | ||
| rcl_action_get_names_and_types( | ||
| const rcl_node_t * node, | ||
| rcl_allocator_t * allocator, | ||
| rcl_names_and_types_t * action_names_and_types); | ||
|
|
||
| #ifdef __cplusplus | ||
| } | ||
| #endif | ||
|
|
||
| #endif // RCL_ACTION__GRAPH_H_ |
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.