Commit graph

46 commits

Author SHA1 Message Date
Stephen Brawner
6dbb394d2e
rcl_action: address various clang static analysis fixes (#864) (#875)
* Address various clang static analysis fixes

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

* Add gtest assert

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

* Taking array by reference

Signed-off-by: Stephen Brawner <brawner@gmail.com>
2020-12-09 09:25:40 -08:00
Chris Lalancette
885fa21a89 Make sure to check the return value of rcl APIs. (#838)
This is just a further check to ensure the test is correct,
and also gets rid of a slew of dead store warnings from
clang static analysis.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
2020-11-02 16:22:11 +01:00
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
c4e690c92a
Address issue 716 by zero initializing pointers and freeing memory (#717) (#820)
Signed-off-by: Stephen Brawner <brawner@gmail.com>
2020-10-05 13:30:39 -07: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
94b5a1d7d0
rename rosidl_generator_c namespace to rosidl_runtime_c (#616)
Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
2020-04-10 21:58:19 -07:00
Dirk Thomas
4b9c0a30be
code style only: wrap after open parenthesis if not in one line (#565)
Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
2020-02-03 09:06:35 -08:00
ivanpauno
4eeaecf969
Fix rcl_action test_graph (#504)
Signed-off-by: ivanpauno <ivanpauno@ekumenlabs.com>
2019-09-20 14:22:38 -03: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
M. M
461ad9cd71 New interfaces and their implementations for QoS features (#408)
* implement rcl_wait and rcl_take for rcl_event_t

Signed-off-by: Miaofei <miaofei@amazon.com>

* address feedback regarding formatting issues

Signed-off-by: Miaofei <miaofei@amazon.com>

* Remove dependency on sleep in test_events

Signed-off-by: Ross Desmond <44277324+ross-desmond@users.noreply.github.com>

* update total max wait time for setting up publisher and subscriber to 10 seconds

Signed-off-by: Miaofei <miaofei@amazon.com>

* Fix test_events for rmw_connext

Signed-off-by: Ross Desmond <44277324+ross-desmond@users.noreply.github.com>

* Refactor out timed loop from tests to function

Signed-off-by: Miaofei <miaofei@amazon.com>

* address additional feedback from pull request

Signed-off-by: Miaofei <miaofei@amazon.com>

* update comment regarding difference between connext and opensplice

Signed-off-by: Miaofei <miaofei@amazon.com>

* fix uncrustify issues

Signed-off-by: Miaofei <miaofei@amazon.com>

* update test_events for compatibility with API changes

Signed-off-by: Miaofei <miaofei@amazon.com>

* temporarily disable test_events for macOS

Signed-off-by: Miaofei <miaofei@amazon.com>
2019-05-03 10:17:27 -07:00
Jacob Perron
eabe426866
Add return code to CancelGoal service response (#422)
* Add return code to CancelGoal service response

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

* Add case for terminated goals

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

* Check for ERROR_NONE instead of 0

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
2019-05-02 15:25:07 -07:00
Jacob Perron
26744b0e5d
Rename action state transitions (#409)
* Rename action state transitions

Now using active verbs.
Resolves #399.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
2019-04-16 04:46:16 -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
Dirk Thomas
756b065653
update tests to use separated action types (#340)
* update test to IDL-based action generation

* update test to IDL-based action generation

* fix merge conflict

* update new tests

* update action types

* match renamed action types

* style fix

* update types using unique_identifier_msgs
2019-03-11 21:12:36 -07:00
William Woodall
7f6b914ac4
pass context to wait set, and fini rmw context (#373)
* pass context to wait set, and fini rmw context

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

* use identifier rather than impl to check init status

Signed-off-by: William Woodall <william@osrfoundation.org>
2019-01-24 19:43:49 -08:00
Shane Loretz
66b82291a1
adapt to action implicit changes (#353) 2018-12-06 16:42:41 -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
b1c4d95abe Change UUID type in action msgs (#338)
* Make use of unique_identifier_msgs/uuid in rcl_action

* Update to use goal_id.uuid

* Remove unnecessary find_package of unique_identifier_msgs
2018-12-04 11:05:20 -08:00
Shane Loretz
fd77323b9d
Add timer to action server to check expired goals + asan fixes (#343)
* Add timer to action server to check expired goals

* Fix leak in action_server

* Fix leaks and heap overflow errors

* Fix leaks in tests
2018-11-30 18:24:17 -08:00
Alexis Pojomovsky
128f28499b Increased timeout for rcl_wait in action tests (#344) 2018-11-30 14:56:07 -08: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
Alexis Pojomovsky
dfaa412bbf
Merge pull request #331 from ros2/hidmic/complete-action-tests
Completes integration tests for action client/server
2018-11-29 20:30:33 -03:00
Shane Loretz
b2694dfb3d
rcl_action_expire_goals() outputs goals that expire (#342)
* rcl_action_expire_goals() outputs goals that expire
2018-11-28 19:10:06 -08:00
Alexis Pojomovsky
aead12917a Addressed peer review comments v2 2018-11-28 15:07:46 -03:00
Alexis Pojomovsky
10eebe3a3b Added checks for wait set entities 2018-11-27 14:25:56 -03:00
Alexis Pojomovsky
d03d5605c1 Addressed peer review comments 2018-11-27 14:11:47 -03:00
Alexis Pojomovsky
4ee3182380 Updated action tests to match the updated API
Added action cancel test

Added action result communication test

Added action status communication test

Added action feedback communication test

Fix wrong return code in action client
2018-11-26 19:27:53 -03:00
Michel Hidalgo
bde76ab40e [rcl action] Augments test_action_communication test. 2018-11-22 11:14:56 -03:00
Michel Hidalgo
f531f682ea [rcl action] Exposes sequence numbers for all requests and responses. (#339) 2018-11-21 16:50:03 -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
e59c14638d
Merge pull request #329 from ros2/hidmic/fix-empty-action-name
Makes rcl_action_get_*_name() functions check for empty action names.
2018-11-16 16:11:28 -03:00
Michel Hidalgo
f256da0a86
Merge pull request #319 from ros2/hidmic/action-client-implementation
Action client implementation
2018-11-15 13:42:08 -03:00
Michel Hidalgo
276aed1dff [rcl action] Addresses peer review comments (#329) 2018-11-14 19:33:21 -03:00
Michel Hidalgo
d77c9b6965 [rcl action] Makes rcl_action_get_*_name() functions check for empty action names. 2018-11-14 17:27:17 -03:00
Jacob Perron
8b00791a56
[rcl_action] Add function to check if goal can be transitioned to CANCELING (#325)
* [rcl_action] Add function for checking if goal can be transitioned to CANCELING

Add unit tests for the new function rcl_action_goal_handle_is_cancelable(), as well as rcl_action_goal_handle_is_active().
2018-11-13 11:55:28 -08:00
Michel Hidalgo
629403e29d [rcl action] Fixes bad assertion in test_action_client. 2018-11-13 14:12:00 -03:00
Michel Hidalgo
7efd1a15ae [rcl action] Adds action client tests. 2018-11-12 14:26:42 -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
88eaa3a926 [rcl_action] Store allocator used for message initialization in the message struct
This relieves the user from providing the correct allocator when finalizing messages.
2018-11-02 12:41:13 -07:00
Jacob Perron
e64fcaf5a8 [rcl_action] Bugfix: check if number of elements to allocate for message is greater than zero 2018-11-02 12:41:13 -07:00
William Woodall
4d8cb487f8
use new error handling API from rcutils (#314)
* use new error handling API from rcutils

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

* use semicolons after macros

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

* use new error handling API from rcutils

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

* minimize vertical whitespace

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

* use semicolons after macros

Signed-off-by: William Woodall <william@osrfoundation.org>
2018-11-01 21:08:31 -05: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