* LifecycleNode base class resource needs to be reset via dtor.
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
* add debug notice that prints LifecycleNode is not shutdown in dtor.
Currently it is user application responsibility to manage the all state control.
See more details for https://github.com/ros2/rclcpp/issues/2520.
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
* add test cases to call shutdown from each primary state.
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
* address review comments.
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
---------
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
* Fix the lifecycle tests on RHEL-9.
The full explanation is in the comment, but basically since
RHEL doesn't support mocking_utils::inject_on_return, we have
to split out certain tests to make sure resources within a
process don't collide.
Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
* Revert "LifecycleNode shutdown on dtor only with valid context. (#2545)"
This reverts commit d8d83a0ee6.
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
* Revert "call shutdown in LifecycleNode dtor to avoid leaving the device in unknown state (2nd) (#2528)"
This reverts commit 3bc364a10b.
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
---------
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
* Revert "Revert "call shutdown in LifecycleNode dtor to avoid leaving the device in un… (#2450)" (#2522)"
This reverts commit 42b0b5775b.
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
* lifecycle node dtor shutdown should be called only in primary state.
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
* adjust warning message if the node is still in transition state in dtor.
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
---------
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
* call shutdown in LifecycleNode dtor to avoid leaving the device in unknown state.
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
* add test to verify LifecycleNode::shutdown is called on destructor.
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
---------
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
* TypeDescriptions interface with readonly param configuration
* Add parameter descriptor, to make read only
* example of spinning in thread for get_type_description service
* Add a basic test for the new interface
* Fix tests with new parameter
* Add comments about builtin parameters
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: William Woodall <william@osrfoundation.org>
* Deprecated `shared_ptr<MessageT>` sub callbacks
Addresses #1619.
Signed-off-by: Abrar Rahman Protyasha <abrar@openrobotics.org>
* Resolve deprecated subscription callbacks in tests
Specifically, `void shared_ptr<MessageT>` subscription callbacks have
been migrated to `void shared_ptr<const MessageT>` subscription
callbacks.
This change has been performed only on the test files that do
not actually house unit tests for the `AnySubscriptionCallback` class.
For unit tests that actually target the deprecated `set` functions,
the deprecation warnings have to be avoided. This patch will be
introduced in a separate commit.
Signed-off-by: Abrar Rahman Protyasha <abrar@openrobotics.org>
* Suppress deprecation warnings in unit tests
This commit specifically introduces suppression of the deprecation
warnings produced while compiling unit tests for the
`AnySubscriptionCallback` class.
The macro mechanics to conditionally include the `deprecated` attribute
is not ideal, but the diagnostic pragma solution (`# pragma GCC
diagnostic ignored`) did not work for these unit tests, possibly because
of the way gtest is initializing the necessary `InstanceContext`
objects.
A `TODO` directive has been left to figure out a better way to address
this warning suppression.
Signed-off-by: Abrar Rahman Protyasha <abrar@openrobotics.org>
* Fix shared ptr callback in wait_for_message
Moving away from deprecated signatures.
Signed-off-by: Abrar Rahman Protyasha <abrar@openrobotics.org>
* `rclcpp_action`: Fix deprecated subscr. callbacks
Signed-off-by: Abrar Rahman Protyasha <abrar@openrobotics.org>
* `rclcpp_lifecycle`: Fix deprecated sub callbacks
Signed-off-by: Abrar Rahman Protyasha <abrar@openrobotics.org>
The main reason to add this method in is to make accesses to the
callback_groups_ vector thread-safe. By having a
callback_groups_for_each that accepts a std::function, we can
just have the callers give us the callback they are interested
in, and we can take care of the locking.
The rest of this fairly large PR is cleaning up all of the places
that use get_callback_groups() to instead use
callback_groups_for_each().
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
Apparently, the topics and services that LifecycleNode provides are not
available immediately after creating a node.
Fix flaky tests by accounting for some delay between the LifecycleNode
constructor and queries about its topics and services.
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
* Replace stale reference to Connext
* Restore exceptions for ros2/rmw_connext to ease transition to rticommunity/rmw_connextdds
Signed-off-by: Andrea Sorbini <asorbini@rti.com>
Co-authored-by: Chris Lalancette <clalancette@gmail.com>
* Increase test timeouts of slow running tests with rmw_connext_cpp
Signed-off-by: Stephen Brawner <brawner@gmail.com>
* Fix other issues with connext
Signed-off-by: Stephen Brawner <brawner@gmail.com>
* Increase test coverage of rclcpp_lifecycle to 96%
Signed-off-by: Stephen Brawner <brawner@gmail.com>
* PR Fixup
Signed-off-by: Stephen Brawner <brawner@gmail.com>
* test_depend
Signed-off-by: Stephen Brawner <brawner@gmail.com>
* rcutils test_depend
Signed-off-by: Stephen Brawner <brawner@gmail.com>
* More windows warnings
Signed-off-by: Stephen Brawner <brawner@gmail.com>
* improve interoperability with rclcpp::Duration and std::chrono
Signed-off-by: William Woodall <william@osrfoundation.org>
* add to_rmw_time to Duration
Signed-off-by: William Woodall <william@osrfoundation.org>
* add new QoS class to rclcpp
Signed-off-by: William Woodall <william@osrfoundation.org>
* changes to NodeBase, NodeTopics, etc in preparation for changes to pub/sub
Signed-off-by: William Woodall <william@osrfoundation.org>
* refactor publisher creation to use new QoS class
Signed-off-by: William Woodall <william@osrfoundation.org>
* refactor subscription creation to use new QoS class
Signed-off-by: William Woodall <william@osrfoundation.org>
* fixing fallout from changes to pub/sub creation
Signed-off-by: William Woodall <william@osrfoundation.org>
* fixed Windows error: no appropriate default constructor available
why? who knows
Signed-off-by: William Woodall <william@osrfoundation.org>
* fixed Windows error: could not deduce template argument for 'PublisherT'
Signed-off-by: William Woodall <william@osrfoundation.org>
* fix missing vftable linker error on Windows
Signed-off-by: William Woodall <william@osrfoundation.org>
* fix more cases of no suitable default constructor errors...
Signed-off-by: William Woodall <william@osrfoundation.org>
* prevent msvc from trying to interpret some cases as functions
Signed-off-by: William Woodall <william@osrfoundation.org>
* uncrustify
Signed-off-by: William Woodall <william@osrfoundation.org>
* cpplint
Signed-off-by: William Woodall <william@osrfoundation.org>
* add C++ version of default action qos
Signed-off-by: William Woodall <william@osrfoundation.org>
* fixing lifecycle subscription signatures
Signed-off-by: William Woodall <william@osrfoundation.org>
* fix allocators (we actually use this already in the pub/sub factory)
Signed-off-by: William Woodall <william@osrfoundation.org>
* suppress cppcheck on false positive syntax error
Signed-off-by: William Woodall <william@osrfoundation.org>
* fix more cppcheck syntax error false positives
Signed-off-by: William Woodall <william@osrfoundation.org>
* fix case where sub-type of QoS is used
Signed-off-by: William Woodall <william@osrfoundation.org>
* fixup get_node_topics_interface.hpp according to reviews and tests
Signed-off-by: William Woodall <william@osrfoundation.org>
* additional fixes based on local testing and CI
Signed-off-by: William Woodall <william@osrfoundation.org>
* another trick to avoid 'no appropriate default constructor available'
Signed-off-by: William Woodall <william@osrfoundation.org>
* fix compiler error with clang on macOS
Signed-off-by: William Woodall <william@osrfoundation.org>
* disable build failure tests until we can get Jenkins to ignore their output
Signed-off-by: William Woodall <william@osrfoundation.org>
* suppress more cppcheck false positives
Signed-off-by: William Woodall <william@osrfoundation.org>
* add missing visibility macros to default QoS profile classes
Signed-off-by: William Woodall <william@osrfoundation.org>
* fix another case of 'no appropriate default constructor available'
Signed-off-by: William Woodall <william@osrfoundation.org>
* unfortunately this actaully fixes a build error on Windows...
Signed-off-by: William Woodall <william@osrfoundation.org>
* fix typos
Signed-off-by: William Woodall <william@osrfoundation.org>
* expand topic name before invoking count pub/sub
* convenience function for get_namespace()
* uncrustify
* typo
* add get_namespace() test
* add get_namespace() for lifecycle
* initial state machine implementation
(fix) correctly initialize default state machine
uncrustify
(dev) first high level api interface
src/default_state_machine.c
(fix) correctly initialize arrays in statemachine
(dev) deactivate/activate publisher demo
(dev) initial state machine implementation in rcl
* (dev) demo application for a managed lifecycle node
* add visibility control
* correct install of c-library
* fix compilation on windows
* refactoring of external/internal api
* (dev) generate static functions for c-callback
* (fix) correct typo
* (dev) cleanup for c-statemachine
(dev) cleanup for c-statemachine
* (dev) cpp callback map
* (dev) mv source file into project folders
* (dev) more helper functions for valid transition
* (dev) pimpl implementation for cpp lifecyclemanager
* (dev) register non-default callback functions
* (dev) cleanup lifecycle node to serve as base class
* (dev) new my_node child of lifecyclenode for demo purpose
update
stuff
(cleanup) remove unused comments
(fix) correct dllexport in windows
(fix) correctly install libraries
(fix) uncrustify
(dev) composition over inheritance
(dev) publish notification in state_machine transition
(dev) lifecycle talker + listener demo for notification
(dev) custom transition message generation
(dev) publish transition message on state change
(dev) correctly malloc/free c data structures
(fix) use single thread executor
(dev) use services for get state
(fix) set freed pointer to NULL
(dev) add change state service
(dev) introduce services: get_state and change_state in LM
(dev) asynchronous caller script for service client
(fix) correct dllexport for pimpl
(dev) correct constness
(dev) concatenate function for topic
(fix) uncrustify
prepare new service api
(tmp) refactor stash
(fix) correctly concatenate topics
(fix) correctly initialize Service wo/ copy
(dev) call both service types
extract demo files
(fix) remove debug prints
(dev) change to lifecycle_msgs
(refactor) extract rcl_lifecycle package
(refactor) extract lifecycle demos
(fix) address review comments
(fix) address review comments
(fix) pass shared_ptr by value
(fix) make find_package(rmw) required
(fix) return to shared node handle pointer
(refactor) attach sm to lifecycle node and disable lc_manager
(dev) construct service from existing rcl_service_t
(refactor) extract method for adding a service to a node
(fix) stop mock msgs from being installed
service takes rcl_node_t*
correct typo
add_service has to be public
uncrustify
initial state machine implementation
(fix) correctly initialize default state machine
uncrustify
(dev) first high level api interface
src/default_state_machine.c
(fix) correctly initialize arrays in statemachine
(dev) deactivate/activate publisher demo
(dev) initial state machine implementation in rcl
(dev) demo application for a managed lifecycle node
add visibility control
correct install of c-library
fix compilation on windows
refactoring of external/internal api
(dev) generate static functions for c-callback
(fix) correct typo
(dev) cleanup for c-statemachine
(dev) cleanup for c-statemachine
(dev) cpp callback map
(dev) mv source file into project folders
(dev) more helper functions for valid transition
(dev) pimpl implementation for cpp lifecyclemanager
(dev) register non-default callback functions
(dev) cleanup lifecycle node to serve as base class
(dev) new my_node child of lifecyclenode for demo purpose
update
stuff
(cleanup) remove unused comments
(fix) correct dllexport in windows
(fix) correctly install libraries
(fix) uncrustify
(dev) composition over inheritance
(dev) publish notification in state_machine transition
(dev) lifecycle talker + listener demo for notification
(dev) custom transition message generation
(dev) publish transition message on state change
(dev) correctly malloc/free c data structures
(fix) use single thread executor
(dev) use services for get state
(fix) set freed pointer to NULL
(dev) add change state service
(dev) introduce services: get_state and change_state in LM
(dev) asynchronous caller script for service client
(fix) correct dllexport for pimpl
(dev) correct constness
(dev) concatenate function for topic
(fix) uncrustify
prepare new service api
(tmp) refactor stash
* (dev) construct service from existing rcl_service_t
* service takes rcl_node_t*
* correct typo
* add_service has to be public
* uncrustify
* (fix) correctly concatenate topics
* (fix) correctly initialize Service wo/ copy
* (dev) call both service types
* extract demo files
* (fix) remove debug prints
* (dev) change to lifecycle_msgs
* (refactor) extract rcl_lifecycle package
* (refactor) extract lifecycle demos
* (fix) address review comments
(fix) address review comments
* (fix) make find_package(rmw) required
* (refactor) attach sm to lifecycle node and disable lc_manager
* (fix) adjust code to rcl_test refactor
* (dev) remove unused deps
* (rebase) merge commit
* (bugfix) correct rcl_ret_t error handling
* (fix) depedencies
* (refactor) change to lifecycle_msgs
* (fix) correct find_rcl
* (refactor) comply for new state machine
* visibility control and test api
* (rebase) change to new typesupport
* uncrustify'
* fix visibility control
* (fix) correct whitespace
* (fix) unused variable
* comparison signed and unsigned
* get_state returns complete state
* get_available_states service
* new service msgs
* get available states and transitions api
* (broken) state after rebase, does not compile demos
* fix the way lifecycle node impl is included
* fixed rebase compilation errors
* remove copy&paste comment
* remove empty line
* (test) register custom callbacks
* (dev) return codes
* style
* test for exception handling
* refacotr new state machine
* c++14
* change exception message for windows ci bug
change exception message for windows ci bug