* Switch the NodeParameters lock to recursive.
This is so that the on_set_parameter_callback can successfully
call other parameter methods (like get_parameter) without
deadlocking.
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
* Make sure that modifications can't happen within a callback.
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
* Review fixes.
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
* Set parameter_modification_enabled_ in calls that make modifications.
This will prevent any modification from within modification,
which is a good thing.
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
* Fix windows errors.
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
* Switch to an RAII-style recursion guard.
Also update the documentation.
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
* Adding a factory method to create a Duration from seconds
There are many places in the ROS codebase where a time duration is
specified as a floating point number of seconds. A factory function
to create a Duration object from these values makes the code a
bit simpler in many cases.
Signed-off-by: Carl Delsey <carl.r.delsey@intel.com>
* Adding some comments to clarify which constructors get matched.
Signed-off-by: Carl Delsey <carl.r.delsey@intel.com>
The short-term goal of this change is to enable the creation of a
parameter YAML file which is applied to each node, regardless of node
name or namespace.
Future work is to support all wildcard syntax in node names in
parameter YAML files.
Signed-off-by: Scott K Logan <logans@cottsay.net>
* use default parameter descriptor in parameters interface
Signed-off-by: Karsten Knese <karsten@openrobotics.org>
* use default parameter for value
Signed-off-by: Karsten Knese <karsten@openrobotics.org>
* rename initial_parameters in NodeOptions to parameter_overrides
Signed-off-by: William Woodall <william@osrfoundation.org>
* rename automatically_declare_initial_parameters to automatically_declare_parameters_from_overrides
Signed-off-by: William Woodall <william@osrfoundation.org>
* some additional renames I missed
Signed-off-by: William Woodall <william@osrfoundation.org>
* add test for setting after declaring with parameter overrides
Signed-off-by: William Woodall <william@osrfoundation.org>
* fixup NodeOptions docs
Signed-off-by: William Woodall <william+github@osrfoundation.org>
Co-Authored-By: chapulina <louise@openrobotics.org>
* clarify relationship between allow_undeclared_parameters and parameter_overrides
Signed-off-by: William Woodall <william@osrfoundation.org>
* removed not used parameter client
Signed-off-by: alberto <alberto.soragna@gmail.com>
* moved parameter include directives to time source cpp file
Signed-off-by: alberto <alberto.soragna@gmail.com>
* change memory strategy API from vector of nodes to list of nodes
Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
* store guard_condition of node in executor and ensure that it is removed from the memory strategy
Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
* add unit test
Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
* Throw nice errors when creating a publisher with intraprocess communication and history keep all or history depth 0.
Signed-off-by: ivanpauno <ivanpauno@ekumenlabs.com>
* created static functions
Signed-off-by: alsora <alberto.soragna@gmail.com>
Signed-off-by: alberto soragna <alberto.soragna@gmail.com>
* updated on_parameter_event to new subscriber api
Signed-off-by: alberto soragna <alberto.soragna@gmail.com>
* Update parameter_client.hpp
Reorderd typenames in template
Signed-off-by: alberto soragna <alberto.soragna@gmail.com>
* updated API also for Synchronous client and fixed linter errors
Signed-off-by: alberto soragna <alberto.soragna@gmail.com>
* added empty line at the end of files
Signed-off-by: alberto soragna <alberto.soragna@gmail.com>
* fixed linter error
Signed-off-by: alsora <alberto.soragna@gmail.com>
* added parameter client tests
Signed-off-by: alsora <alberto.soragna@gmail.com>
* added missing includes in unit test
Signed-off-by: alsora <alberto.soragna@gmail.com>
Fixes#705.
If the set_parameters() call fails, it's nice to be able to return a partial result.
Since there is no convenient method to obtain a partial result, we call set_parameters()
once for each parameter.
Signed-off-by: Jacob Perron <jacob@openrobotics.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>
* Populate return code of CancelGoal service response
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
* Throw if there is an error processing a cancel goal request
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
* Make cancel callback signature consistent across cancel methods and add tests
Refactored the callback signature for canceling one goal. Now it is the same as the other cancel methods.
This makes it easier to communicate the error code to the user.
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
* Address review
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
* API updates for rmw preallocation work.
Signed-off-by: Michael Carroll <michael@openrobotics.org>
* Adjust for allocation in serialized message method.
Signed-off-by: Michael Carroll <michael@openrobotics.org>
* Fix extra take call.
Signed-off-by: Michael Carroll <michael@openrobotics.org>
* Add functions to return formatted Node Name-Namespace strings
Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
* Changed get_node_names to return fully qualified names, removed namespace method
Signed-off-by: Oswin So <oswinso@gmail.com>
* Removed unnecessary capture-by-reference
Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
* Added first draft of tests
Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
* Fixed bug creating phantom empty name/namespaces
Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
* Re-ordered includes
Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
* Swap checks to see if name is in set
Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
* Fixed style errors from uncrustify
Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
* Swapped to unordered_set
Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
* Re-ordered includes again
Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
* nitpick: minimize vertical whitespace
see: https://google.github.io/styleguide/cppguide.html#Vertical_Whitespace
Signed-off-by: William Woodall <william@osrfoundation.org>
* Add API documentation for added get_node_names function
Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
* Revert to last known semi-working point
Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
* Modified expected test results
A fully-qualified name is "namespace"/"name". If namespace is set to be "/" (as they are in these tests), we would expect a qualified name of "//name"
Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
* Have get_node_names determine if central slash needed or not
Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
* Corrected tests to not accept double slashes
Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
* Undo changes to .gitignore
Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
* Change qualified string construction to better handle invalid slashes
Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
* Removed debugging statements
Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
* Simplified slash-checking logic
Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
* Add assignment of missing parameter-related fields in node options copy constructor.
The allow_undeclared_parameters and automatically_declare_initial_parameters fields of
the node options class were not assigned in the assignment operator, resulting in
an incorrect copy of the node options object, which also indirectly affects the
copy constructor.
Signed-off-by: Michael Jeronimo <michael.jeronimo@intel.com>
* Run linters