Commit graph

28 commits

Author SHA1 Message Date
brawner
a270de6825 Add fault injection macros and unit tests to rcl_action (#730)
* Add fault injection macros and unit tests to rcl_action

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* Addressing  feedback

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* PR Fixup

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* PR Fixup

Signed-off-by: Stephen Brawner <brawner@gmail.com>
2020-10-23 19:36:19 +02:00
brawner
b786cea348
Increase test coverage of rcl_action (#663)
* Add action_server validity check, and remove dead code

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* Increase test coverage of rcl_action

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* Reorganizing impl structs into private header

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* Addressing PR Feedback

Signed-off-by: Stephen Brawner <brawner@gmail.com>

* Addressing memory error and PR feedback

Signed-off-by: Stephen Brawner <brawner@gmail.com>

Co-authored-by: Stephen Brawner <stephenbrawner@verbsurgical.com>
2020-05-28 16:02:35 -07:00
Dirk Thomas
b343368840
export targets in a addition to include directories / libraries (#632)
Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
2020-04-23 14:18:55 -07:00
Alejandro Hernández Cordero
08e0c715c5
Changed rosidl_generator_c/cpp to rosidl_runtime_c/cpp (#588)
* Changed rosidl_generator_c/cpp to rosidl_runtime_c/cpp

Signed-off-by: ahcorde <ahcorde@gmail.com>

* Fixed rcl rcl_runtime_c dependency

Signed-off-by: ahcorde <ahcorde@gmail.com>

* Fixed rcl_action rcl_runtime_c dependency

Signed-off-by: ahcorde <ahcorde@gmail.com>

* Fixed rcl_lifecycle rcl_runtime_c dependency

Signed-off-by: ahcorde <ahcorde@gmail.com>

* keep the originally used dependency type

Signed-off-by: ahcorde <ahcorde@gmail.com>
2020-04-10 12:25:26 +02:00
Mikael Arguedas
926da81913 remove unused CMake code (#475)
* remove copy-n-paste CMake code

Signed-off-by: Mikael Arguedas <mikael.arguedas@gmail.com>

* fixup rmw_implementation_cmake dependency

Signed-off-by: Mikael Arguedas <mikael.arguedas@gmail.com>
2019-07-29 11:16:36 -07:00
Prajakta Gokhale
3806aa226d Fix leaks in rcl_action unit tests (#442)
Fix memory leaks detected by AddressSanitizer from rcl_action unit
tests.

Signed-off-by: Prajakta Gokhale <prajaktg@amazon.com>
2019-05-20 15:04:30 -07:00
Jacob Perron
0c24c7ec8e Update graph test for change to rmw names and types struct (#407)
* Update action graph tests to account for type namespace

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Enable OpenSplice action graph test

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Exclude some action graph tests with OpenSplice

It appears that getting graph information from finalized nodes succeeds with OpenSplice, unlike the other RMW implementations.
Since we do not have tests covering this case in rcl, it's not clear if this is a bug or expected behaviour.
In the meantime, I've disabled testing this specific case for OpenSplice.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* const bool

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
2019-05-07 22:47:37 -07:00
Jacob Perron
b5039d20d7
Add Action graph API (#411)
* Add action graph API

Builds on top of the rcl graph API.
A list of action names associated with action clients can be constructed by
looking for subscriber topic names that have the suffix "/_action/feedback".
Likewise, action servers are associated with publisher topic names with the same suffix.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Enable multiple rmw action graph API tests

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Use ament_target_dependencies for osrf_testing_tools_cpp

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Fix lint errors

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Refactor

* Move graph API common implementation to local function
* Refactor tests

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Disable graph tests with OpenSplice

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Include graph.h in rcl_action.h

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Remove duplicate test

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Prefix increment operators

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Rename 'suffix' -> 'identifier'

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Add missing finalize calls and remove redundant branch

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Finalize names and types struct on error

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Fix bugs in tests

Pass valid names and types struct and update expected error code.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Add zero allocator tests

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Fix indentation

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Check if action identifiers are the suffix

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
2019-04-14 07:30:51 -07:00
ivanpauno
99630cb66d
Using ament_target_dependencies where possible (#400)
* Using ament_target_dependencies where possible

Signed-off-by: ivanpauno <ivanpauno@ekumenlabs.com>

* Modified rcl_add_custom_* to use AMENT_DEPENDENCIES where possible

Signed-off-by: ivanpauno <ivanpauno@ekumenlabs.com>

* Added again osrf_testing_tools_cpp::memory_tools library where needed.

Signed-off-by: ivanpauno <ivanpauno@ekumenlabs.com>

* Modified with PR comment, and replaced forgotten osrf_testing_tools_cpp including

Signed-off-by: ivanpauno <ivanpauno@ekumenlabs.com>
2019-03-19 09:22:16 -03:00
Sachin Suresh Bhat
2ff5df0c11 Set symbol visibility to hidden for rcl (#391)
* Set symbol visibility to hidden for rcl

Enabling symbol visibility feature in gcc and clang compilers.
This will hep find symbol export related issues in linux and
potentially reduce compile times.

Discourse topic link:
https://discourse.ros.org/t/set-symbol-visibility-to-hidden-for-rmw-and-rcl-packages/7981

Signed-off-by: Sachin Suresh Bhat <bhatsach@amazon.com>

* Remove WIN specific compiler definition in configure_rcl

Signed-off-by: Sachin Suresh Bhat <bhatsach@amazon.com>

* Rename macro name rcl_set_symbol_visibility_hidden

Signed-off-by: Sachin Suresh Bhat <bhatsach@amazon.com>

* Change macro to args for rcl_set_symbol_visibility_hidden

Signed-off-by: Sachin Suresh Bhat <bhatsach@amazon.com>
2019-03-05 18:09:55 -08:00
Jacob Perron
97b87263d9 Remove dummy executable
Previously used to test compilation of rcl_action headers.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
2019-02-07 11:24:30 -08:00
Alexis Pojomovsky
c5798e4774 Adds action interaction tests (#352)
* Add action_interaction_tests

* Fixed tests to work with new uuid

* Added comments for each test

* Addressed peer review comments

* Removed unnecessary rcl_reset_error calls from test_action_communication

* Addressed second part of peer review
2018-12-06 14:09:03 -08:00
Alexis Pojomovsky
f9ce6bd186 Increased gtest timeout for communication tests 2018-12-06 14:41:09 -03:00
Alexis Pojomovsky
46e2911d45 Removed unnecessary condition in cmake 2018-12-05 17:37:21 -03:00
Alexis Pojomovsky
316c62d20d Make test_action_communication to be compiled against all available rmw" 2018-12-05 16:53:41 -03:00
William Woodall
97ad0013e2
refactor init to not be global (#336)
* refactor init to not be global

Signed-off-by: William Woodall <william@osrfoundation.org>

* style changes

Signed-off-by: William Woodall <william@osrfoundation.org>

* refactor to hide use of C11 atomics in implementation

Signed-off-by: William Woodall <william@osrfoundation.org>

* fix new action tests

Signed-off-by: William Woodall <william@osrfoundation.org>

* use alternative atomic init for Windows support

* updates after rebase

Signed-off-by: William Woodall <william@osrfoundation.org>

* cleanup rmw_init_options before copying

Signed-off-by: William Woodall <william@osrfoundation.org>

* fix two bugs in new init code

* relax validity checks in a few places to facilitate post shutdown cleanup

Signed-off-by: William Woodall <william@osrfoundation.org>

* fixing tests for new API behavior

Signed-off-by: William Woodall <william@osrfoundation.org>

* to allocator -> to allocate

* acutally call rmw_shutdown() and address review comments

Signed-off-by: William Woodall <william@osrfoundation.org>
2018-11-29 21:32:54 -08:00
Jacob Perron
f39ac3cbe7 [rcl_action] Clean up CMakeLists.txt 2018-11-20 17:53:23 -08:00
Jacob Perron
acc974e43b
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.
2018-11-20 12:04:13 -08:00
Michel Hidalgo
f2afddc910 [rcl action] Cleanup CMake code for test_action_client. 2018-11-13 12:03:05 -03:00
Michel Hidalgo
7efd1a15ae [rcl action] Adds action client tests. 2018-11-12 14:26:42 -03:00
Michel Hidalgo
16205873ea [rcl action] Action client first implementation. 2018-11-12 13:59:47 -03:00
Jacob Perron
b2578bbbda
[rcl_action] Implement goal handle (#320)
* Add action goal handle implementation and unit tests
* Add check to goal state machine transition function for index out of bounds
2018-11-06 10:28:06 -08:00
Jacob Perron
1120b2f6a4 [rcl_action] Remove unnecessary 'target_link_libraries' macro 2018-11-02 12:41:13 -07:00
Michel Hidalgo
55d83f27d7 [rcl action] Addresses peer review comments (#317) 2018-11-01 10:55:52 -03:00
Michel Hidalgo
8b65abeed5 [rcl action] Add action services and topics name getters 2018-11-01 10:54:36 -03:00
Jacob Perron
f9dfc5ddd1
[rcl_action] Implement init/fini functions for types (#312)
* Refactored API. Removed init/fini functions for types that do not necessarily need allocation on the heap.
* Added unit tests for implementation.
2018-10-31 13:36:48 -07:00
Jacob Perron
29e7dbe156
Refactor goal state machine implementation and add unit tests (#311)
* Fix buggy if-conditions in transition functions.
* Bugfix: incease number of states by one
* Cleanup CMakeLists.txt and package.xml
* Move goal state machine implementation details from header to C file
2018-10-30 16:15:10 -07:00
Jacob Perron
451bf4a1a4
Add rcl_action package and headers (#307)
* Create rcl_action package with proposed headers for:
  - Action client
  - Action server
  - Goal handle
  - Goal state machine
  - Types

* Add rcl_action.h and Doxyfile

* Add functions for adding action clients and action servers to a wait set

* Add default QoS profile for status topic and document default options for action clients/servers

* Include all headers in a .c file for testing compilation
2018-10-26 15:55:13 -07:00