If the user doesn't retain a reference to the returned shared pointer there will be zero references and their callback will be unregistered.
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
* expose get_service_names_and_types_by_node from rcl in rclcpp
Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
* fix spelling
Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
* zero initialize
Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
* check return value and cleanup
Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
* use throw_from_rcl_error
Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
* cleanup error handling
Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
* deprecate redundant namespaces, move classes to own files, rename some classes
Signed-off-by: William Woodall <william@osrfoundation.org>
* fixup
Signed-off-by: William Woodall <william@osrfoundation.org>
* address review comments
Signed-off-by: William Woodall <william@osrfoundation.org>
* fix ups since rebase
Signed-off-by: William Woodall <william@osrfoundation.org>
* avoid deprecation warnings from deprecated functions
Signed-off-by: William Woodall <william@osrfoundation.org>
* more fixes
Signed-off-by: William Woodall <william@osrfoundation.org>
* another fixup, after another rebase
Signed-off-by: William Woodall <william@osrfoundation.org>
* streamline creation of publishers after removing deprecated API
Signed-off-by: William Woodall <william@osrfoundation.org>
* use deduced template arguments to cleanup create_subscription
Signed-off-by: William Woodall <william@osrfoundation.org>
* add missing file
Signed-off-by: William Woodall <william@osrfoundation.org>
* streamline creation of subscriptions after removing deprecated API
Signed-off-by: William Woodall <william@osrfoundation.org>
* small subscription code cleanup to match publisher's style
Signed-off-by: William Woodall <william@osrfoundation.org>
* some fixes to rclcpp_lifecycle to match rclcpp
Signed-off-by: William Woodall <william@osrfoundation.org>
* add README to the rclcpp/detail include directory
Signed-off-by: William Woodall <william@osrfoundation.org>
* fixup SubscriptionBase's use of visibility macros
Signed-off-by: William Woodall <william@osrfoundation.org>
* reapply function to create default options, as it is still needed on Windows
Signed-off-by: William Woodall <william@osrfoundation.org>
* address review comments
Signed-off-by: William Woodall <william@osrfoundation.org>
* workaround cppcheck 1.89 syntax error
Signed-off-by: William Woodall <william@osrfoundation.org>
* Add missing template functionality to lifecycle_node.
Recent changes to the node_parameters interface was accompanied by additions to the
node.hpp header and implementation files. However, these additions were not also made
to the corresponding lifecycle node files. This PR includes the changes required for
the lifecycle node.
Going forward, I suggest that any code like this that supplements the basic node interfaces
should either be factored out into a separate header that both node and lifecycle_node
include, or that the supplemental code simply be included in the appropriate node_interface
file directly, if possible. That way we can avoid code duplication and its symptoms which
is node and lifecycle_node getting out of sync (which they have several times).
Signed-off-by: Michael Jeronimo <michael.jeronimo@intel.com>
* consolidate documentation to just be in rclcpp/node.hpp
Signed-off-by: William Woodall <william@osrfoundation.org>
* fix visibility macros
Signed-off-by: William Woodall <william@osrfoundation.org>
* deprecation methods that were also deprecated in rclcpp::Node
Signed-off-by: William Woodall <william@osrfoundation.org>
* fixup variable name
Signed-off-by: William Woodall <william@osrfoundation.org>
* add missing template method implementations
Signed-off-by: William Woodall <william@osrfoundation.org>
* add more methods that were not ported to lifecycle node originally
Signed-off-by: William Woodall <william@osrfoundation.org>
* fix cpplint
Signed-off-by: William Woodall <william@osrfoundation.org>
* 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>
There are getters for the other interfaces, but the logging interface
appears to have been overlooked.
Signed-off-by: Michael Jeronimo <michael.jeronimo@intel.com>
* Start work on creaating NodeOptions structure.
Signed-off-by: Michael Carroll <michael@openrobotics.org>
* Continue work on NodeOptions.
Signed-off-by: Michael Carroll <michael@openrobotics.org>
* Update tests for NodeOptions impl.
Signed-off-by: Michael Carroll <michael@openrobotics.org>
* Update documentation and copy/assignment.
Signed-off-by: Michael Carroll <michael@openrobotics.org>
* Update rclcpp_lifecycle to conform to new API.
Signed-off-by: Michael Carroll <michael@openrobotics.org>
* Use builder pattern with NodeOptions.
Signed-off-by: Michael Carroll <michael@openrobotics.org>
* Documentation updates.
Signed-off-by: Michael Carroll <michael@openrobotics.org>
* Update rclcpp_lifecycle to use NodeOptions.
Signed-off-by: Michael Carroll <michael@openrobotics.org>
* change to parameter idiom only, from builder pattern
Signed-off-by: William Woodall <william@osrfoundation.org>
* Update rclcpp/include/rclcpp/node_options.hpp
Co-Authored-By: wjwwood <william+github@osrfoundation.org>
Signed-off-by: William Woodall <william@osrfoundation.org>
* follow up with more resets of the rcl_node_options_t
Signed-off-by: William Woodall <william@osrfoundation.org>
* todo about get env
Signed-off-by: William Woodall <william@osrfoundation.org>
* [rclcpp] Add class Waitable
Provides a virtual API for interacting with wait sets.
* [rclcpp] Add node interface for Waitables
* [rclcpp] Implement node interface for Waitables
* [rclcpp] Integrate Waitable entities with executor
* Implement remaining logic for integrating Waitables
* Add visibility macros and other refactoring to Waitable class
* Return zero size for entities in a Waitable by default
* Bugfix: Clear list of waitable handles
* Bugfix: update Waitable handle list based on readiness
* Bugfix: update for loop condition
* Give node a node_waitables_
* Give lifecycle node a node_waitables
* Split ParametrVariant into Parameter and ParameterValue
* Test expects ParameterTypeException
* get_parameter_value() -> get_value_message()
* Make to_parameter() const and rename to to_parameter_msg()
* Add Logger class and give one to nodes
* Try to improve compiler errors when non-Logger is passed to macros
* Add define for 'disabling' loggers
* Add/update tests
* Linter fix
* Documentation
* Windows fix
* Move free functions to source file (windows was upset)
* Fix windows by changing prototype ordering
* Store node logger in NodeBase
* Windows is not happy with this EXPECT_ANY_THROW
* Move get_logger to a NodeLogger interface
* Move Logger into 'logger' namespace
* Move helper function for macro errors into macro header
* Remove 'logger' namespace
* Return type on separate line
* Update copyright year
* Give lifecycle nodes a logger
* Add test for lifecycle node logger
Move the default_state_machine tests to another file because having
different test fixtures was causing init to be called twice.
* Switch to static_assert for logger check
* global ns scope in macro calls
just in case
* Revert "Add test for lifecycle node logger" (make diff smaller)
demos use the loggers and we don't test other node stuff in lifecycle_node
* Update for rcutils function name change
* Add reference to Node::get_logger() in doxygen
* Rename NodeLoggerInterface to NodeLoggingInterface
* expand topic name before invoking count pub/sub
* convenience function for get_namespace()
* uncrustify
* typo
* add get_namespace() test
* add get_namespace() for lifecycle
* add /W4 flag for windows
* use uint8 like defined in messages: fix warning C4244
* fix sign size_t comparison
* add only pedantic, not W4, deal with windows another day
* another sign compare warning
* 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