diff --git a/versions/v3.0.0/_add_service_exception_8hpp_source.html b/versions/v3.0.0/_add_service_exception_8hpp_source.html new file mode 100644 index 00000000..be9c43e3 --- /dev/null +++ b/versions/v3.0.0/_add_service_exception_8hpp_source.html @@ -0,0 +1,99 @@ + + +
+ + + + +
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
▼Nmodulo_components | Modulo components |
▼Nexceptions | Modulo component exception classes |
CAddServiceException | An exception class to notify errors when adding a service |
CAddSignalException | An exception class to notify errors when adding a signal |
CComponentException | A base class for all component exceptions |
CComponentParameterException | An exception class to notify errors with component parameters |
CLookupTransformException | An exception class to notify an error while looking up TF transforms |
CComponent | A wrapper for rclcpp::Node to simplify application composition through unified component interfaces |
CComponentInterface | Base interface class for modulo components to wrap a ROS Node with custom behaviour |
CComponentInterfacePublicInterface | Friend class to the ComponentInterface to allow test fixtures to access protected and private members |
CComponentServiceResponse | Response structure to be returned by component services |
CLifecycleComponent | A wrapper for rclcpp_lifecycle::LifecycleNode to simplify application composition through unified component interfaces while supporting lifecycle states and transitions |
▼Nmodulo_core | Modulo Core |
▼Ncommunication | Modulo Core communication module for handling messages on publication and subscription interfaces |
CMessagePair | The MessagePair stores a pointer to a variable and translates the value of this pointer back and forth between the corresponding ROS messages |
CMessagePairInterface | Interface class to enable non-templated writing and reading ROS messages from derived MessagePair instances through dynamic down-casting |
CPublisherHandler | The PublisherHandler handles different types of ROS publishers to activate, deactivate and publish data with those publishers |
CPublisherInterface | Interface class to enable non-templated activating/deactivating/publishing of ROS publishers from derived PublisherHandler instances through dynamic down-casting |
CSubscriptionHandler | The SubscriptionHandler handles different types of ROS subscriptions to receive data from those subscriptions |
CSubscriptionInterface | Interface class to enable non-templated subscriptions with ROS subscriptions from derived SubscriptionHandler instances through dynamic down-casting |
▼Nexceptions | Modulo Core exceptions module for defining exception classes |
CCoreException | A base class for all core exceptions |
CInvalidPointerCastException | An exception class to notify if the result of getting an instance of a derived class through dynamic down-casting of an object of the base class is not a correctly typed instance of the derived class |
CInvalidPointerException | An exception class to notify if an object has no reference count (if the object is not owned by any pointer) when attempting to get a derived instance through dynamic down-casting |
CMessageTranslationException | An exception class to notify that the translation of a ROS message failed |
CNullPointerException | An exception class to notify that a certain pointer is null |
CParameterTranslationException | An exception class to notify incompatibility when translating parameters from different sources |
▼Nmodulo_utils | |
▼Ntestutils | |
CPredicatesListener | |
CServiceClient |
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
This is the complete list of members for modulo_components::Component, including all inherited members.
+add_input(const std::string &signal_name, const std::shared_ptr< DataT > &data, const std::string &default_topic="", bool fixed_topic=false) | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
add_input(const std::string &signal_name, const std::shared_ptr< DataT > &data, const std::function< void()> &callback, const std::string &default_topic="", bool fixed_topic=false) | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
add_input(const std::string &signal_name, const std::function< void(const std::shared_ptr< MsgT >)> &callback, const std::string &default_topic="", bool fixed_topic=false) | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
add_output(const std::string &signal_name, const std::shared_ptr< DataT > &data, const std::string &default_topic="", bool fixed_topic=false, bool publish_on_step=true) | modulo_components::Component | inlineprotected |
add_parameter(const std::shared_ptr< state_representation::ParameterInterface > ¶meter, const std::string &description, bool read_only=false) | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
add_parameter(const std::string &name, const T &value, const std::string &description, bool read_only=false) | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
add_periodic_callback(const std::string &name, const std::function< void(void)> &callback) | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
add_predicate(const std::string &predicate_name, bool predicate_value) | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
add_predicate(const std::string &predicate_name, const std::function< bool(void)> &predicate_function) | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
add_service(const std::string &service_name, const std::function< ComponentServiceResponse(void)> &callback) | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
add_service(const std::string &service_name, const std::function< ComponentServiceResponse(const std::string &string)> &callback) | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
add_static_tf_broadcaster() | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
add_tf_broadcaster() | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
add_tf_listener() | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
add_trigger(const std::string &trigger_name) | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
Component(const rclcpp::NodeOptions &node_options, const std::string &fallback_name="Component") | modulo_components::Component | explicit |
ComponentInterface(const rclcpp::NodeOptions &node_options, modulo_core::communication::PublisherType publisher_type, const std::string &fallback_name="ComponentInterface") | modulo_components::ComponentInterface< rclcpp::Node > | explicit |
ComponentPublicInterface (defined in modulo_components::Component) | modulo_components::Component | friend |
create_output(const std::string &signal_name, const std::shared_ptr< DataT > &data, const std::string &default_topic, bool fixed_topic, bool publish_on_step) | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
declare_input(const std::string &signal_name, const std::string &default_topic="", bool fixed_topic=false) | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
declare_output(const std::string &signal_name, const std::string &default_topic="", bool fixed_topic=false) | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
evaluate_periodic_callbacks() | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
execute() | modulo_components::Component | protected |
get_parameter(const std::string &name) const | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
get_parameter_value(const std::string &name) const | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
get_predicate(const std::string &predicate_name) | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
get_qos() const | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
inputs_ | modulo_components::ComponentInterface< rclcpp::Node > | protected |
lookup_transform(const std::string &frame, const std::string &reference_frame, const tf2::TimePoint &time_point, const tf2::Duration &duration) | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
lookup_transform(const std::string &frame, const std::string &reference_frame="world", double validity_period=-1.0, const tf2::Duration &duration=tf2::Duration(std::chrono::microseconds(10))) | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
on_execute_callback() | modulo_components::Component | protectedvirtual |
on_validate_parameter_callback(const std::shared_ptr< state_representation::ParameterInterface > ¶meter) | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotectedvirtual |
outputs_ | modulo_components::ComponentInterface< rclcpp::Node > | protected |
periodic_outputs_ | modulo_components::ComponentInterface< rclcpp::Node > | protected |
publish_output(const std::string &signal_name) | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
publish_outputs() | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
publish_predicate(const std::string &name) | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
publish_predicates() | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
publish_transforms(const std::vector< state_representation::CartesianPose > &transforms, const std::shared_ptr< T > &tf_broadcaster, bool is_static=false) | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
qos_ | modulo_components::ComponentInterface< rclcpp::Node > | protected |
raise_error() | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotectedvirtual |
remove_input(const std::string &signal_name) | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
remove_output(const std::string &signal_name) | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
send_static_transform(const state_representation::CartesianPose &transform) | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
send_static_transforms(const std::vector< state_representation::CartesianPose > &transforms) | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
send_transform(const state_representation::CartesianPose &transform) | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
send_transforms(const std::vector< state_representation::CartesianPose > &transforms) | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
set_parameter_value(const std::string &name, const T &value) | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
set_predicate(const std::string &predicate_name, bool predicate_value) | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
set_predicate(const std::string &predicate_name, const std::function< bool(void)> &predicate_function) | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
set_qos(const rclcpp::QoS &qos) | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
trigger(const std::string &trigger_name) | modulo_components::ComponentInterface< rclcpp::Node > | inlineprotected |
~Component()=default | modulo_components::Component | virtual |
~ComponentInterface()=default | modulo_components::ComponentInterface< rclcpp::Node > | virtual |
+ Modulo 3.0.0
+
+ |
+
A wrapper for rclcpp::Node to simplify application composition through unified component interfaces. + More...
+ +#include <Component.hpp>
+Public Member Functions | |
Component (const rclcpp::NodeOptions &node_options, const std::string &fallback_name="Component") | |
Constructor from node options. More... | |
+virtual | ~Component ()=default |
Virtual default destructor. | |
Public Member Functions inherited from modulo_components::ComponentInterface< rclcpp::Node > | |
ComponentInterface (const rclcpp::NodeOptions &node_options, modulo_core::communication::PublisherType publisher_type, const std::string &fallback_name="ComponentInterface") | |
Constructor from node options. More... | |
+virtual | ~ComponentInterface ()=default |
Virtual default destructor. | |
+Protected Member Functions | |
void | execute () |
Start the execution thread. More... | |
virtual bool | on_execute_callback () |
Execute the component logic. To be redefined in derived classes. More... | |
template<typename DataT > | |
void | add_output (const std::string &signal_name, const std::shared_ptr< DataT > &data, const std::string &default_topic="", bool fixed_topic=false, bool publish_on_step=true) |
Add and configure an output signal of the component. More... | |
Protected Member Functions inherited from modulo_components::ComponentInterface< rclcpp::Node > | |
virtual void | step () |
Step function that is called periodically. More... | |
void | add_parameter (const std::shared_ptr< state_representation::ParameterInterface > ¶meter, const std::string &description, bool read_only=false) |
Add a parameter. More... | |
void | add_parameter (const std::string &name, const T &value, const std::string &description, bool read_only=false) |
Add a parameter. More... | |
std::shared_ptr< state_representation::ParameterInterface > | get_parameter (const std::string &name) const |
Get a parameter by name. More... | |
T | get_parameter_value (const std::string &name) const |
Get a parameter value by name. More... | |
void | set_parameter_value (const std::string &name, const T &value) |
Set the value of a parameter. More... | |
virtual bool | on_validate_parameter_callback (const std::shared_ptr< state_representation::ParameterInterface > ¶meter) |
Parameter validation function to be redefined by derived Component classes. More... | |
void | add_predicate (const std::string &predicate_name, bool predicate_value) |
Add a predicate to the map of predicates. More... | |
void | add_predicate (const std::string &predicate_name, const std::function< bool(void)> &predicate_function) |
Add a predicate to the map of predicates based on a function to periodically call. More... | |
bool | get_predicate (const std::string &predicate_name) |
Get the logical value of a predicate. More... | |
void | set_predicate (const std::string &predicate_name, bool predicate_value) |
Set the value of the predicate given as parameter, if the predicate is not found does not do anything. More... | |
void | set_predicate (const std::string &predicate_name, const std::function< bool(void)> &predicate_function) |
Set the value of the predicate given as parameter, if the predicate is not found does not do anything. More... | |
void | add_trigger (const std::string &trigger_name) |
Add a trigger to the component. Triggers are predicates that are always false except when it's triggered in which case it is set back to false immediately after it is read. More... | |
void | trigger (const std::string &trigger_name) |
Latch the trigger with the provided name. More... | |
void | declare_input (const std::string &signal_name, const std::string &default_topic="", bool fixed_topic=false) |
Declare an input to create the topic parameter without adding it to the map of inputs yet. More... | |
void | declare_output (const std::string &signal_name, const std::string &default_topic="", bool fixed_topic=false) |
Declare an output to create the topic parameter without adding it to the map of outputs yet. More... | |
void | remove_input (const std::string &signal_name) |
Remove an input from the map of inputs. More... | |
void | remove_output (const std::string &signal_name) |
Remove an output from the map of outputs. More... | |
void | add_input (const std::string &signal_name, const std::shared_ptr< DataT > &data, const std::string &default_topic="", bool fixed_topic=false) |
Add and configure an input signal of the component. More... | |
void | add_input (const std::string &signal_name, const std::shared_ptr< DataT > &data, const std::function< void()> &callback, const std::string &default_topic="", bool fixed_topic=false) |
Add and configure an input signal of the component. More... | |
void | add_input (const std::string &signal_name, const std::function< void(const std::shared_ptr< MsgT >)> &callback, const std::string &default_topic="", bool fixed_topic=false) |
Add and configure an input signal of the component. More... | |
void | add_service (const std::string &service_name, const std::function< ComponentServiceResponse(void)> &callback) |
Add a service to trigger a callback function with no input arguments. More... | |
void | add_service (const std::string &service_name, const std::function< ComponentServiceResponse(const std::string &string)> &callback) |
Add a service to trigger a callback function with a string payload. More... | |
void | add_periodic_callback (const std::string &name, const std::function< void(void)> &callback) |
Add a periodic callback function. More... | |
void | add_tf_broadcaster () |
Configure a transform broadcaster. More... | |
void | add_static_tf_broadcaster () |
Configure a static transform broadcaster. More... | |
void | add_tf_listener () |
Configure a transform buffer and listener. More... | |
std::string | create_output (const std::string &signal_name, const std::shared_ptr< DataT > &data, const std::string &default_topic, bool fixed_topic, bool publish_on_step) |
Helper function to parse the signal name and add an unconfigured PublisherInterface to the map of outputs. More... | |
rclcpp::QoS | get_qos () const |
Getter of the Quality of Service attribute. More... | |
void | set_qos (const rclcpp::QoS &qos) |
Set the Quality of Service for ROS publishers and subscribers. More... | |
void | publish_output (const std::string &signal_name) |
Trigger the publishing of an output. More... | |
void | send_transform (const state_representation::CartesianPose &transform) |
Send a transform to TF. More... | |
void | send_transforms (const std::vector< state_representation::CartesianPose > &transforms) |
Send a vector of transforms to TF. More... | |
void | send_static_transform (const state_representation::CartesianPose &transform) |
Send a static transform to TF. More... | |
void | send_static_transforms (const std::vector< state_representation::CartesianPose > &transforms) |
Send a vector of static transforms to TF. More... | |
state_representation::CartesianPose | lookup_transform (const std::string &frame, const std::string &reference_frame, const tf2::TimePoint &time_point, const tf2::Duration &duration) |
Look up a transform from TF. More... | |
state_representation::CartesianPose | lookup_transform (const std::string &frame, const std::string &reference_frame="world", double validity_period=-1.0, const tf2::Duration &duration=tf2::Duration(std::chrono::microseconds(10))) |
Look up a transform from TF. More... | |
void | publish_predicate (const std::string &name) |
Helper function to publish a predicate. More... | |
void | publish_predicates () |
Helper function to publish all predicates. More... | |
void | publish_outputs () |
Helper function to publish all output signals. More... | |
void | evaluate_periodic_callbacks () |
Helper function to evaluate all periodic function callbacks. More... | |
void | publish_transforms (const std::vector< state_representation::CartesianPose > &transforms, const std::shared_ptr< T > &tf_broadcaster, bool is_static=false) |
Helper function to send a vector of transforms through a transform broadcaster. More... | |
virtual void | raise_error () |
Put the component in error state by setting the 'in_error_state' predicate to true. More... | |
+Friends | |
class | ComponentPublicInterface |
+Additional Inherited Members | |
Protected Attributes inherited from modulo_components::ComponentInterface< rclcpp::Node > | |
std::map< std::string, std::shared_ptr< modulo_core::communication::SubscriptionInterface > > | inputs_ |
Map of inputs. More... | |
std::map< std::string, std::shared_ptr< modulo_core::communication::PublisherInterface > > | outputs_ |
Map of outputs. More... | |
std::map< std::string, bool > | periodic_outputs_ |
Map of outputs with periodic publishing flag. More... | |
rclcpp::QoS | qos_ |
Quality of Service for ROS publishers and subscribers. More... | |
A wrapper for rclcpp::Node to simplify application composition through unified component interfaces.
+This class is intended for direct inheritance to implement custom components that perform one-shot or externally triggered operations. Examples of triggered behavior include providing a service, processing signals or publishing outputs on a periodic timer. One-shot behaviors may include interacting with the filesystem or publishing a predefined sequence of outputs. Developers should override on_validate_parameter_callback() if any parameters are added and on_execute_callback() to implement any one-shot behavior. In the latter case, execute() should be invoked at the end of the derived constructor.
Definition at line 26 of file Component.hpp.
+
+
|
+ +explicit | +
Constructor from node options.
+node_options | Node options as used in ROS2 Node |
fallback_name | The name of the component if it was not provided through the node options |
Definition at line 7 of file Component.cpp.
+ +
+
|
+ +inlineprotected | +
Add and configure an output signal of the component.
+DataT | Type of the data pointer |
signal_name | Name of the output signal |
data | Data to transmit on the output signal |
default_topic | If set, the default value for the topic name to use |
fixed_topic | If true, the topic name of the output signal is fixed |
publish_on_step | If true, the output is published periodically on step |
Definition at line 95 of file Component.hpp.
+ +
+
|
+ +protected | +
Start the execution thread.
+ +Definition at line 23 of file Component.cpp.
+ +
+
|
+ +protectedvirtual | +
Execute the component logic. To be redefined in derived classes.
+Definition at line 47 of file Component.cpp.
+ +
+
|
+ +friend | +
Definition at line 28 of file Component.hpp.
+ +
+ Modulo 3.0.0
+
+ |
+
This is the complete list of members for modulo_components::ComponentInterface< NodeT >, including all inherited members.
+add_input(const std::string &signal_name, const std::shared_ptr< DataT > &data, const std::string &default_topic="", bool fixed_topic=false) | modulo_components::ComponentInterface< NodeT > | inlineprotected |
add_input(const std::string &signal_name, const std::shared_ptr< DataT > &data, const std::function< void()> &callback, const std::string &default_topic="", bool fixed_topic=false) | modulo_components::ComponentInterface< NodeT > | inlineprotected |
add_input(const std::string &signal_name, const std::function< void(const std::shared_ptr< MsgT >)> &callback, const std::string &default_topic="", bool fixed_topic=false) | modulo_components::ComponentInterface< NodeT > | inlineprotected |
add_parameter(const std::shared_ptr< state_representation::ParameterInterface > ¶meter, const std::string &description, bool read_only=false) | modulo_components::ComponentInterface< NodeT > | inlineprotected |
add_parameter(const std::string &name, const T &value, const std::string &description, bool read_only=false) | modulo_components::ComponentInterface< NodeT > | inlineprotected |
add_periodic_callback(const std::string &name, const std::function< void(void)> &callback) | modulo_components::ComponentInterface< NodeT > | inlineprotected |
add_predicate(const std::string &predicate_name, bool predicate_value) | modulo_components::ComponentInterface< NodeT > | inlineprotected |
add_predicate(const std::string &predicate_name, const std::function< bool(void)> &predicate_function) | modulo_components::ComponentInterface< NodeT > | inlineprotected |
add_service(const std::string &service_name, const std::function< ComponentServiceResponse(void)> &callback) | modulo_components::ComponentInterface< NodeT > | inlineprotected |
add_service(const std::string &service_name, const std::function< ComponentServiceResponse(const std::string &string)> &callback) | modulo_components::ComponentInterface< NodeT > | inlineprotected |
add_static_tf_broadcaster() | modulo_components::ComponentInterface< NodeT > | inlineprotected |
add_tf_broadcaster() | modulo_components::ComponentInterface< NodeT > | inlineprotected |
add_tf_listener() | modulo_components::ComponentInterface< NodeT > | inlineprotected |
add_trigger(const std::string &trigger_name) | modulo_components::ComponentInterface< NodeT > | inlineprotected |
ComponentInterface(const rclcpp::NodeOptions &node_options, modulo_core::communication::PublisherType publisher_type, const std::string &fallback_name="ComponentInterface") | modulo_components::ComponentInterface< NodeT > | explicit |
ComponentInterfacePublicInterface< rclcpp::Node > (defined in modulo_components::ComponentInterface< NodeT >) | modulo_components::ComponentInterface< NodeT > | friend |
ComponentInterfacePublicInterface< rclcpp_lifecycle::LifecycleNode > (defined in modulo_components::ComponentInterface< NodeT >) | modulo_components::ComponentInterface< NodeT > | friend |
create_output(const std::string &signal_name, const std::shared_ptr< DataT > &data, const std::string &default_topic, bool fixed_topic, bool publish_on_step) | modulo_components::ComponentInterface< NodeT > | inlineprotected |
declare_input(const std::string &signal_name, const std::string &default_topic="", bool fixed_topic=false) | modulo_components::ComponentInterface< NodeT > | inlineprotected |
declare_output(const std::string &signal_name, const std::string &default_topic="", bool fixed_topic=false) | modulo_components::ComponentInterface< NodeT > | inlineprotected |
evaluate_periodic_callbacks() | modulo_components::ComponentInterface< NodeT > | inlineprotected |
get_parameter(const std::string &name) const | modulo_components::ComponentInterface< NodeT > | inlineprotected |
get_parameter_value(const std::string &name) const | modulo_components::ComponentInterface< NodeT > | inlineprotected |
get_predicate(const std::string &predicate_name) | modulo_components::ComponentInterface< NodeT > | inlineprotected |
get_qos() const | modulo_components::ComponentInterface< NodeT > | inlineprotected |
inputs_ | modulo_components::ComponentInterface< NodeT > | protected |
lookup_transform(const std::string &frame, const std::string &reference_frame, const tf2::TimePoint &time_point, const tf2::Duration &duration) | modulo_components::ComponentInterface< NodeT > | inlineprotected |
lookup_transform(const std::string &frame, const std::string &reference_frame="world", double validity_period=-1.0, const tf2::Duration &duration=tf2::Duration(std::chrono::microseconds(10))) | modulo_components::ComponentInterface< NodeT > | inlineprotected |
on_validate_parameter_callback(const std::shared_ptr< state_representation::ParameterInterface > ¶meter) | modulo_components::ComponentInterface< NodeT > | inlineprotectedvirtual |
outputs_ | modulo_components::ComponentInterface< NodeT > | protected |
periodic_outputs_ | modulo_components::ComponentInterface< NodeT > | protected |
publish_output(const std::string &signal_name) | modulo_components::ComponentInterface< NodeT > | inlineprotected |
publish_outputs() | modulo_components::ComponentInterface< NodeT > | inlineprotected |
publish_predicate(const std::string &name) | modulo_components::ComponentInterface< NodeT > | inlineprotected |
publish_predicates() | modulo_components::ComponentInterface< NodeT > | inlineprotected |
publish_transforms(const std::vector< state_representation::CartesianPose > &transforms, const std::shared_ptr< T > &tf_broadcaster, bool is_static=false) | modulo_components::ComponentInterface< NodeT > | inlineprotected |
qos_ | modulo_components::ComponentInterface< NodeT > | protected |
raise_error() | modulo_components::ComponentInterface< NodeT > | inlineprotectedvirtual |
remove_input(const std::string &signal_name) | modulo_components::ComponentInterface< NodeT > | inlineprotected |
remove_output(const std::string &signal_name) | modulo_components::ComponentInterface< NodeT > | inlineprotected |
send_static_transform(const state_representation::CartesianPose &transform) | modulo_components::ComponentInterface< NodeT > | inlineprotected |
send_static_transforms(const std::vector< state_representation::CartesianPose > &transforms) | modulo_components::ComponentInterface< NodeT > | inlineprotected |
send_transform(const state_representation::CartesianPose &transform) | modulo_components::ComponentInterface< NodeT > | inlineprotected |
send_transforms(const std::vector< state_representation::CartesianPose > &transforms) | modulo_components::ComponentInterface< NodeT > | inlineprotected |
set_parameter_value(const std::string &name, const T &value) | modulo_components::ComponentInterface< NodeT > | inlineprotected |
set_predicate(const std::string &predicate_name, bool predicate_value) | modulo_components::ComponentInterface< NodeT > | inlineprotected |
set_predicate(const std::string &predicate_name, const std::function< bool(void)> &predicate_function) | modulo_components::ComponentInterface< NodeT > | inlineprotected |
set_qos(const rclcpp::QoS &qos) | modulo_components::ComponentInterface< NodeT > | inlineprotected |
step() | modulo_components::ComponentInterface< NodeT > | inlineprotectedvirtual |
trigger(const std::string &trigger_name) | modulo_components::ComponentInterface< NodeT > | inlineprotected |
~ComponentInterface()=default | modulo_components::ComponentInterface< NodeT > | virtual |
+ Modulo 3.0.0
+
+ |
+
Base interface class for modulo components to wrap a ROS Node with custom behaviour. + More...
+ +#include <ComponentInterface.hpp>
+Public Member Functions | |
ComponentInterface (const rclcpp::NodeOptions &node_options, modulo_core::communication::PublisherType publisher_type, const std::string &fallback_name="ComponentInterface") | |
Constructor from node options. More... | |
+virtual | ~ComponentInterface ()=default |
Virtual default destructor. | |
+Protected Member Functions | |
virtual void | step () |
Step function that is called periodically. More... | |
void | add_parameter (const std::shared_ptr< state_representation::ParameterInterface > ¶meter, const std::string &description, bool read_only=false) |
Add a parameter. More... | |
template<typename T > | |
void | add_parameter (const std::string &name, const T &value, const std::string &description, bool read_only=false) |
Add a parameter. More... | |
std::shared_ptr< state_representation::ParameterInterface > | get_parameter (const std::string &name) const |
Get a parameter by name. More... | |
template<typename T > | |
T | get_parameter_value (const std::string &name) const |
Get a parameter value by name. More... | |
template<typename T > | |
void | set_parameter_value (const std::string &name, const T &value) |
Set the value of a parameter. More... | |
virtual bool | on_validate_parameter_callback (const std::shared_ptr< state_representation::ParameterInterface > ¶meter) |
Parameter validation function to be redefined by derived Component classes. More... | |
void | add_predicate (const std::string &predicate_name, bool predicate_value) |
Add a predicate to the map of predicates. More... | |
void | add_predicate (const std::string &predicate_name, const std::function< bool(void)> &predicate_function) |
Add a predicate to the map of predicates based on a function to periodically call. More... | |
bool | get_predicate (const std::string &predicate_name) |
Get the logical value of a predicate. More... | |
void | set_predicate (const std::string &predicate_name, bool predicate_value) |
Set the value of the predicate given as parameter, if the predicate is not found does not do anything. More... | |
void | set_predicate (const std::string &predicate_name, const std::function< bool(void)> &predicate_function) |
Set the value of the predicate given as parameter, if the predicate is not found does not do anything. More... | |
void | add_trigger (const std::string &trigger_name) |
Add a trigger to the component. Triggers are predicates that are always false except when it's triggered in which case it is set back to false immediately after it is read. More... | |
void | trigger (const std::string &trigger_name) |
Latch the trigger with the provided name. More... | |
void | declare_input (const std::string &signal_name, const std::string &default_topic="", bool fixed_topic=false) |
Declare an input to create the topic parameter without adding it to the map of inputs yet. More... | |
void | declare_output (const std::string &signal_name, const std::string &default_topic="", bool fixed_topic=false) |
Declare an output to create the topic parameter without adding it to the map of outputs yet. More... | |
void | remove_input (const std::string &signal_name) |
Remove an input from the map of inputs. More... | |
void | remove_output (const std::string &signal_name) |
Remove an output from the map of outputs. More... | |
template<typename DataT > | |
void | add_input (const std::string &signal_name, const std::shared_ptr< DataT > &data, const std::string &default_topic="", bool fixed_topic=false) |
Add and configure an input signal of the component. More... | |
template<typename DataT > | |
void | add_input (const std::string &signal_name, const std::shared_ptr< DataT > &data, const std::function< void()> &callback, const std::string &default_topic="", bool fixed_topic=false) |
Add and configure an input signal of the component. More... | |
template<typename MsgT > | |
void | add_input (const std::string &signal_name, const std::function< void(const std::shared_ptr< MsgT >)> &callback, const std::string &default_topic="", bool fixed_topic=false) |
Add and configure an input signal of the component. More... | |
void | add_service (const std::string &service_name, const std::function< ComponentServiceResponse(void)> &callback) |
Add a service to trigger a callback function with no input arguments. More... | |
void | add_service (const std::string &service_name, const std::function< ComponentServiceResponse(const std::string &string)> &callback) |
Add a service to trigger a callback function with a string payload. More... | |
void | add_periodic_callback (const std::string &name, const std::function< void(void)> &callback) |
Add a periodic callback function. More... | |
void | add_tf_broadcaster () |
Configure a transform broadcaster. More... | |
void | add_static_tf_broadcaster () |
Configure a static transform broadcaster. More... | |
void | add_tf_listener () |
Configure a transform buffer and listener. More... | |
template<typename DataT > | |
std::string | create_output (const std::string &signal_name, const std::shared_ptr< DataT > &data, const std::string &default_topic, bool fixed_topic, bool publish_on_step) |
Helper function to parse the signal name and add an unconfigured PublisherInterface to the map of outputs. More... | |
rclcpp::QoS | get_qos () const |
Getter of the Quality of Service attribute. More... | |
void | set_qos (const rclcpp::QoS &qos) |
Set the Quality of Service for ROS publishers and subscribers. More... | |
void | publish_output (const std::string &signal_name) |
Trigger the publishing of an output. More... | |
void | send_transform (const state_representation::CartesianPose &transform) |
Send a transform to TF. More... | |
void | send_transforms (const std::vector< state_representation::CartesianPose > &transforms) |
Send a vector of transforms to TF. More... | |
void | send_static_transform (const state_representation::CartesianPose &transform) |
Send a static transform to TF. More... | |
void | send_static_transforms (const std::vector< state_representation::CartesianPose > &transforms) |
Send a vector of static transforms to TF. More... | |
state_representation::CartesianPose | lookup_transform (const std::string &frame, const std::string &reference_frame, const tf2::TimePoint &time_point, const tf2::Duration &duration) |
Look up a transform from TF. More... | |
state_representation::CartesianPose | lookup_transform (const std::string &frame, const std::string &reference_frame="world", double validity_period=-1.0, const tf2::Duration &duration=tf2::Duration(std::chrono::microseconds(10))) |
Look up a transform from TF. More... | |
void | publish_predicate (const std::string &name) |
Helper function to publish a predicate. More... | |
void | publish_predicates () |
Helper function to publish all predicates. More... | |
void | publish_outputs () |
Helper function to publish all output signals. More... | |
void | evaluate_periodic_callbacks () |
Helper function to evaluate all periodic function callbacks. More... | |
template<typename T > | |
void | publish_transforms (const std::vector< state_representation::CartesianPose > &transforms, const std::shared_ptr< T > &tf_broadcaster, bool is_static=false) |
Helper function to send a vector of transforms through a transform broadcaster. More... | |
virtual void | raise_error () |
Put the component in error state by setting the 'in_error_state' predicate to true. More... | |
+Protected Attributes | |
std::map< std::string, std::shared_ptr< modulo_core::communication::SubscriptionInterface > > | inputs_ |
Map of inputs. More... | |
std::map< std::string, std::shared_ptr< modulo_core::communication::PublisherInterface > > | outputs_ |
Map of outputs. More... | |
std::map< std::string, bool > | periodic_outputs_ |
Map of outputs with periodic publishing flag. More... | |
rclcpp::QoS | qos_ = rclcpp::QoS(10) |
Quality of Service for ROS publishers and subscribers. More... | |
+Friends | |
class | ComponentInterfacePublicInterface< rclcpp::Node > |
class | ComponentInterfacePublicInterface< rclcpp_lifecycle::LifecycleNode > |
Base interface class for modulo components to wrap a ROS Node with custom behaviour.
+This class is not intended for direct inheritance and usage by end-users. Instead, it defines the common interfaces for the derived classes modulo_components::Component and modulo_components::LifecycleComponent.
NodeT | The rclcpp Node type |
Definition at line 73 of file ComponentInterface.hpp.
+
+
|
+ +explicit | +
Constructor from node options.
+node_options | Node options as used in ROS2 Node / LifecycleNode |
publisher_type | The type of publisher that also indicates if the component is lifecycle or not |
fallback_name | The name of the component if it was not provided through the node options |
Definition at line 588 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Add and configure an input signal of the component.
+MsgT | The ROS message type of the subscription |
signal_name | Name of the input signal |
callback | The callback to use for the subscription |
default_topic | If set, the default value for the topic name to use |
fixed_topic | If true, the topic name of the input signal is fixed |
Definition at line 1029 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Add and configure an input signal of the component.
+DataT | Type of the data pointer |
signal_name | Name of the input signal |
data | Data to receive on the input signal |
callback | Callback function to trigger after receiving the input signal |
default_topic | If set, the default value for the topic name to use |
fixed_topic | If true, the topic name of the input signal is fixed |
Definition at line 959 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Add and configure an input signal of the component.
+DataT | Type of the data pointer |
signal_name | Name of the input signal |
data | Data to receive on the input signal |
default_topic | If set, the default value for the topic name to use |
fixed_topic | If true, the topic name of the input signal is fixed |
Definition at line 950 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Add a parameter.
+This method stores a pointer reference to an existing Parameter object in the local parameter map and declares the equivalent ROS parameter on the ROS interface.
parameter | A ParameterInterface pointer to a Parameter instance |
description | The description of the parameter |
read_only | If true, the value of the parameter cannot be changed after declaration @raise ComponentParameterError if the parameter could not be added |
Definition at line 636 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Add a parameter.
+This method creates a new Parameter object instance to reference in the local parameter map and declares the equivalent ROS parameter on the ROS interface.
T | The type of the parameter |
name | The name of the parameter |
value | The value of the parameter |
description | The description of the parameter |
read_only | If true, the value of the parameter cannot be changed after declaration @raise ComponentParameterError if the parameter could not be added |
Definition at line 614 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Add a periodic callback function.
+The provided function is evaluated periodically at the component step period.
name | The name of the callback |
callback | The callback function that is evaluated periodically |
Definition at line 1120 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Add a predicate to the map of predicates.
+predicate_name | the name of the associated predicate |
predicate_value | the boolean value of the predicate |
Definition at line 756 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Add a predicate to the map of predicates based on a function to periodically call.
+predicate_name | the name of the associated predicate |
predicate_function | the function to call that returns the value of the predicate |
Definition at line 761 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Add a service to trigger a callback function with a string payload.
+The string payload can have an arbitrary format to parameterize and control the callback behaviour as desired. It is the responsibility of the service callback to parse the string according to some payload format. When adding a service with a string payload, be sure to document the payload format appropriately.
service_name | The name of the service |
callback | A service callback function with a string argument that returns a ComponentServiceResponse |
Definition at line 1092 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Add a service to trigger a callback function with no input arguments.
+service_name | The name of the service |
callback | A service callback function with no arguments that returns a ComponentServiceResponse |
Definition at line 1065 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Configure a static transform broadcaster.
+ +Definition at line 1145 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Configure a transform broadcaster.
+ +Definition at line 1134 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Configure a transform buffer and listener.
+ +Definition at line 1158 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Add a trigger to the component. Triggers are predicates that are always false except when it's triggered in which case it is set back to false immediately after it is read.
+trigger_name | The name of the trigger |
Definition at line 812 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Helper function to parse the signal name and add an unconfigured PublisherInterface to the map of outputs.
+DataT | Type of the data pointer |
signal_name | Name of the output signal |
data | Data to transmit on the output signal |
default_topic | If set, the default value for the topic name to use |
fixed_topic | If true, the topic name of the output signal is fixed |
publish_on_step | If true, the output is published periodically on step |
modulo_components::exceptions::AddSignalException | if the output could not be created (empty name, already registered) |
Definition at line 1320 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Declare an input to create the topic parameter without adding it to the map of inputs yet.
+signal_name | The signal name of the input |
default_topic | If set, the default value for the topic name to use |
fixed_topic | If true, the topic name of the signal is fixed |
modulo_components::exceptions::AddSignalException | if the input could not be declared (empty name or already created) |
Definition at line 935 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Declare an output to create the topic parameter without adding it to the map of outputs yet.
+signal_name | The signal name of the output |
default_topic | If set, the default value for the topic name to use |
fixed_topic | If true, the topic name of the signal is fixed |
modulo_components::exceptions::AddSignalException | if the output could not be declared (empty name or already created) |
Definition at line 942 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Helper function to evaluate all periodic function callbacks.
+ +Definition at line 1307 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Get a parameter by name.
+name | The name of the parameter |
modulo_components::exceptions::ComponentParameterException | if the parameter could not be found |
Definition at line 679 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Get a parameter value by name.
+T | The type of the parameter |
name | The name of the parameter |
modulo_components::exceptions::ComponentParameterException | if the parameter value could not be accessed |
Definition at line 626 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Get the logical value of a predicate.
+If the predicate is not found or the callable function fails, the return value is false.
predicate_name | the name of the predicate to retrieve from the map of predicates |
Definition at line 784 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Getter of the Quality of Service attribute.
+Definition at line 1354 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Look up a transform from TF.
+frame | The desired frame of the transform |
reference_frame | The desired reference frame of the transform |
time_point | The time at which the value of the transform is desired |
duration | How long to block the lookup call before failing |
modulo_components::exceptions::LookupTransformException | if TF buffer/listener are unconfigured or if the lookupTransform call failed |
Definition at line 1235 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Look up a transform from TF.
+frame | The desired frame of the transform |
reference_frame | The desired reference frame of the transform |
validity_period | The validity period of the latest transform from the time of lookup in seconds |
duration | How long to block the lookup call before failing |
modulo_components::exceptions::LookupTransformException | if TF buffer/listener are unconfigured, if the lookupTransform call failed, or if the transform is too old |
Definition at line 1246 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotectedvirtual | +
Parameter validation function to be redefined by derived Component classes.
+This method is automatically invoked whenever the ROS interface tried to modify a parameter. Validation and sanitization can be performed by reading or writing the value of the parameter through the ParameterInterface pointer, depending on the parameter name and desired component behaviour. If the validation returns true, the updated parameter value (including any modifications) is applied. If the validation returns false, any changes to the parameter are discarded and the parameter value is not changed.
parameter | A ParameterInterface pointer to a Parameter instance |
Definition at line 718 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Trigger the publishing of an output.
+signal_name | The name of the output signal |
ComponentException | if the output is being published periodically or if the signal name could not be found |
Definition at line 1276 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Helper function to publish all output signals.
+ +Definition at line 1293 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Helper function to publish a predicate.
+name | The name of the predicate to publish |
Definition at line 1260 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Helper function to publish all predicates.
+ +Definition at line 1269 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Helper function to send a vector of transforms through a transform broadcaster.
+T | The type of the broadcaster (tf2_ros::TransformBroadcaster or tf2_ros::StaticTransformBroadcaster) |
transforms | The transforms to send |
tf_broadcaster | A pointer to a configured transform broadcaster object |
is_static | If true, treat the broadcaster as a static frame broadcaster for the sake of log messages |
Definition at line 1193 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotectedvirtual | +
Put the component in error state by setting the 'in_error_state' predicate to true.
+ +Definition at line 1348 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Remove an input from the map of inputs.
+signal_name | The name of the input |
Definition at line 884 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Remove an output from the map of outputs.
+signal_name | The name of the output |
Definition at line 895 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Send a static transform to TF.
+transform | The transform to send |
Definition at line 1181 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Send a vector of static transforms to TF.
+transforms | The vector of transforms to send |
Definition at line 1187 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Send a transform to TF.
+transform | The transform to send |
Definition at line 1170 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Send a vector of transforms to TF.
+transforms | The vector of transforms to send |
Definition at line 1176 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Set the value of a parameter.
+The parameter must have been previously declared. This method preserves the reference to the original Parameter instance
T | The type of the parameter |
name | The name of the parameter |
Definition at line 689 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Set the value of the predicate given as parameter, if the predicate is not found does not do anything.
+Even though the predicates are published periodically, the new value of this predicate will be published once immediately after setting it.
predicate_name | the name of the predicate to retrieve from the map of predicates |
predicate_value | the new value of the predicate |
Definition at line 858 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Set the value of the predicate given as parameter, if the predicate is not found does not do anything.
+Even though the predicates are published periodically, the new value of this predicate will be published once immediately after setting it.
predicate_name | the name of the predicate to retrieve from the map of predicates |
predicate_function | the function to call that returns the value of the predicate |
Definition at line 863 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Set the Quality of Service for ROS publishers and subscribers.
+qos | The desired Quality of Service |
Definition at line 1359 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotectedvirtual | +
Step function that is called periodically.
+ +Definition at line 610 of file ComponentInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Latch the trigger with the provided name.
+trigger_name | The name of the trigger |
Definition at line 833 of file ComponentInterface.hpp.
+ +
+
|
+ +friend | +
Definition at line 53 of file ComponentInterface.hpp.
+ +
+
|
+ +friend | +
Definition at line 53 of file ComponentInterface.hpp.
+ +
+
|
+ +protected | +
Map of inputs.
+ +Definition at line 472 of file ComponentInterface.hpp.
+ +
+
|
+ +protected | +
Map of outputs.
+ +Definition at line 473 of file ComponentInterface.hpp.
+ +
+
|
+ +protected | +
Map of outputs with periodic publishing flag.
+ +Definition at line 474 of file ComponentInterface.hpp.
+ +
+
|
+ +protected | +
Quality of Service for ROS publishers and subscribers.
+ +Definition at line 476 of file ComponentInterface.hpp.
+ +
+ Modulo 3.0.0
+
+ |
+
Friend class to the ComponentInterface to allow test fixtures to access protected and private members. + More...
+ +#include <ComponentInterface.hpp>
Friend class to the ComponentInterface to allow test fixtures to access protected and private members.
+NodeT | The rclcpp Node type |
Definition at line 62 of file ComponentInterface.hpp.
+
+ Modulo 3.0.0
+
+ |
+
This is the complete list of members for modulo_components::LifecycleComponent, including all inherited members.
+
+ Modulo 3.0.0
+
+ |
+
A wrapper for rclcpp_lifecycle::LifecycleNode to simplify application composition through unified component interfaces while supporting lifecycle states and transitions. + More...
+ +#include <LifecycleComponent.hpp>
+Public Member Functions | |
LifecycleComponent (const rclcpp::NodeOptions &node_options, const std::string &fallback_name="LifecycleComponent") | |
Constructor from node options. More... | |
+virtual | ~LifecycleComponent ()=default |
Virtual default destructor. | |
Public Member Functions inherited from modulo_components::ComponentInterface< rclcpp_lifecycle::LifecycleNode > | |
ComponentInterface (const rclcpp::NodeOptions &node_options, modulo_core::communication::PublisherType publisher_type, const std::string &fallback_name="ComponentInterface") | |
Constructor from node options. More... | |
+virtual | ~ComponentInterface ()=default |
Virtual default destructor. | |
+Protected Member Functions | |
virtual bool | on_configure_callback () |
Steps to execute when configuring the component. More... | |
virtual bool | on_cleanup_callback () |
Steps to execute when cleaning up the component. More... | |
virtual bool | on_activate_callback () |
Steps to execute when activating the component. More... | |
virtual bool | on_deactivate_callback () |
Steps to execute when deactivating the component. More... | |
virtual bool | on_shutdown_callback () |
Steps to execute when shutting down the component. More... | |
virtual bool | on_error_callback () |
Steps to execute when handling errors. More... | |
virtual void | on_step_callback () |
Steps to execute periodically. To be redefined by derived Component classes. More... | |
template<typename DataT > | |
void | add_output (const std::string &signal_name, const std::shared_ptr< DataT > &data, const std::string &default_topic="", bool fixed_topic=false, bool publish_on_step=true) |
Add an output signal of the component. More... | |
Protected Member Functions inherited from modulo_components::ComponentInterface< rclcpp_lifecycle::LifecycleNode > | |
virtual void | step () |
Step function that is called periodically. More... | |
void | add_parameter (const std::shared_ptr< state_representation::ParameterInterface > ¶meter, const std::string &description, bool read_only=false) |
Add a parameter. More... | |
void | add_parameter (const std::string &name, const T &value, const std::string &description, bool read_only=false) |
Add a parameter. More... | |
std::shared_ptr< state_representation::ParameterInterface > | get_parameter (const std::string &name) const |
Get a parameter by name. More... | |
T | get_parameter_value (const std::string &name) const |
Get a parameter value by name. More... | |
void | set_parameter_value (const std::string &name, const T &value) |
Set the value of a parameter. More... | |
virtual bool | on_validate_parameter_callback (const std::shared_ptr< state_representation::ParameterInterface > ¶meter) |
Parameter validation function to be redefined by derived Component classes. More... | |
void | add_predicate (const std::string &predicate_name, bool predicate_value) |
Add a predicate to the map of predicates. More... | |
void | add_predicate (const std::string &predicate_name, const std::function< bool(void)> &predicate_function) |
Add a predicate to the map of predicates based on a function to periodically call. More... | |
bool | get_predicate (const std::string &predicate_name) |
Get the logical value of a predicate. More... | |
void | set_predicate (const std::string &predicate_name, bool predicate_value) |
Set the value of the predicate given as parameter, if the predicate is not found does not do anything. More... | |
void | set_predicate (const std::string &predicate_name, const std::function< bool(void)> &predicate_function) |
Set the value of the predicate given as parameter, if the predicate is not found does not do anything. More... | |
void | add_trigger (const std::string &trigger_name) |
Add a trigger to the component. Triggers are predicates that are always false except when it's triggered in which case it is set back to false immediately after it is read. More... | |
void | trigger (const std::string &trigger_name) |
Latch the trigger with the provided name. More... | |
void | declare_input (const std::string &signal_name, const std::string &default_topic="", bool fixed_topic=false) |
Declare an input to create the topic parameter without adding it to the map of inputs yet. More... | |
void | declare_output (const std::string &signal_name, const std::string &default_topic="", bool fixed_topic=false) |
Declare an output to create the topic parameter without adding it to the map of outputs yet. More... | |
void | remove_input (const std::string &signal_name) |
Remove an input from the map of inputs. More... | |
void | remove_output (const std::string &signal_name) |
Remove an output from the map of outputs. More... | |
void | add_input (const std::string &signal_name, const std::shared_ptr< DataT > &data, const std::string &default_topic="", bool fixed_topic=false) |
Add and configure an input signal of the component. More... | |
void | add_input (const std::string &signal_name, const std::shared_ptr< DataT > &data, const std::function< void()> &callback, const std::string &default_topic="", bool fixed_topic=false) |
Add and configure an input signal of the component. More... | |
void | add_input (const std::string &signal_name, const std::function< void(const std::shared_ptr< MsgT >)> &callback, const std::string &default_topic="", bool fixed_topic=false) |
Add and configure an input signal of the component. More... | |
void | add_service (const std::string &service_name, const std::function< ComponentServiceResponse(void)> &callback) |
Add a service to trigger a callback function with no input arguments. More... | |
void | add_service (const std::string &service_name, const std::function< ComponentServiceResponse(const std::string &string)> &callback) |
Add a service to trigger a callback function with a string payload. More... | |
void | add_periodic_callback (const std::string &name, const std::function< void(void)> &callback) |
Add a periodic callback function. More... | |
void | add_tf_broadcaster () |
Configure a transform broadcaster. More... | |
void | add_static_tf_broadcaster () |
Configure a static transform broadcaster. More... | |
void | add_tf_listener () |
Configure a transform buffer and listener. More... | |
std::string | create_output (const std::string &signal_name, const std::shared_ptr< DataT > &data, const std::string &default_topic, bool fixed_topic, bool publish_on_step) |
Helper function to parse the signal name and add an unconfigured PublisherInterface to the map of outputs. More... | |
rclcpp::QoS | get_qos () const |
Getter of the Quality of Service attribute. More... | |
void | set_qos (const rclcpp::QoS &qos) |
Set the Quality of Service for ROS publishers and subscribers. More... | |
void | publish_output (const std::string &signal_name) |
Trigger the publishing of an output. More... | |
void | send_transform (const state_representation::CartesianPose &transform) |
Send a transform to TF. More... | |
void | send_transforms (const std::vector< state_representation::CartesianPose > &transforms) |
Send a vector of transforms to TF. More... | |
void | send_static_transform (const state_representation::CartesianPose &transform) |
Send a static transform to TF. More... | |
void | send_static_transforms (const std::vector< state_representation::CartesianPose > &transforms) |
Send a vector of static transforms to TF. More... | |
state_representation::CartesianPose | lookup_transform (const std::string &frame, const std::string &reference_frame, const tf2::TimePoint &time_point, const tf2::Duration &duration) |
Look up a transform from TF. More... | |
state_representation::CartesianPose | lookup_transform (const std::string &frame, const std::string &reference_frame="world", double validity_period=-1.0, const tf2::Duration &duration=tf2::Duration(std::chrono::microseconds(10))) |
Look up a transform from TF. More... | |
void | publish_predicate (const std::string &name) |
Helper function to publish a predicate. More... | |
void | publish_predicates () |
Helper function to publish all predicates. More... | |
void | publish_outputs () |
Helper function to publish all output signals. More... | |
void | evaluate_periodic_callbacks () |
Helper function to evaluate all periodic function callbacks. More... | |
void | publish_transforms (const std::vector< state_representation::CartesianPose > &transforms, const std::shared_ptr< T > &tf_broadcaster, bool is_static=false) |
Helper function to send a vector of transforms through a transform broadcaster. More... | |
virtual void | raise_error () |
Put the component in error state by setting the 'in_error_state' predicate to true. More... | |
+Friends | |
class | LifecycleComponentPublicInterface |
+Additional Inherited Members | |
Protected Attributes inherited from modulo_components::ComponentInterface< rclcpp_lifecycle::LifecycleNode > | |
std::map< std::string, std::shared_ptr< modulo_core::communication::SubscriptionInterface > > | inputs_ |
Map of inputs. More... | |
std::map< std::string, std::shared_ptr< modulo_core::communication::PublisherInterface > > | outputs_ |
Map of outputs. More... | |
std::map< std::string, bool > | periodic_outputs_ |
Map of outputs with periodic publishing flag. More... | |
rclcpp::QoS | qos_ |
Quality of Service for ROS publishers and subscribers. More... | |
A wrapper for rclcpp_lifecycle::LifecycleNode to simplify application composition through unified component interfaces while supporting lifecycle states and transitions.
+This class is intended for direct inheritance to implement custom state-based components that perform different behaviors based on their state and on state transitions. An example of state-based behaviour is a signal component that requires configuration steps to determine which inputs to register and subsequently should publish outputs only when the component is activated. Developers should override on_validate_parameter_callback() if any parameters are added. In addition, the following state transition callbacks should be overridden whenever custom transition behavior is needed:
Definition at line 30 of file LifecycleComponent.hpp.
+
+
|
+ +explicit | +
Constructor from node options.
+node_options | Node options as used in ROS2 LifecycleNode |
fallback_name | The name of the component if it was not provided through the node options |
Definition at line 9 of file LifecycleComponent.cpp.
+ +
+
|
+ +inlineprotected | +
Add an output signal of the component.
+DataT | Type of the data pointer |
signal_name | Name of the output signal |
data | Data to transmit on the output signal |
default_topic | If set, the default value for the topic name to use |
fixed_topic | If true, the topic name of the output signal is fixed |
publish_on_step | If true, the output is published periodically on step |
Definition at line 277 of file LifecycleComponent.hpp.
+ +
+
|
+ +protectedvirtual | +
Steps to execute when activating the component.
+This method can be overridden by derived Component classes. Activation generally involves final setup steps before the on_step callback is periodically evaluated.
Definition at line 123 of file LifecycleComponent.cpp.
+ +
+
|
+ +protectedvirtual | +
Steps to execute when cleaning up the component.
+This method can be overridden by derived Component classes. Cleanup generally involves resetting the properties and states to initial conditions.
Definition at line 93 of file LifecycleComponent.cpp.
+ +
+
|
+ +protectedvirtual | +
Steps to execute when configuring the component.
+This method can be overridden by derived Component classes. Configuration generally involves reading parameters and adding inputs and outputs.
Definition at line 71 of file LifecycleComponent.cpp.
+ +
+
|
+ +protectedvirtual | +
Steps to execute when deactivating the component.
+This method can be overridden by derived Component classes. Deactivation generally involves any steps to reset the component to an inactive state.
Definition at line 146 of file LifecycleComponent.cpp.
+ +
+
|
+ +protectedvirtual | +
Steps to execute when handling errors.
+This method can be overridden by derived Component classes. Error handling generally involves recovering and resetting the component to an unconfigured state.
Definition at line 219 of file LifecycleComponent.cpp.
+ +
+
|
+ +protectedvirtual | +
Steps to execute when shutting down the component.
+This method can be overridden by derived Component classes. Shutdown generally involves the destruction of any threads or properties not handled by the base class.
Definition at line 191 of file LifecycleComponent.cpp.
+ +
+
|
+ +inlineprotectedvirtual | +
Steps to execute periodically. To be redefined by derived Component classes.
+ +Definition at line 274 of file LifecycleComponent.hpp.
+ +
+
|
+ +friend | +
Definition at line 32 of file LifecycleComponent.hpp.
+ +
+ Modulo 3.0.0
+
+ |
+
This is the complete list of members for modulo_components::exceptions::AddServiceException, including all inherited members.
+AddServiceException(const std::string &msg) (defined in modulo_components::exceptions::AddServiceException) | modulo_components::exceptions::AddServiceException | inlineexplicit |
ComponentException(const std::string &msg) (defined in modulo_components::exceptions::ComponentException) | modulo_components::exceptions::ComponentException | inlineexplicit |
ComponentException(const std::string &prefix, const std::string &msg) (defined in modulo_components::exceptions::ComponentException) | modulo_components::exceptions::ComponentException | inlineprotected |
+ Modulo 3.0.0
+
+ |
+
An exception class to notify errors when adding a service. + More...
+ +#include <AddServiceException.hpp>
+Public Member Functions | |
AddServiceException (const std::string &msg) | |
Public Member Functions inherited from modulo_components::exceptions::ComponentException | |
ComponentException (const std::string &msg) | |
+Additional Inherited Members | |
Protected Member Functions inherited from modulo_components::exceptions::ComponentException | |
ComponentException (const std::string &prefix, const std::string &msg) | |
An exception class to notify errors when adding a service.
+This is an exception class to be thrown if there is a problem while adding a service to the component.
+ +Definition at line 12 of file AddServiceException.hpp.
+
+
|
+ +inlineexplicit | +
Definition at line 14 of file AddServiceException.hpp.
+ +
+ Modulo 3.0.0
+
+ |
+
This is the complete list of members for modulo_components::exceptions::AddSignalException, including all inherited members.
+AddSignalException(const std::string &msg) (defined in modulo_components::exceptions::AddSignalException) | modulo_components::exceptions::AddSignalException | inlineexplicit |
ComponentException(const std::string &msg) (defined in modulo_components::exceptions::ComponentException) | modulo_components::exceptions::ComponentException | inlineexplicit |
ComponentException(const std::string &prefix, const std::string &msg) (defined in modulo_components::exceptions::ComponentException) | modulo_components::exceptions::ComponentException | inlineprotected |
+ Modulo 3.0.0
+
+ |
+
An exception class to notify errors when adding a signal. + More...
+ +#include <AddSignalException.hpp>
+Public Member Functions | |
AddSignalException (const std::string &msg) | |
Public Member Functions inherited from modulo_components::exceptions::ComponentException | |
ComponentException (const std::string &msg) | |
+Additional Inherited Members | |
Protected Member Functions inherited from modulo_components::exceptions::ComponentException | |
ComponentException (const std::string &prefix, const std::string &msg) | |
An exception class to notify errors when adding a signal.
+This is an exception class to be thrown if there is a problem while adding a signal to the component.
+ +Definition at line 12 of file AddSignalException.hpp.
+
+
|
+ +inlineexplicit | +
Definition at line 14 of file AddSignalException.hpp.
+ +
+ Modulo 3.0.0
+
+ |
+
This is the complete list of members for modulo_components::exceptions::ComponentException, including all inherited members.
+ComponentException(const std::string &msg) (defined in modulo_components::exceptions::ComponentException) | modulo_components::exceptions::ComponentException | inlineexplicit |
ComponentException(const std::string &prefix, const std::string &msg) (defined in modulo_components::exceptions::ComponentException) | modulo_components::exceptions::ComponentException | inlineprotected |
+ Modulo 3.0.0
+
+ |
+
A base class for all component exceptions. + More...
+ +#include <ComponentException.hpp>
+Public Member Functions | |
ComponentException (const std::string &msg) | |
+Protected Member Functions | |
ComponentException (const std::string &prefix, const std::string &msg) | |
A base class for all component exceptions.
+This inherits from std::runtime_exception.
+ +Definition at line 17 of file ComponentException.hpp.
+
+
|
+ +inlineexplicit | +
Definition at line 19 of file ComponentException.hpp.
+ +
+
|
+ +inlineprotected | +
Definition at line 21 of file ComponentException.hpp.
+ +
+ Modulo 3.0.0
+
+ |
+
This is the complete list of members for modulo_components::exceptions::ComponentParameterException, including all inherited members.
+ComponentException(const std::string &msg) (defined in modulo_components::exceptions::ComponentException) | modulo_components::exceptions::ComponentException | inlineexplicit |
ComponentException(const std::string &prefix, const std::string &msg) (defined in modulo_components::exceptions::ComponentException) | modulo_components::exceptions::ComponentException | inlineprotected |
ComponentParameterException(const std::string &msg) (defined in modulo_components::exceptions::ComponentParameterException) | modulo_components::exceptions::ComponentParameterException | inlineexplicit |
+ Modulo 3.0.0
+
+ |
+
An exception class to notify errors with component parameters. + More...
+ +#include <ComponentParameterException.hpp>
+Public Member Functions | |
ComponentParameterException (const std::string &msg) | |
Public Member Functions inherited from modulo_components::exceptions::ComponentException | |
ComponentException (const std::string &msg) | |
+Additional Inherited Members | |
Protected Member Functions inherited from modulo_components::exceptions::ComponentException | |
ComponentException (const std::string &prefix, const std::string &msg) | |
An exception class to notify errors with component parameters.
+This is an exception class to be thrown if there is a problem with component parameters (overriding, inconsistent types, undeclared, ...).
+ +Definition at line 13 of file ComponentParameterException.hpp.
+
+
|
+ +inlineexplicit | +
Definition at line 15 of file ComponentParameterException.hpp.
+ +
+ Modulo 3.0.0
+
+ |
+
This is the complete list of members for modulo_components::exceptions::LookupTransformException, including all inherited members.
+ComponentException(const std::string &msg) (defined in modulo_components::exceptions::ComponentException) | modulo_components::exceptions::ComponentException | inlineexplicit |
ComponentException(const std::string &prefix, const std::string &msg) (defined in modulo_components::exceptions::ComponentException) | modulo_components::exceptions::ComponentException | inlineprotected |
LookupTransformException(const std::string &msg) (defined in modulo_components::exceptions::LookupTransformException) | modulo_components::exceptions::LookupTransformException | inlineexplicit |
+ Modulo 3.0.0
+
+ |
+
An exception class to notify an error while looking up TF transforms. + More...
+ +#include <LookupTransformException.hpp>
+Public Member Functions | |
LookupTransformException (const std::string &msg) | |
Public Member Functions inherited from modulo_components::exceptions::ComponentException | |
ComponentException (const std::string &msg) | |
+Additional Inherited Members | |
Protected Member Functions inherited from modulo_components::exceptions::ComponentException | |
ComponentException (const std::string &prefix, const std::string &msg) | |
An exception class to notify an error while looking up TF transforms.
+This is an exception class to be thrown if there is a problem with looking up a TF transform (unconfigured buffer/listener, TF2 exception).
+ +Definition at line 13 of file LookupTransformException.hpp.
+
+
|
+ +inlineexplicit | +
Definition at line 15 of file LookupTransformException.hpp.
+ +
+ Modulo 3.0.0
+
+ |
+
This is the complete list of members for modulo_core::communication::MessagePair< MsgT, DataT >, including all inherited members.
+
+ Modulo 3.0.0
+
+ |
+
The MessagePair stores a pointer to a variable and translates the value of this pointer back and forth between the corresponding ROS messages. + More...
+ +#include <MessagePair.hpp>
+Public Member Functions | |
MessagePair (std::shared_ptr< DataT > data, std::shared_ptr< rclcpp::Clock > clock) | |
Constructor of the MessagePair. More... | |
MsgT | write_message () const |
Write the value of the data pointer to a ROS message. More... | |
void | read_message (const MsgT &message) |
Read a ROS message and store the value in the data pointer. More... | |
std::shared_ptr< DataT > | get_data () const |
Get the data pointer. More... | |
void | set_data (const std::shared_ptr< DataT > &data) |
Set the data pointer. More... | |
EncodedState | write_message () const |
void | read_message (const EncodedState &message) |
MessagePair (std::shared_ptr< bool > data, std::shared_ptr< rclcpp::Clock > clock) | |
MessagePair (std::shared_ptr< double > data, std::shared_ptr< rclcpp::Clock > clock) | |
MessagePair (std::shared_ptr< std::vector< double > > data, std::shared_ptr< rclcpp::Clock > clock) | |
MessagePair (std::shared_ptr< int > data, std::shared_ptr< rclcpp::Clock > clock) | |
MessagePair (std::shared_ptr< std::string > data, std::shared_ptr< rclcpp::Clock > clock) | |
MessagePair (std::shared_ptr< state_representation::State > data, std::shared_ptr< rclcpp::Clock > clock) | |
The MessagePair stores a pointer to a variable and translates the value of this pointer back and forth between the corresponding ROS messages.
+MsgT | ROS message type of the MessagePair |
DataT | Data type corresponding to the ROS message type |
Definition at line 20 of file MessagePair.hpp.
+modulo_core::communication::MessagePair< MsgT, DataT >::MessagePair | +( | +std::shared_ptr< DataT > | +data, | +
+ | + | std::shared_ptr< rclcpp::Clock > | +clock | +
+ | ) | ++ |
Constructor of the MessagePair.
+data | The pointer referring to the data stored in the MessagePair |
clock | The ROS clock for translating messages |
modulo_core::communication::MessagePair< std_msgs::msg::Bool, bool >::MessagePair | +( | +std::shared_ptr< bool > | +data, | +
+ | + | std::shared_ptr< rclcpp::Clock > | +clock | +
+ | ) | ++ |
Definition at line 8 of file MessagePair.cpp.
+ +modulo_core::communication::MessagePair< std_msgs::msg::Float64, double >::MessagePair | +( | +std::shared_ptr< double > | +data, | +
+ | + | std::shared_ptr< rclcpp::Clock > | +clock | +
+ | ) | ++ |
Definition at line 14 of file MessagePair.cpp.
+ +modulo_core::communication::MessagePair< std_msgs::msg::Float64MultiArray, std::vector< double > >::MessagePair | +( | +std::shared_ptr< std::vector< double > > | +data, | +
+ | + | std::shared_ptr< rclcpp::Clock > | +clock | +
+ | ) | ++ |
Definition at line 20 of file MessagePair.cpp.
+ +modulo_core::communication::MessagePair< std_msgs::msg::Int32, int >::MessagePair | +( | +std::shared_ptr< int > | +data, | +
+ | + | std::shared_ptr< rclcpp::Clock > | +clock | +
+ | ) | ++ |
Definition at line 26 of file MessagePair.cpp.
+ +modulo_core::communication::MessagePair< std_msgs::msg::String, std::string >::MessagePair | +( | +std::shared_ptr< std::string > | +data, | +
+ | + | std::shared_ptr< rclcpp::Clock > | +clock | +
+ | ) | ++ |
Definition at line 32 of file MessagePair.cpp.
+ +modulo_core::communication::MessagePair< EncodedState, state_representation::State >::MessagePair | +( | +std::shared_ptr< state_representation::State > | +data, | +
+ | + | std::shared_ptr< rclcpp::Clock > | +clock | +
+ | ) | ++ |
Definition at line 38 of file MessagePair.cpp.
+ +
+
|
+ +inline | +
Get the data pointer.
+ +Definition at line 98 of file MessagePair.hpp.
+ +
+
|
+ +inline | +
Definition at line 90 of file MessagePair.hpp.
+ +
+
|
+ +inline | +
Read a ROS message and store the value in the data pointer.
+message | The ROS message to read |
modulo_core::exceptions::NullPointerException | if the data pointer is null |
modulo_core::exceptions::MessageTranslationException | if the message could not be read |
Definition at line 82 of file MessagePair.hpp.
+ +
+
|
+ +inline | +
Set the data pointer.
+modulo_core::exceptions::NullPointerException | if the provided data pointer is null |
Definition at line 103 of file MessagePair.hpp.
+ +
+
|
+ +inline | +
Write the value of the data pointer to a ROS message.
+modulo_core::exceptions::NullPointerException | if the data pointer is null |
modulo_core::exceptions::MessageTranslationException | if the data could not be written to message |
Definition at line 62 of file MessagePair.hpp.
+ +
+
|
+ +inline | +
Definition at line 72 of file MessagePair.hpp.
+ +
+ Modulo 3.0.0
+
+ |
+
This is the complete list of members for modulo_core::communication::MessagePairInterface, including all inherited members.
+get_message_pair(bool validate_pointer=true) | modulo_core::communication::MessagePairInterface | inline |
get_type() const | modulo_core::communication::MessagePairInterface | |
MessagePairInterface(MessageType type) | modulo_core::communication::MessagePairInterface | explicit |
MessagePairInterface(const MessagePairInterface &message_pair)=default | modulo_core::communication::MessagePairInterface | |
read(const MsgT &message) | modulo_core::communication::MessagePairInterface | inline |
write() | modulo_core::communication::MessagePairInterface | inline |
~MessagePairInterface()=default | modulo_core::communication::MessagePairInterface | virtual |
+ Modulo 3.0.0
+
+ |
+
Interface class to enable non-templated writing and reading ROS messages from derived MessagePair instances through dynamic down-casting. + More...
+ +#include <MessagePairInterface.hpp>
+Public Member Functions | |
MessagePairInterface (MessageType type) | |
Constructor with the message type. More... | |
+virtual | ~MessagePairInterface ()=default |
Default virtual destructor. | |
+ | MessagePairInterface (const MessagePairInterface &message_pair)=default |
Copy constructor from another MessagePairInterface. | |
template<typename MsgT , typename DataT > | |
std::shared_ptr< MessagePair< MsgT, DataT > > | get_message_pair (bool validate_pointer=true) |
Get a pointer to a derived MessagePair instance from a MessagePairInterface pointer. More... | |
template<typename MsgT , typename DataT > | |
MsgT | write () |
Get the ROS message of a derived MessagePair instance through the MessagePairInterface pointer. More... | |
template<typename MsgT , typename DataT > | |
void | read (const MsgT &message) |
Read a ROS message and set the data of the derived MessagePair instance through the MessagePairInterface pointer. More... | |
MessageType | get_type () const |
Get the MessageType of the MessagePairInterface. More... | |
Interface class to enable non-templated writing and reading ROS messages from derived MessagePair instances through dynamic down-casting.
+ +Definition at line 20 of file MessagePairInterface.hpp.
+
+
|
+ +explicit | +
Constructor with the message type.
+type | The message type of the message pair |
Definition at line 5 of file MessagePairInterface.cpp.
+ +
+
|
+ +inline | +
Get a pointer to a derived MessagePair instance from a MessagePairInterface pointer.
+If a MessagePairInterface pointer is used to address a derived MessagePair instance, this method will return a pointer to that derived instance through dynamic down-casting. The downcast will fail if the base MessagePairInterface object has no reference count (if the object is not owned by any pointer), or if the derived object is not a correctly typed instance of a MessagePair. By default, an InvalidPointerCastException is thrown when the downcast fails. If this validation is disabled by setting the validate_pointer flag to false, it will not throw an exception and instead return a null pointer.
MsgT | The ROS message type of the MessagePair |
DataT | The data type of the MessagePair |
validate_pointer | If true, throw an exception when down-casting fails |
modulo_core::exceptions::InvalidPointerException | if the base MessagePairInterface object has no reference count and validate_pointer is set to true |
modulo_core::exceptions::InvalidPointerCastException | if the derived object from the dynamic down-casting is not a correctly typed instance of a MessagePair |
Definition at line 94 of file MessagePairInterface.hpp.
+ +MessageType modulo_core::communication::MessagePairInterface::get_type | +( | +) | +const | +
Get the MessageType of the MessagePairInterface.
+Definition at line 7 of file MessagePairInterface.cpp.
+ +
+
|
+ +inline | +
Read a ROS message and set the data of the derived MessagePair instance through the MessagePairInterface pointer.
+This throws an InvalidPointerCastException if the MessagePairInterface does not point to a valid MessagePair instance or if the specified types does not match the type of the MessagePair instance.
MsgT | The ROS message type of the MessagePair |
DataT | The data type of the MessagePair |
message | The ROS message to read from |
Definition at line 116 of file MessagePairInterface.hpp.
+ +
+
|
+ +inline | +
Get the ROS message of a derived MessagePair instance through the MessagePairInterface pointer.
+This throws an InvalidPointerCastException if the MessagePairInterface does not point to a valid MessagePair instance or if the specified types does not match the type of the MessagePair instance.
+MsgT | The ROS message type of the MessagePair |
DataT | The data type of the MessagePair |
Definition at line 111 of file MessagePairInterface.hpp.
+ +
+ Modulo 3.0.0
+
+ |
+
This is the complete list of members for modulo_core::communication::PublisherHandler< PubT, MsgT >, including all inherited members.
+
+ Modulo 3.0.0
+
+ |
+
The PublisherHandler handles different types of ROS publishers to activate, deactivate and publish data with those publishers. + More...
+ +#include <PublisherHandler.hpp>
+Public Member Functions | |
PublisherHandler (PublisherType type, std::shared_ptr< PubT > publisher) | |
Constructor with the publisher type and the pointer to the ROS publisher. More... | |
~PublisherHandler () override | |
Destructor to explicitly reset the publisher pointer. More... | |
void | on_activate () |
Activate the ROS publisher if applicable. More... | |
void | on_deactivate () |
Deactivate the ROS publisher if applicable. More... | |
void | publish (const MsgT &message) const |
Publish the ROS message through the ROS publisher. More... | |
std::shared_ptr< PublisherInterface > | create_publisher_interface (const std::shared_ptr< MessagePairInterface > &message_pair) |
Create a PublisherInterface instance from the current PublisherHandler. More... | |
Public Member Functions inherited from modulo_core::communication::PublisherInterface | |
PublisherInterface (PublisherType type, std::shared_ptr< MessagePairInterface > message_pair=nullptr) | |
Constructor with the message type and message pair. More... | |
+ | PublisherInterface (const PublisherInterface &publisher)=default |
Copy constructor from another PublisherInterface. | |
+virtual | ~PublisherInterface ()=default |
Default virtual destructor. | |
template<typename PubT , typename MsgT > | |
std::shared_ptr< PublisherHandler< PubT, MsgT > > | get_handler (bool validate_pointer=true) |
Get a pointer to a derived PublisherHandler instance from a PublisherInterface pointer. More... | |
void | activate () |
Activate ROS publisher of a derived PublisherHandler instance through the PublisherInterface pointer. More... | |
void | deactivate () |
Deactivate ROS publisher of a derived PublisherHandler instance through the PublisherInterface pointer. More... | |
void | publish () |
Publish the data stored in the message pair through the ROS publisher of a derived PublisherHandler instance through the PublisherInterface pointer. More... | |
std::shared_ptr< MessagePairInterface > | get_message_pair () const |
Get the pointer to the message pair of the PublisherInterface. More... | |
void | set_message_pair (const std::shared_ptr< MessagePairInterface > &message_pair) |
Set the pointer to the message pair of the PublisherInterface. More... | |
PublisherType | get_type () const |
Get the type of the publisher interface. More... | |
The PublisherHandler handles different types of ROS publishers to activate, deactivate and publish data with those publishers.
+PubT | The ROS publisher type |
MsgT | The ROS message type of the ROS publisher |
Definition at line 18 of file PublisherHandler.hpp.
+modulo_core::communication::PublisherHandler< PubT, MsgT >::PublisherHandler | +( | +PublisherType | +type, | +
+ | + | std::shared_ptr< PubT > | +publisher | +
+ | ) | ++ |
Constructor with the publisher type and the pointer to the ROS publisher.
+type | The publisher type |
publisher | The pointer to the ROS publisher |
Definition at line 63 of file PublisherHandler.hpp.
+ +
+
|
+ +override | +
Destructor to explicitly reset the publisher pointer.
+ +Definition at line 67 of file PublisherHandler.hpp.
+ +std::shared_ptr< PublisherInterface > modulo_core::communication::PublisherHandler< PubT, MsgT >::create_publisher_interface | +( | +const std::shared_ptr< MessagePairInterface > & | +message_pair | ) | ++ |
Create a PublisherInterface instance from the current PublisherHandler.
+message_pair | The message pair of the PublisherInterface |
Definition at line 116 of file PublisherHandler.hpp.
+ +void modulo_core::communication::PublisherHandler< PubT, MsgT >::on_activate | +
Activate the ROS publisher if applicable.
+modulo_core::exceptions::NullPointerException | if the publisher pointer is null |
Definition at line 72 of file PublisherHandler.hpp.
+ +void modulo_core::communication::PublisherHandler< PubT, MsgT >::on_deactivate | +
Deactivate the ROS publisher if applicable.
+modulo_core::exceptions::NullPointerException | if the publisher pointer is null |
Definition at line 88 of file PublisherHandler.hpp.
+ +void modulo_core::communication::PublisherHandler< PubT, MsgT >::publish | +( | +const MsgT & | +message | ) | +const | +
Publish the ROS message through the ROS publisher.
+message | The ROS message to publish |
modulo_core::exceptions::NullPointerException | if the publisher pointer is null |
Definition at line 104 of file PublisherHandler.hpp.
+ +
+ Modulo 3.0.0
+
+ |
+
This is the complete list of members for modulo_core::communication::PublisherInterface, including all inherited members.
+activate() | modulo_core::communication::PublisherInterface | |
deactivate() | modulo_core::communication::PublisherInterface | |
get_handler(bool validate_pointer=true) | modulo_core::communication::PublisherInterface | inline |
get_message_pair() const | modulo_core::communication::PublisherInterface | |
get_type() const | modulo_core::communication::PublisherInterface | |
publish() | modulo_core::communication::PublisherInterface | |
PublisherInterface(PublisherType type, std::shared_ptr< MessagePairInterface > message_pair=nullptr) | modulo_core::communication::PublisherInterface | explicit |
PublisherInterface(const PublisherInterface &publisher)=default | modulo_core::communication::PublisherInterface | |
set_message_pair(const std::shared_ptr< MessagePairInterface > &message_pair) | modulo_core::communication::PublisherInterface | |
~PublisherInterface()=default | modulo_core::communication::PublisherInterface | virtual |
+ Modulo 3.0.0
+
+ |
+
Interface class to enable non-templated activating/deactivating/publishing of ROS publishers from derived PublisherHandler instances through dynamic down-casting. + More...
+ +#include <PublisherInterface.hpp>
+Public Member Functions | |
PublisherInterface (PublisherType type, std::shared_ptr< MessagePairInterface > message_pair=nullptr) | |
Constructor with the message type and message pair. More... | |
+ | PublisherInterface (const PublisherInterface &publisher)=default |
Copy constructor from another PublisherInterface. | |
+virtual | ~PublisherInterface ()=default |
Default virtual destructor. | |
template<typename PubT , typename MsgT > | |
std::shared_ptr< PublisherHandler< PubT, MsgT > > | get_handler (bool validate_pointer=true) |
Get a pointer to a derived PublisherHandler instance from a PublisherInterface pointer. More... | |
void | activate () |
Activate ROS publisher of a derived PublisherHandler instance through the PublisherInterface pointer. More... | |
void | deactivate () |
Deactivate ROS publisher of a derived PublisherHandler instance through the PublisherInterface pointer. More... | |
void | publish () |
Publish the data stored in the message pair through the ROS publisher of a derived PublisherHandler instance through the PublisherInterface pointer. More... | |
std::shared_ptr< MessagePairInterface > | get_message_pair () const |
Get the pointer to the message pair of the PublisherInterface. More... | |
void | set_message_pair (const std::shared_ptr< MessagePairInterface > &message_pair) |
Set the pointer to the message pair of the PublisherInterface. More... | |
PublisherType | get_type () const |
Get the type of the publisher interface. More... | |
Interface class to enable non-templated activating/deactivating/publishing of ROS publishers from derived PublisherHandler instances through dynamic down-casting.
+ +Definition at line 21 of file PublisherInterface.hpp.
+
+
|
+ +explicit | +
Constructor with the message type and message pair.
+type | The type of the publisher interface |
message_pair | The message pair with the data to be published |
Definition at line 18 of file PublisherInterface.cpp.
+ +void modulo_core::communication::PublisherInterface::activate | +( | +) | ++ |
Activate ROS publisher of a derived PublisherHandler instance through the PublisherInterface pointer.
+This throws an InvalidPointerCastException if the PublisherInterface does not point to a valid PublisherHandler instance or if the type of the message pair does not match the type of the PublisherHandler instance.
modulo_core::exceptions::NullPointerException | if the message pair pointer is null |
Definition at line 21 of file PublisherInterface.cpp.
+ +void modulo_core::communication::PublisherInterface::deactivate | +( | +) | ++ |
Deactivate ROS publisher of a derived PublisherHandler instance through the PublisherInterface pointer.
+This throws an InvalidPointerCastException if the PublisherInterface does not point to a valid PublisherHandler instance or if the type of the message pair does not match the type of the PublisherHandler instance.
modulo_core::exceptions::NullPointerException | if the message pair pointer is null |
Definition at line 57 of file PublisherInterface.cpp.
+ +
+
|
+ +inline | +
Get a pointer to a derived PublisherHandler instance from a PublisherInterface pointer.
+If a PublisherInterface pointer is used to address a derived PublisherHandler instance, this method will return a pointer to that derived instance through dynamic down-casting. The downcast will fail if the base PublisherInterface object has no reference count (if the object is not owned by any pointer), or if the derived object is not a correctly typed instance of a PublisherHandler. By default, an InvalidPointerCastException is thrown when the downcast fails. If this validation is disabled by setting the validate_pointer flag to false, it will not throw an exception and instead return a null pointer.
PubT | The ROS publisher type |
MsgT | The ROS message type |
modulo_core::exceptions::InvalidPointerException | if the base PublisherInterface object has no reference count and validate_pointer is set to true |
modulo_core::exceptions::InvalidPointerCastException | if the derived object from the dynamic down-casting is not a correctly typed instance of a PublisherHandler |
validate_pointer | If true, throw an exception when down-casting fails |
Definition at line 129 of file PublisherInterface.hpp.
+ +std::shared_ptr< MessagePairInterface > modulo_core::communication::PublisherInterface::get_message_pair | +( | +) | +const | +
Get the pointer to the message pair of the PublisherInterface.
+ +Definition at line 139 of file PublisherInterface.cpp.
+ +PublisherType modulo_core::communication::PublisherInterface::get_type | +( | +) | +const | +
Get the type of the publisher interface.
+Definition at line 150 of file PublisherInterface.cpp.
+ +void modulo_core::communication::PublisherInterface::publish | +( | +) | ++ |
Publish the data stored in the message pair through the ROS publisher of a derived PublisherHandler instance through the PublisherInterface pointer.
+This throws an InvalidPointerCastException if the PublisherInterface does not point to a valid PublisherHandler instance or if the type of the message pair does not match the type of the PublisherHandler instance.
modulo_core::exceptions::CoreException | if the publishing failed for some reason (translation, null pointer, pointer cast, ...) |
Definition at line 93 of file PublisherInterface.cpp.
+ +void modulo_core::communication::PublisherInterface::set_message_pair | +( | +const std::shared_ptr< MessagePairInterface > & | +message_pair | ) | ++ |
Set the pointer to the message pair of the PublisherInterface.
+modulo_core::exceptions::NullPointerException | if the provided message pair pointer is null |
Definition at line 143 of file PublisherInterface.cpp.
+ +
+ Modulo 3.0.0
+
+ |
+
This is the complete list of members for modulo_core::communication::SubscriptionHandler< MsgT >, including all inherited members.
+
+ Modulo 3.0.0
+
+ |
+
The SubscriptionHandler handles different types of ROS subscriptions to receive data from those subscriptions. + More...
+ +#include <SubscriptionHandler.hpp>
+Public Member Functions | |
SubscriptionHandler (std::shared_ptr< MessagePairInterface > message_pair=nullptr) | |
Constructor with the message pair. More... | |
~SubscriptionHandler () override | |
Destructor to explicitly reset the subscription pointer. More... | |
std::shared_ptr< rclcpp::Subscription< MsgT > > | get_subscription () const |
Getter of the ROS subscription. More... | |
void | set_subscription (const std::shared_ptr< rclcpp::Subscription< MsgT > > &subscription) |
Setter of the ROS subscription. More... | |
void | set_user_callback (const std::function< void()> &user_callback) |
Setter of a user callback function to be executed after the subscription callback. More... | |
+std::function< void(const std::shared_ptr< MsgT >)> | get_callback () |
Get a callback function that will be associated with the ROS subscription to receive and translate messages. | |
std::function< void(const std::shared_ptr< MsgT >)> | get_callback (const std::function< void()> &user_callback) |
Get a callback function that will be associated with the ROS subscription to receive and translate messages. More... | |
std::shared_ptr< SubscriptionInterface > | create_subscription_interface (const std::shared_ptr< rclcpp::Subscription< MsgT > > &subscription) |
Create a SubscriptionInterface pointer through an instance of a SubscriptionHandler by providing a ROS subscription. More... | |
SubscriptionHandler (std::shared_ptr< MessagePairInterface > message_pair) | |
SubscriptionHandler (std::shared_ptr< MessagePairInterface > message_pair) | |
SubscriptionHandler (std::shared_ptr< MessagePairInterface > message_pair) | |
SubscriptionHandler (std::shared_ptr< MessagePairInterface > message_pair) | |
SubscriptionHandler (std::shared_ptr< MessagePairInterface > message_pair) | |
SubscriptionHandler (std::shared_ptr< MessagePairInterface > message_pair) | |
std::function< void(const std::shared_ptr< std_msgs::msg::Bool >)> | get_callback () |
std::function< void(const std::shared_ptr< std_msgs::msg::Float64 >)> | get_callback () |
std::function< void(const std::shared_ptr< std_msgs::msg::Float64MultiArray >)> | get_callback () |
std::function< void(const std::shared_ptr< std_msgs::msg::Int32 >)> | get_callback () |
std::function< void(const std::shared_ptr< std_msgs::msg::String >)> | get_callback () |
std::function< void(const std::shared_ptr< EncodedState >)> | get_callback () |
Public Member Functions inherited from modulo_core::communication::SubscriptionInterface | |
SubscriptionInterface (std::shared_ptr< MessagePairInterface > message_pair=nullptr) | |
Constructor with the message pair. More... | |
+ | SubscriptionInterface (const SubscriptionInterface &subscription)=default |
Copy constructor from another SubscriptionInterface. | |
+virtual | ~SubscriptionInterface ()=default |
Default virtual destructor. | |
template<typename MsgT > | |
std::shared_ptr< SubscriptionHandler< MsgT > > | get_handler (bool validate_pointer=true) |
Get a pointer to a derived SubscriptionHandler instance from a SubscriptionInterface pointer. More... | |
std::shared_ptr< MessagePairInterface > | get_message_pair () const |
Get the pointer to the message pair of the SubscriptionInterface. More... | |
void | set_message_pair (const std::shared_ptr< MessagePairInterface > &message_pair) |
Set the pointer to the message pair of the SubscriptionInterface. More... | |
The SubscriptionHandler handles different types of ROS subscriptions to receive data from those subscriptions.
+MsgT | The ROS message type of the ROS subscription |
Definition at line 14 of file SubscriptionHandler.hpp.
+
+
|
+ +explicit | +
Constructor with the message pair.
+message_pair | The pointer to the message pair with the data that should be updated through the subscription |
+
|
+ +override | +
Destructor to explicitly reset the subscription pointer.
+ +Definition at line 80 of file SubscriptionHandler.hpp.
+ +modulo_core::communication::SubscriptionHandler< std_msgs::msg::Bool >::SubscriptionHandler | +( | +std::shared_ptr< MessagePairInterface > | +message_pair | ) | ++ |
Definition at line 8 of file SubscriptionHandler.cpp.
+ +modulo_core::communication::SubscriptionHandler< std_msgs::msg::Float64 >::SubscriptionHandler | +( | +std::shared_ptr< MessagePairInterface > | +message_pair | ) | ++ |
Definition at line 12 of file SubscriptionHandler.cpp.
+ +modulo_core::communication::SubscriptionHandler< std_msgs::msg::Float64MultiArray >::SubscriptionHandler | +( | +std::shared_ptr< MessagePairInterface > | +message_pair | ) | ++ |
Definition at line 15 of file SubscriptionHandler.cpp.
+ +modulo_core::communication::SubscriptionHandler< std_msgs::msg::Int32 >::SubscriptionHandler | +( | +std::shared_ptr< MessagePairInterface > | +message_pair | ) | ++ |
Definition at line 21 of file SubscriptionHandler.cpp.
+ +modulo_core::communication::SubscriptionHandler< std_msgs::msg::String >::SubscriptionHandler | +( | +std::shared_ptr< MessagePairInterface > | +message_pair | ) | ++ |
Definition at line 25 of file SubscriptionHandler.cpp.
+ +modulo_core::communication::SubscriptionHandler< EncodedState >::SubscriptionHandler | +( | +std::shared_ptr< MessagePairInterface > | +message_pair | ) | ++ |
Definition at line 29 of file SubscriptionHandler.cpp.
+ +std::shared_ptr< SubscriptionInterface > modulo_core::communication::SubscriptionHandler< MsgT >::create_subscription_interface | +( | +const std::shared_ptr< rclcpp::Subscription< MsgT > > & | +subscription | ) | ++ |
Create a SubscriptionInterface pointer through an instance of a SubscriptionHandler by providing a ROS subscription.
+This throws a NullPointerException if the ROS subscription is null.
+subscription | The ROS subscription |
Definition at line 110 of file SubscriptionHandler.hpp.
+ +std::function< void(const std::shared_ptr< std_msgs::msg::Bool >)> modulo_core::communication::SubscriptionHandler< std_msgs::msg::Bool >::get_callback | +( | +) | ++ |
Definition at line 34 of file SubscriptionHandler.cpp.
+ +std::function< void(const std::shared_ptr< std_msgs::msg::Float64 >)> modulo_core::communication::SubscriptionHandler< std_msgs::msg::Float64 >::get_callback | +( | +) | ++ |
Definition at line 47 of file SubscriptionHandler.cpp.
+ +std::function< void(const std::shared_ptr< std_msgs::msg::Float64MultiArray >)> modulo_core::communication::SubscriptionHandler< std_msgs::msg::Float64MultiArray >::get_callback | +( | +) | ++ |
Definition at line 60 of file SubscriptionHandler.cpp.
+ +std::function< void(const std::shared_ptr< std_msgs::msg::Int32 >)> modulo_core::communication::SubscriptionHandler< std_msgs::msg::Int32 >::get_callback | +( | +) | ++ |
Definition at line 73 of file SubscriptionHandler.cpp.
+ +std::function< void(const std::shared_ptr< std_msgs::msg::String >)> modulo_core::communication::SubscriptionHandler< std_msgs::msg::String >::get_callback | +( | +) | ++ |
Definition at line 86 of file SubscriptionHandler.cpp.
+ +std::function< void(const std::shared_ptr< EncodedState >)> modulo_core::communication::SubscriptionHandler< EncodedState >::get_callback | +( | +) | ++ |
Definition at line 98 of file SubscriptionHandler.cpp.
+ +std::function< void(const std::shared_ptr< MsgT >)> modulo_core::communication::SubscriptionHandler< MsgT >::get_callback | +( | +const std::function< void()> & | +user_callback | ) | ++ |
Get a callback function that will be associated with the ROS subscription to receive and translate messages.
+This variant also takes a user callback function to execute after the message is received and translated.
user_callback | Void callback function for additional logic after the message is received and translated. |
Definition at line 104 of file SubscriptionHandler.hpp.
+ +std::shared_ptr< rclcpp::Subscription< MsgT > > modulo_core::communication::SubscriptionHandler< MsgT >::get_subscription | +
Getter of the ROS subscription.
+ +Definition at line 85 of file SubscriptionHandler.hpp.
+ +void modulo_core::communication::SubscriptionHandler< MsgT >::set_subscription | +( | +const std::shared_ptr< rclcpp::Subscription< MsgT > > & | +subscription | ) | ++ |
Setter of the ROS subscription.
+subscription | The ROS subscription |
modulo_core::exceptions::NullPointerException | if the provided subscription pointer is null |
Definition at line 90 of file SubscriptionHandler.hpp.
+ +void modulo_core::communication::SubscriptionHandler< MsgT >::set_user_callback | +( | +const std::function< void()> & | +user_callback | ) | ++ |
Setter of a user callback function to be executed after the subscription callback.
+user_callback | The ser callback function |
Definition at line 98 of file SubscriptionHandler.hpp.
+ +
+ Modulo 3.0.0
+
+ |
+
This is the complete list of members for modulo_core::communication::SubscriptionInterface, including all inherited members.
+get_handler(bool validate_pointer=true) | modulo_core::communication::SubscriptionInterface | inline |
get_message_pair() const | modulo_core::communication::SubscriptionInterface | |
set_message_pair(const std::shared_ptr< MessagePairInterface > &message_pair) | modulo_core::communication::SubscriptionInterface | |
SubscriptionInterface(std::shared_ptr< MessagePairInterface > message_pair=nullptr) | modulo_core::communication::SubscriptionInterface | explicit |
SubscriptionInterface(const SubscriptionInterface &subscription)=default | modulo_core::communication::SubscriptionInterface | |
~SubscriptionInterface()=default | modulo_core::communication::SubscriptionInterface | virtual |
+ Modulo 3.0.0
+
+ |
+
Interface class to enable non-templated subscriptions with ROS subscriptions from derived SubscriptionHandler instances through dynamic down-casting. + More...
+ +#include <SubscriptionInterface.hpp>
+Public Member Functions | |
SubscriptionInterface (std::shared_ptr< MessagePairInterface > message_pair=nullptr) | |
Constructor with the message pair. More... | |
+ | SubscriptionInterface (const SubscriptionInterface &subscription)=default |
Copy constructor from another SubscriptionInterface. | |
+virtual | ~SubscriptionInterface ()=default |
Default virtual destructor. | |
template<typename MsgT > | |
std::shared_ptr< SubscriptionHandler< MsgT > > | get_handler (bool validate_pointer=true) |
Get a pointer to a derived SubscriptionHandler instance from a SubscriptionInterface pointer. More... | |
std::shared_ptr< MessagePairInterface > | get_message_pair () const |
Get the pointer to the message pair of the SubscriptionInterface. More... | |
void | set_message_pair (const std::shared_ptr< MessagePairInterface > &message_pair) |
Set the pointer to the message pair of the SubscriptionInterface. More... | |
Interface class to enable non-templated subscriptions with ROS subscriptions from derived SubscriptionHandler instances through dynamic down-casting.
+ +Definition at line 20 of file SubscriptionInterface.hpp.
+
+
|
+ +explicit | +
Constructor with the message pair.
+message_pair | The pointer to the message pair with the data that should be updated through the subscription |
Definition at line 7 of file SubscriptionInterface.cpp.
+ +
+
|
+ +inline | +
Get a pointer to a derived SubscriptionHandler instance from a SubscriptionInterface pointer.
+If a SubscriptionInterface pointer is used to address a derived SubscriptionHandler instance, this method will return a pointer to that derived instance through dynamic down-casting. The downcast will fail if the base SubscriptionInterface object has no reference count (if the object is not owned by any pointer), or if the derived object is not a correctly typed instance of a SubscriptionHandler. By default, an InvalidPointerCastException is thrown when the downcast fails. If this validation is disabled by setting the validate_pointer flag to false, it will not throw an exception and instead return a null pointer.
PubT | The ROS publisher type |
MsgT | The ROS message type |
modulo_core::exceptions::InvalidPointerException | if the base SubscriptionInterface object has no reference count and validate_pointer is set to true |
modulo_core::exceptions::InvalidPointerCastException | if the derived object from the dynamic down-casting is not a correctly typed instance of a SubscriptionHandler |
validate_pointer | If true, throw an exception when down-casting fails |
Definition at line 75 of file SubscriptionInterface.hpp.
+ +std::shared_ptr< MessagePairInterface > modulo_core::communication::SubscriptionInterface::get_message_pair | +( | +) | +const | +
Get the pointer to the message pair of the SubscriptionInterface.
+ +Definition at line 10 of file SubscriptionInterface.cpp.
+ +void modulo_core::communication::SubscriptionInterface::set_message_pair | +( | +const std::shared_ptr< MessagePairInterface > & | +message_pair | ) | ++ |
Set the pointer to the message pair of the SubscriptionInterface.
+modulo_core::exceptions::NullPointerException | if the provided message pair pointer is null |
Definition at line 14 of file SubscriptionInterface.cpp.
+ +
+ Modulo 3.0.0
+
+ |
+
This is the complete list of members for modulo_core::exceptions::CoreException, including all inherited members.
+CoreException(const std::string &msg) (defined in modulo_core::exceptions::CoreException) | modulo_core::exceptions::CoreException | inlineexplicit |
CoreException(const std::string &prefix, const std::string &msg) (defined in modulo_core::exceptions::CoreException) | modulo_core::exceptions::CoreException | inlineprotected |
+ Modulo 3.0.0
+
+ |
+
A base class for all core exceptions. + More...
+ +#include <CoreException.hpp>
+Public Member Functions | |
CoreException (const std::string &msg) | |
+Protected Member Functions | |
CoreException (const std::string &prefix, const std::string &msg) | |
A base class for all core exceptions.
+This inherits from std::runtime_exception.
+ +Definition at line 17 of file CoreException.hpp.
+
+
|
+ +inlineexplicit | +
Definition at line 19 of file CoreException.hpp.
+ +
+
|
+ +inlineprotected | +
Definition at line 21 of file CoreException.hpp.
+ +
+ Modulo 3.0.0
+
+ |
+
This is the complete list of members for modulo_core::exceptions::InvalidPointerCastException, including all inherited members.
+CoreException(const std::string &msg) (defined in modulo_core::exceptions::CoreException) | modulo_core::exceptions::CoreException | inlineexplicit |
CoreException(const std::string &prefix, const std::string &msg) (defined in modulo_core::exceptions::CoreException) | modulo_core::exceptions::CoreException | inlineprotected |
InvalidPointerCastException(const std::string &msg) (defined in modulo_core::exceptions::InvalidPointerCastException) | modulo_core::exceptions::InvalidPointerCastException | inlineexplicit |
+ Modulo 3.0.0
+
+ |
+
An exception class to notify if the result of getting an instance of a derived class through dynamic down-casting of an object of the base class is not a correctly typed instance of the derived class. + More...
+ +#include <InvalidPointerCastException.hpp>
+Public Member Functions | |
InvalidPointerCastException (const std::string &msg) | |
Public Member Functions inherited from modulo_core::exceptions::CoreException | |
CoreException (const std::string &msg) | |
+Additional Inherited Members | |
Protected Member Functions inherited from modulo_core::exceptions::CoreException | |
CoreException (const std::string &prefix, const std::string &msg) | |
An exception class to notify if the result of getting an instance of a derived class through dynamic down-casting of an object of the base class is not a correctly typed instance of the derived class.
+ +Definition at line 12 of file InvalidPointerCastException.hpp.
+
+
|
+ +inlineexplicit | +
Definition at line 14 of file InvalidPointerCastException.hpp.
+ +
+ Modulo 3.0.0
+
+ |
+
This is the complete list of members for modulo_core::exceptions::InvalidPointerException, including all inherited members.
+CoreException(const std::string &msg) (defined in modulo_core::exceptions::CoreException) | modulo_core::exceptions::CoreException | inlineexplicit |
CoreException(const std::string &prefix, const std::string &msg) (defined in modulo_core::exceptions::CoreException) | modulo_core::exceptions::CoreException | inlineprotected |
InvalidPointerException(const std::string &msg) (defined in modulo_core::exceptions::InvalidPointerException) | modulo_core::exceptions::InvalidPointerException | inlineexplicit |
+ Modulo 3.0.0
+
+ |
+
An exception class to notify if an object has no reference count (if the object is not owned by any pointer) when attempting to get a derived instance through dynamic down-casting. + More...
+ +#include <InvalidPointerException.hpp>
+Public Member Functions | |
InvalidPointerException (const std::string &msg) | |
Public Member Functions inherited from modulo_core::exceptions::CoreException | |
CoreException (const std::string &msg) | |
+Additional Inherited Members | |
Protected Member Functions inherited from modulo_core::exceptions::CoreException | |
CoreException (const std::string &prefix, const std::string &msg) | |
An exception class to notify if an object has no reference count (if the object is not owned by any pointer) when attempting to get a derived instance through dynamic down-casting.
+ +Definition at line 12 of file InvalidPointerException.hpp.
+
+
|
+ +inlineexplicit | +
Definition at line 14 of file InvalidPointerException.hpp.
+ +
+ Modulo 3.0.0
+
+ |
+
This is the complete list of members for modulo_core::exceptions::MessageTranslationException, including all inherited members.
+CoreException(const std::string &msg) (defined in modulo_core::exceptions::CoreException) | modulo_core::exceptions::CoreException | inlineexplicit |
CoreException(const std::string &prefix, const std::string &msg) (defined in modulo_core::exceptions::CoreException) | modulo_core::exceptions::CoreException | inlineprotected |
MessageTranslationException(const std::string &msg) (defined in modulo_core::exceptions::MessageTranslationException) | modulo_core::exceptions::MessageTranslationException | inlineexplicit |
+ Modulo 3.0.0
+
+ |
+
An exception class to notify that the translation of a ROS message failed. + More...
+ +#include <MessageTranslationException.hpp>
+Public Member Functions | |
MessageTranslationException (const std::string &msg) | |
Public Member Functions inherited from modulo_core::exceptions::CoreException | |
CoreException (const std::string &msg) | |
+Additional Inherited Members | |
Protected Member Functions inherited from modulo_core::exceptions::CoreException | |
CoreException (const std::string &prefix, const std::string &msg) | |
An exception class to notify that the translation of a ROS message failed.
+ +Definition at line 11 of file MessageTranslationException.hpp.
+
+
|
+ +inlineexplicit | +
Definition at line 13 of file MessageTranslationException.hpp.
+ +
+ Modulo 3.0.0
+
+ |
+
This is the complete list of members for modulo_core::exceptions::NullPointerException, including all inherited members.
+CoreException(const std::string &msg) (defined in modulo_core::exceptions::CoreException) | modulo_core::exceptions::CoreException | inlineexplicit |
CoreException(const std::string &prefix, const std::string &msg) (defined in modulo_core::exceptions::CoreException) | modulo_core::exceptions::CoreException | inlineprotected |
NullPointerException(const std::string &msg) (defined in modulo_core::exceptions::NullPointerException) | modulo_core::exceptions::NullPointerException | inlineexplicit |
+ Modulo 3.0.0
+
+ |
+
An exception class to notify that a certain pointer is null. + More...
+ +#include <NullPointerException.hpp>
+Public Member Functions | |
NullPointerException (const std::string &msg) | |
Public Member Functions inherited from modulo_core::exceptions::CoreException | |
CoreException (const std::string &msg) | |
+Additional Inherited Members | |
Protected Member Functions inherited from modulo_core::exceptions::CoreException | |
CoreException (const std::string &prefix, const std::string &msg) | |
An exception class to notify that a certain pointer is null.
+This is an exception class to be thrown if a pointer is null or is trying to be set to a null pointer.
+ +Definition at line 12 of file NullPointerException.hpp.
+
+
|
+ +inlineexplicit | +
Definition at line 14 of file NullPointerException.hpp.
+ +
+ Modulo 3.0.0
+
+ |
+
This is the complete list of members for modulo_core::exceptions::ParameterTranslationException, including all inherited members.
+CoreException(const std::string &msg) (defined in modulo_core::exceptions::CoreException) | modulo_core::exceptions::CoreException | inlineexplicit |
CoreException(const std::string &prefix, const std::string &msg) (defined in modulo_core::exceptions::CoreException) | modulo_core::exceptions::CoreException | inlineprotected |
ParameterTranslationException(const std::string &msg) (defined in modulo_core::exceptions::ParameterTranslationException) | modulo_core::exceptions::ParameterTranslationException | inlineexplicit |
+ Modulo 3.0.0
+
+ |
+
An exception class to notify incompatibility when translating parameters from different sources. + More...
+ +#include <ParameterTranslationException.hpp>
+Public Member Functions | |
ParameterTranslationException (const std::string &msg) | |
Public Member Functions inherited from modulo_core::exceptions::CoreException | |
CoreException (const std::string &msg) | |
+Additional Inherited Members | |
Protected Member Functions inherited from modulo_core::exceptions::CoreException | |
CoreException (const std::string &prefix, const std::string &msg) | |
An exception class to notify incompatibility when translating parameters from different sources.
+This is an exception class to be thrown if there is a problem while translating from a ROS parameter to a state_representation parameter and vice versa.
+ +Definition at line 13 of file ParameterTranslationException.hpp.
+
+
|
+ +inlineexplicit | +
Definition at line 15 of file ParameterTranslationException.hpp.
+ +
+ Modulo 3.0.0
+
+ |
+
This is the complete list of members for modulo_utils::testutils::PredicatesListener, including all inherited members.
+get_predicate_future() const (defined in modulo_utils::testutils::PredicatesListener) | modulo_utils::testutils::PredicatesListener | |
get_predicate_values() const (defined in modulo_utils::testutils::PredicatesListener) | modulo_utils::testutils::PredicatesListener | |
PredicatesListener(const std::string &component, const std::vector< std::string > &predicates, const rclcpp::NodeOptions &node_options=rclcpp::NodeOptions()) (defined in modulo_utils::testutils::PredicatesListener) | modulo_utils::testutils::PredicatesListener | |
reset_future() (defined in modulo_utils::testutils::PredicatesListener) | modulo_utils::testutils::PredicatesListener |
+ Modulo 3.0.0
+
+ |
+
+Public Member Functions | |
PredicatesListener (const std::string &component, const std::vector< std::string > &predicates, const rclcpp::NodeOptions &node_options=rclcpp::NodeOptions()) | |
void | reset_future () |
const std::shared_future< void > & | get_predicate_future () const |
const std::map< std::string, bool > & | get_predicate_values () const |
Definition at line 13 of file PredicatesListener.hpp.
+modulo_utils::testutils::PredicatesListener::PredicatesListener | +( | +const std::string & | +component, | +
+ | + | const std::vector< std::string > & | +predicates, | +
+ | + | const rclcpp::NodeOptions & | +node_options = rclcpp::NodeOptions() |
+
+ | ) | ++ |
Definition at line 5 of file PredicatesListener.cpp.
+ +const std::shared_future< void > & modulo_utils::testutils::PredicatesListener::get_predicate_future | +( | +) | +const | +
Definition at line 32 of file PredicatesListener.cpp.
+ +const std::map< std::string, bool > & modulo_utils::testutils::PredicatesListener::get_predicate_values | +( | +) | +const | +
Definition at line 36 of file PredicatesListener.cpp.
+ +void modulo_utils::testutils::PredicatesListener::reset_future | +( | +) | ++ |
Definition at line 27 of file PredicatesListener.cpp.
+ +
+ Modulo 3.0.0
+
+ |
+
This is the complete list of members for modulo_utils::testutils::ServiceClient< SrvT >, including all inherited members.
+call_async(const std::shared_ptr< typename SrvT::Request > &request) (defined in modulo_utils::testutils::ServiceClient< SrvT >) | modulo_utils::testutils::ServiceClient< SrvT > | inline |
client_ (defined in modulo_utils::testutils::ServiceClient< SrvT >) | modulo_utils::testutils::ServiceClient< SrvT > | |
ServiceClient(const rclcpp::NodeOptions &options, const std::string &service) (defined in modulo_utils::testutils::ServiceClient< SrvT >) | modulo_utils::testutils::ServiceClient< SrvT > | inline |
+ Modulo 3.0.0
+
+ |
+
+Public Member Functions | |
ServiceClient (const rclcpp::NodeOptions &options, const std::string &service) | |
rclcpp::Client< SrvT >::FutureAndRequestId | call_async (const std::shared_ptr< typename SrvT::Request > &request) |
+Public Attributes | |
std::shared_ptr< rclcpp::Client< SrvT > > | client_ |
Definition at line 13 of file ServiceClient.hpp.
+
+
|
+ +inline | +
Definition at line 15 of file ServiceClient.hpp.
+ +
+
|
+ +inline | +
Definition at line 22 of file ServiceClient.hpp.
+ +std::shared_ptr<rclcpp::Client<SrvT> > modulo_utils::testutils::ServiceClient< SrvT >::client_ | +
Definition at line 26 of file ServiceClient.hpp.
+ +
+ Modulo 3.0.0
+
+ |
+
+Files | |
file | PredicatesListener.cpp [code] |
+ Modulo 3.0.0
+
+ |
+
+Files | |
file | CoreException.hpp [code] |
file | InvalidPointerCastException.hpp [code] |
file | InvalidPointerException.hpp [code] |
file | MessageTranslationException.hpp [code] |
file | NullPointerException.hpp [code] |
file | ParameterTranslationException.hpp [code] |
+ Modulo 3.0.0
+
+ |
+
+Directories | |
directory | exceptions |
directory | utilities |
+Files | |
file | Component.hpp [code] |
file | ComponentInterface.hpp [code] |
file | LifecycleComponent.hpp [code] |
+ Modulo 3.0.0
+
+ |
+
+Directories | |
directory | communication |
directory | exceptions |
directory | translators |
+Files | |
file | EncodedState.hpp [code] |
+ Modulo 3.0.0
+
+ |
+
+Directories | |
directory | modulo_core |
+ Modulo 3.0.0
+
+ |
+
+Files | |
file | message_readers.cpp [code] |
file | message_writers.cpp [code] |
file | parameter_translators.cpp [code] |
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+Files | |
file | message_readers.hpp [code] |
file | message_writers.hpp [code] |
file | parameter_translators.hpp [code] |
+ Modulo 3.0.0
+
+ |
+
+Files | |
file | MessagePair.cpp [code] |
file | MessagePairInterface.cpp [code] |
file | PublisherInterface.cpp [code] |
file | SubscriptionHandler.cpp [code] |
file | SubscriptionInterface.cpp [code] |
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+Directories | |
directory | modulo_components |
+ Modulo 3.0.0
+
+ |
+
+Directories | |
directory | communication |
directory | translators |
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+Directories | |
directory | testutils |
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+Files | |
file | MessagePair.hpp [code] |
file | MessagePairInterface.hpp [code] |
file | MessageType.hpp [code] |
file | PublisherHandler.hpp [code] |
file | PublisherInterface.hpp [code] |
file | PublisherType.hpp [code] |
file | SubscriptionHandler.hpp [code] |
file | SubscriptionInterface.hpp [code] |
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+Directories | |
directory | testutils |
+ Modulo 3.0.0
+
+ |
+
+Files | |
file | AddServiceException.hpp [code] |
file | AddSignalException.hpp [code] |
file | ComponentException.hpp [code] |
file | ComponentParameterException.hpp [code] |
file | LookupTransformException.hpp [code] |
+ Modulo 3.0.0
+
+ |
+
+Directories | |
directory | src |
+ Modulo 3.0.0
+
+ |
+
▼ source | |
▼ modulo_components | |
▼ include | |
▼ modulo_components | |
▼ exceptions | |
AddServiceException.hpp | |
AddSignalException.hpp | |
ComponentException.hpp | |
ComponentParameterException.hpp | |
LookupTransformException.hpp | |
▼ utilities | |
predicate_variant.hpp | |
utilities.hpp | |
Component.hpp | |
ComponentInterface.hpp | |
LifecycleComponent.hpp | |
▼ src | |
Component.cpp | |
LifecycleComponent.cpp | |
▼ modulo_core | |
▼ include | |
▼ modulo_core | |
▼ communication | |
MessagePair.hpp | |
MessagePairInterface.hpp | |
MessageType.hpp | |
PublisherHandler.hpp | |
PublisherInterface.hpp | |
PublisherType.hpp | |
SubscriptionHandler.hpp | |
SubscriptionInterface.hpp | |
▼ exceptions | |
CoreException.hpp | |
InvalidPointerCastException.hpp | |
InvalidPointerException.hpp | |
MessageTranslationException.hpp | |
NullPointerException.hpp | |
ParameterTranslationException.hpp | |
▼ translators | |
message_readers.hpp | |
message_writers.hpp | |
parameter_translators.hpp | |
EncodedState.hpp | |
▼ src | |
▼ communication | |
MessagePair.cpp | |
MessagePairInterface.cpp | |
PublisherInterface.cpp | |
SubscriptionHandler.cpp | |
SubscriptionInterface.cpp | |
▼ translators | |
message_readers.cpp | |
message_writers.cpp | |
parameter_translators.cpp | |
▼ modulo_utils | |
▼ include | |
▼ modulo_utils | |
▼ testutils | |
PredicatesListener.hpp | |
ServiceClient.hpp | |
▼ src | |
▼ testutils | |
PredicatesListener.cpp |
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
+ Modulo 3.0.0
+
+ |
+
Cmodulo_components::ComponentInterfacePublicInterface< NodeT > | Friend class to the ComponentInterface to allow test fixtures to access protected and private members |
Cmodulo_components::ComponentServiceResponse | Response structure to be returned by component services |
▼Cstd::enable_shared_from_this | |
▼Cmodulo_core::communication::MessagePairInterface | Interface class to enable non-templated writing and reading ROS messages from derived MessagePair instances through dynamic down-casting |
Cmodulo_core::communication::MessagePair< MsgT, DataT > | The MessagePair stores a pointer to a variable and translates the value of this pointer back and forth between the corresponding ROS messages |
▼Cmodulo_core::communication::PublisherInterface | Interface class to enable non-templated activating/deactivating/publishing of ROS publishers from derived PublisherHandler instances through dynamic down-casting |
Cmodulo_core::communication::PublisherHandler< PubT, MsgT > | The PublisherHandler handles different types of ROS publishers to activate, deactivate and publish data with those publishers |
▼Cmodulo_core::communication::SubscriptionInterface | Interface class to enable non-templated subscriptions with ROS subscriptions from derived SubscriptionHandler instances through dynamic down-casting |
Cmodulo_core::communication::SubscriptionHandler< MsgT > | The SubscriptionHandler handles different types of ROS subscriptions to receive data from those subscriptions |
▼Crclcpp_lifecycle::LifecycleNode | |
▼Cmodulo_components::ComponentInterface< rclcpp_lifecycle::LifecycleNode > | |
Cmodulo_components::LifecycleComponent | A wrapper for rclcpp_lifecycle::LifecycleNode to simplify application composition through unified component interfaces while supporting lifecycle states and transitions |
▼Crclcpp::Node | |
▼Cmodulo_components::ComponentInterface< rclcpp::Node > | |
Cmodulo_components::Component | A wrapper for rclcpp::Node to simplify application composition through unified component interfaces |
Cmodulo_utils::testutils::PredicatesListener | |
Cmodulo_utils::testutils::ServiceClient< SrvT > | |
▼CNodeT | |
Cmodulo_components::ComponentInterface< NodeT > | Base interface class for modulo components to wrap a ROS Node with custom behaviour |
▼Cstd::runtime_error | |
▼Cmodulo_components::exceptions::ComponentException | A base class for all component exceptions |
Cmodulo_components::exceptions::AddServiceException | An exception class to notify errors when adding a service |
Cmodulo_components::exceptions::AddSignalException | An exception class to notify errors when adding a signal |
Cmodulo_components::exceptions::ComponentParameterException | An exception class to notify errors with component parameters |
Cmodulo_components::exceptions::LookupTransformException | An exception class to notify an error while looking up TF transforms |
▼Cmodulo_core::exceptions::CoreException | A base class for all core exceptions |
Cmodulo_core::exceptions::InvalidPointerCastException | An exception class to notify if the result of getting an instance of a derived class through dynamic down-casting of an object of the base class is not a correctly typed instance of the derived class |
Cmodulo_core::exceptions::InvalidPointerException | An exception class to notify if an object has no reference count (if the object is not owned by any pointer) when attempting to get a derived instance through dynamic down-casting |
Cmodulo_core::exceptions::MessageTranslationException | An exception class to notify that the translation of a ROS message failed |
Cmodulo_core::exceptions::NullPointerException | An exception class to notify that a certain pointer is null |
Cmodulo_core::exceptions::ParameterTranslationException | An exception class to notify incompatibility when translating parameters from different sources |
+ Modulo 3.0.0
+
+ |
+
Modulo is an extension layer to ROS2 that adds interoperability support for aica-technology/control-libraries and provides a modular framework for application composition through custom component classes in both C++ and Python.
+Documentation is available at aica-technology.github.io/modulo.
+The core package implements interoperability between ROS2 and state_representation data types, allowing state data and parameters to be directly translated and handled as messages on the ROS2 interface layer.
+Modulo components are wrappers for ROS2 Nodes which abstract low-level ROS methods for greater user convenience and consistency between components.
+While ROS2 Nodes provide a highly flexible and customizable interface, there is often a significant amount of boilerplate code that is duplicated with each new Node. In addition, the interoperability of multiple nodes in an application depends on them using compatible message types and behaving in a generally consistent manner.
+The component classes are intended to simplify the development of compatible application modules. They provide more concise methods for adding parameters, services, transforms, topic subscriptions and publications. They also introduce new concepts such as predicate broadcasting, error handling and the direct binding of data attributes to their corresponding interface.
+The package provides two variant classes: modulo_components::Component
and modulo_components::LifecycleComponent
. See the package documentation for more information.
This package defines custom standard interfaces for modulo components.
+This package contains shared test fixtures.
+It is possible to use a bridge service to interface ROS2 with ROS1 in order to publish/subscribe to topics from ROS1.
+ROS provides a docker image with this service. Run the following lines to pull the bridge image, launch an interactive shell, and subsequently start the bridge topic.
+