diff --git a/versions/v5.0.1/_base_controller_interface_8cpp_source.html b/versions/v5.0.1/_base_controller_interface_8cpp_source.html new file mode 100644 index 00000000..e72ae7b1 --- /dev/null +++ b/versions/v5.0.1/_base_controller_interface_8cpp_source.html @@ -0,0 +1,714 @@ + + +
+ + + + +
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
▼Nmodulo_components | Modulo components |
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 |
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_controllers | |
CBaseControllerInterface | Base controller class to combine ros2_control, control libraries and modulo |
CControllerInput | Input structure to save topic data in a realtime buffer and timestamps in one object |
CControllerInterface | |
CControllerServiceResponse | Response structure to be returned by controller services |
CRobotControllerInterface | Base controller class that automatically associates joints with a JointState object |
▼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 |
CAddServiceException | An exception class to notify errors when adding a service |
CAddSignalException | An exception class to notify errors when adding a signal |
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 |
CLookupTransformException | An exception class to notify an error while looking up TF transforms |
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 |
CParameterException | An exception class to notify errors with parameters in modulo classes |
CParameterTranslationException | An exception class to notify incompatibility when translating parameters from different sources |
CPredicate | |
▼Nmodulo_utils | |
▼Ntestutils | |
CPredicatesListener | |
CServiceClient | |
CComponentInterfacePublicInterface | Friend class to the ComponentInterface to allow test fixtures to access protected and private members |
+ Modulo 5.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.
+
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.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 | 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 | 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 | 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 | protected |
add_parameter(const std::string &name, const T &value, const std::string &description, bool read_only=false) | modulo_components::ComponentInterface | inlineprotected |
add_periodic_callback(const std::string &name, const std::function< void(void)> &callback) | modulo_components::ComponentInterface | protected |
add_predicate(const std::string &predicate_name, bool predicate_value) | modulo_components::ComponentInterface | protected |
add_predicate(const std::string &predicate_name, const std::function< bool(void)> &predicate_function) | modulo_components::ComponentInterface | protected |
add_service(const std::string &service_name, const std::function< ComponentServiceResponse(void)> &callback) | modulo_components::ComponentInterface | protected |
add_service(const std::string &service_name, const std::function< ComponentServiceResponse(const std::string &string)> &callback) | modulo_components::ComponentInterface | protected |
add_static_tf_broadcaster() | modulo_components::ComponentInterface | protected |
add_tf_broadcaster() | modulo_components::ComponentInterface | protected |
add_tf_listener() | modulo_components::ComponentInterface | protected |
add_trigger(const std::string &trigger_name) | modulo_components::ComponentInterface | protected |
Component(const rclcpp::NodeOptions &node_options, const std::string &fallback_name="Component") | modulo_components::Component | explicit |
ComponentInterface(const std::shared_ptr< rclcpp::node_interfaces::NodeInterfaces< ALL_RCLCPP_NODE_INTERFACES > > &interfaces) | modulo_components::ComponentInterface | explicitprotected |
ComponentPublicInterface (defined in modulo_components::Component) | modulo_components::Component | friend |
declare_input(const std::string &signal_name, const std::string &default_topic="", bool fixed_topic=false) | modulo_components::ComponentInterface | protected |
declare_output(const std::string &signal_name, const std::string &default_topic="", bool fixed_topic=false) | modulo_components::ComponentInterface | protected |
execute() | modulo_components::Component | protected |
get_parameter(const std::string &name) const | modulo_components::Component | protected |
get_parameter_value(const std::string &name) const | modulo_components::ComponentInterface | inlineprotected |
get_period() const | modulo_components::ComponentInterface | protected |
get_period() const (defined in modulo_components::ComponentInterface) | modulo_components::ComponentInterface | |
get_period() const (defined in modulo_components::ComponentInterface) | modulo_components::ComponentInterface | |
get_period() const (defined in modulo_components::ComponentInterface) | modulo_components::ComponentInterface | |
get_predicate(const std::string &predicate_name) const | modulo_components::ComponentInterface | protected |
get_qos() const | modulo_components::ComponentInterface | protected |
get_rate() const | modulo_components::ComponentInterface | protected |
lookup_transform(const std::string &frame, const std::string &reference_frame, const tf2::TimePoint &time_point, const tf2::Duration &duration) | modulo_components::ComponentInterface | protected |
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 | protected |
on_execute_callback() | modulo_components::Component | protectedvirtual |
on_step_callback() | modulo_components::ComponentInterface | protectedvirtual |
on_validate_parameter_callback(const std::shared_ptr< state_representation::ParameterInterface > ¶meter) | modulo_components::ComponentInterface | protectedvirtual |
publish_output(const std::string &signal_name) | modulo_components::ComponentInterface | protected |
raise_error() override | modulo_components::Component | protectedvirtual |
remove_input(const std::string &signal_name) | modulo_components::ComponentInterface | protected |
remove_output(const std::string &signal_name) | modulo_components::ComponentInterface | protected |
send_static_transform(const state_representation::CartesianPose &transform) | modulo_components::ComponentInterface | protected |
send_static_transforms(const std::vector< state_representation::CartesianPose > &transforms) | modulo_components::ComponentInterface | protected |
send_transform(const state_representation::CartesianPose &transform) | modulo_components::ComponentInterface | protected |
send_transforms(const std::vector< state_representation::CartesianPose > &transforms) | modulo_components::ComponentInterface | protected |
set_parameter_value(const std::string &name, const T &value) | modulo_components::ComponentInterface | inlineprotected |
set_predicate(const std::string &predicate_name, bool predicate_value) | modulo_components::ComponentInterface | protected |
set_predicate(const std::string &predicate_name, const std::function< bool(void)> &predicate_function) | modulo_components::ComponentInterface | protected |
set_qos(const rclcpp::QoS &qos) | modulo_components::ComponentInterface | protected |
trigger(const std::string &trigger_name) | modulo_components::ComponentInterface | protected |
~Component() | modulo_components::Component | virtual |
~ComponentInterface() | modulo_components::ComponentInterface | virtual |
+ Modulo 5.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. | |
virtual | ~Component () |
Destructor that joins the thread if necessary. | |
Public Member Functions inherited from modulo_components::ComponentInterface | |
virtual | ~ComponentInterface () |
Virtual destructor. | |
template<> | |
double | get_period () const |
template<> | |
std::chrono::nanoseconds | get_period () const |
template<> | |
rclcpp::Duration | get_period () const |
+Protected Member Functions | |
std::shared_ptr< state_representation::ParameterInterface > | get_parameter (const std::string &name) const |
Get a parameter by name. | |
void | execute () |
Start the execution thread. | |
virtual bool | on_execute_callback () |
Execute the component logic. To be redefined in derived classes. | |
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. | |
void | raise_error () override |
Protected Member Functions inherited from modulo_components::ComponentInterface | |
ComponentInterface (const std::shared_ptr< rclcpp::node_interfaces::NodeInterfaces< ALL_RCLCPP_NODE_INTERFACES > > &interfaces) | |
Constructor with all node interfaces. | |
double | get_rate () const |
Get the component rate in Hertz. | |
template<typename T > | |
T | get_period () const |
Get the component period. | |
virtual void | on_step_callback () |
Steps to execute periodically. To be redefined by derived Component classes. | |
void | add_parameter (const std::shared_ptr< state_representation::ParameterInterface > ¶meter, const std::string &description, bool read_only=false) |
Add a parameter. | |
template<typename T > | |
void | add_parameter (const std::string &name, const T &value, const std::string &description, bool read_only=false) |
Add a parameter. | |
std::shared_ptr< state_representation::ParameterInterface > | get_parameter (const std::string &name) const |
Get a parameter by name. | |
template<typename T > | |
T | get_parameter_value (const std::string &name) const |
Get a parameter value by name. | |
template<typename T > | |
void | set_parameter_value (const std::string &name, const T &value) |
Set the value of a parameter. | |
virtual bool | on_validate_parameter_callback (const std::shared_ptr< state_representation::ParameterInterface > ¶meter) |
Parameter validation function to be redefined by derived Component classes. | |
void | add_predicate (const std::string &predicate_name, bool predicate_value) |
Add a predicate to the map of predicates. | |
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. | |
bool | get_predicate (const std::string &predicate_name) const |
Get the logical value of a predicate. | |
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. | |
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. | |
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. | |
void | trigger (const std::string &trigger_name) |
Latch the trigger with the provided name. | |
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. | |
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. | |
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. | |
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. | |
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. | |
template<typename DataT > | |
std::string | create_output (modulo_core::communication::PublisherType publisher_type, 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. | |
void | publish_output (const std::string &signal_name) |
Trigger the publishing of an output. | |
void | remove_input (const std::string &signal_name) |
Remove an input from the map of inputs. | |
void | remove_output (const std::string &signal_name) |
Remove an output from the map of outputs. | |
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. | |
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. | |
void | add_periodic_callback (const std::string &name, const std::function< void(void)> &callback) |
Add a periodic callback function. | |
void | add_tf_broadcaster () |
Configure a transform broadcaster. | |
void | add_static_tf_broadcaster () |
Configure a static transform broadcaster. | |
void | add_tf_listener () |
Configure a transform buffer and listener. | |
void | send_transform (const state_representation::CartesianPose &transform) |
Send a transform to TF. | |
void | send_transforms (const std::vector< state_representation::CartesianPose > &transforms) |
Send a vector of transforms to TF. | |
void | send_static_transform (const state_representation::CartesianPose &transform) |
Send a static transform to TF. | |
void | send_static_transforms (const std::vector< state_representation::CartesianPose > &transforms) |
Send a vector of static transforms to TF. | |
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. | |
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. | |
rclcpp::QoS | get_qos () const |
Getter of the Quality of Service attribute. | |
void | set_qos (const rclcpp::QoS &qos) |
Set the Quality of Service for ROS publishers and subscribers. | |
void | publish_predicates () |
Helper function to publish all predicates. | |
void | publish_outputs () |
Helper function to publish all output signals. | |
void | evaluate_periodic_callbacks () |
Helper function to evaluate all periodic function callbacks. | |
void | finalize_interfaces () |
Finalize all interfaces. | |
+Friends | |
class | ComponentPublicInterface |
+Additional Inherited Members | |
Protected Attributes inherited from modulo_components::ComponentInterface | |
std::map< std::string, std::shared_ptr< modulo_core::communication::SubscriptionInterface > > | inputs_ |
Map of inputs. | |
std::map< std::string, std::shared_ptr< modulo_core::communication::PublisherInterface > > | outputs_ |
Map of outputs. | |
std::map< std::string, bool > | periodic_outputs_ |
Map of outputs with periodic publishing flag. | |
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 23 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 8 of file Component.cpp.
+ +
+
|
+ +virtual | +
Destructor that joins the thread if necessary.
+ +Definition at line 21 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 104 of file Component.hpp.
+ +
+
|
+ +protected | +
Start the execution thread.
+ +Definition at line 39 of file Component.cpp.
+ +
+
|
+ +protected | +
Get a parameter by name.
+name | The name of the parameter |
modulo_core::exceptions::ParameterException | if the parameter could not be found |
Definition at line 67 of file Component.cpp.
+ +
+
|
+ +protectedvirtual | +
Execute the component logic. To be redefined in derived classes.
+Definition at line 63 of file Component.cpp.
+ +
+
|
+ +overrideprotectedvirtual | +
Set the in_error_state predicate to true and cancel the step timer.
+ +Reimplemented from modulo_components::ComponentInterface.
+ +Definition at line 71 of file Component.cpp.
+ +Definition at line 25 of file Component.hpp.
+ +
+ Modulo 5.0.0
+
+ |
+
This is the complete list of members for modulo_components::ComponentInterface, 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 | 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 | 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 | inlineprotected |
add_parameter(const std::shared_ptr< state_representation::ParameterInterface > ¶meter, const std::string &description, bool read_only=false) | modulo_components::ComponentInterface | protected |
add_parameter(const std::string &name, const T &value, const std::string &description, bool read_only=false) | modulo_components::ComponentInterface | inlineprotected |
add_periodic_callback(const std::string &name, const std::function< void(void)> &callback) | modulo_components::ComponentInterface | protected |
add_predicate(const std::string &predicate_name, bool predicate_value) | modulo_components::ComponentInterface | protected |
add_predicate(const std::string &predicate_name, const std::function< bool(void)> &predicate_function) | modulo_components::ComponentInterface | protected |
add_service(const std::string &service_name, const std::function< ComponentServiceResponse(void)> &callback) | modulo_components::ComponentInterface | protected |
add_service(const std::string &service_name, const std::function< ComponentServiceResponse(const std::string &string)> &callback) | modulo_components::ComponentInterface | protected |
add_static_tf_broadcaster() | modulo_components::ComponentInterface | protected |
add_tf_broadcaster() | modulo_components::ComponentInterface | protected |
add_tf_listener() | modulo_components::ComponentInterface | protected |
add_trigger(const std::string &trigger_name) | modulo_components::ComponentInterface | protected |
ComponentInterface(const std::shared_ptr< rclcpp::node_interfaces::NodeInterfaces< ALL_RCLCPP_NODE_INTERFACES > > &interfaces) | modulo_components::ComponentInterface | explicitprotected |
ComponentInterfacePublicInterface (defined in modulo_components::ComponentInterface) | modulo_components::ComponentInterface | friend |
create_output(modulo_core::communication::PublisherType publisher_type, 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 | inlineprotected |
declare_input(const std::string &signal_name, const std::string &default_topic="", bool fixed_topic=false) | modulo_components::ComponentInterface | protected |
declare_output(const std::string &signal_name, const std::string &default_topic="", bool fixed_topic=false) | modulo_components::ComponentInterface | protected |
evaluate_periodic_callbacks() | modulo_components::ComponentInterface | protected |
finalize_interfaces() | modulo_components::ComponentInterface | protected |
get_parameter(const std::string &name) const | modulo_components::ComponentInterface | protected |
get_parameter_value(const std::string &name) const | modulo_components::ComponentInterface | inlineprotected |
get_period() const | modulo_components::ComponentInterface | protected |
get_period() const (defined in modulo_components::ComponentInterface) | modulo_components::ComponentInterface | |
get_period() const (defined in modulo_components::ComponentInterface) | modulo_components::ComponentInterface | |
get_period() const (defined in modulo_components::ComponentInterface) | modulo_components::ComponentInterface | |
get_predicate(const std::string &predicate_name) const | modulo_components::ComponentInterface | protected |
get_qos() const | modulo_components::ComponentInterface | protected |
get_rate() const | modulo_components::ComponentInterface | protected |
inputs_ | modulo_components::ComponentInterface | protected |
lookup_transform(const std::string &frame, const std::string &reference_frame, const tf2::TimePoint &time_point, const tf2::Duration &duration) | modulo_components::ComponentInterface | protected |
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 | protected |
on_step_callback() | modulo_components::ComponentInterface | protectedvirtual |
on_validate_parameter_callback(const std::shared_ptr< state_representation::ParameterInterface > ¶meter) | modulo_components::ComponentInterface | protectedvirtual |
outputs_ | modulo_components::ComponentInterface | protected |
periodic_outputs_ | modulo_components::ComponentInterface | protected |
publish_output(const std::string &signal_name) | modulo_components::ComponentInterface | protected |
publish_outputs() | modulo_components::ComponentInterface | protected |
publish_predicates() | modulo_components::ComponentInterface | protected |
raise_error() | modulo_components::ComponentInterface | protectedvirtual |
remove_input(const std::string &signal_name) | modulo_components::ComponentInterface | protected |
remove_output(const std::string &signal_name) | modulo_components::ComponentInterface | protected |
send_static_transform(const state_representation::CartesianPose &transform) | modulo_components::ComponentInterface | protected |
send_static_transforms(const std::vector< state_representation::CartesianPose > &transforms) | modulo_components::ComponentInterface | protected |
send_transform(const state_representation::CartesianPose &transform) | modulo_components::ComponentInterface | protected |
send_transforms(const std::vector< state_representation::CartesianPose > &transforms) | modulo_components::ComponentInterface | protected |
set_parameter_value(const std::string &name, const T &value) | modulo_components::ComponentInterface | inlineprotected |
set_predicate(const std::string &predicate_name, bool predicate_value) | modulo_components::ComponentInterface | protected |
set_predicate(const std::string &predicate_name, const std::function< bool(void)> &predicate_function) | modulo_components::ComponentInterface | protected |
set_qos(const rclcpp::QoS &qos) | modulo_components::ComponentInterface | protected |
step() | modulo_components::ComponentInterface | protectedvirtual |
trigger(const std::string &trigger_name) | modulo_components::ComponentInterface | protected |
~ComponentInterface() | modulo_components::ComponentInterface | virtual |
+ Modulo 5.0.0
+
+ |
+
Base interface class for modulo components to wrap a ROS Node with custom behaviour. + More...
+ +#include <ComponentInterface.hpp>
+Public Member Functions | |
virtual | ~ComponentInterface () |
Virtual destructor. | |
template<> | |
double | get_period () const |
template<> | |
std::chrono::nanoseconds | get_period () const |
template<> | |
rclcpp::Duration | get_period () const |
+Protected Member Functions | |
ComponentInterface (const std::shared_ptr< rclcpp::node_interfaces::NodeInterfaces< ALL_RCLCPP_NODE_INTERFACES > > &interfaces) | |
Constructor with all node interfaces. | |
double | get_rate () const |
Get the component rate in Hertz. | |
template<typename T > | |
T | get_period () const |
Get the component period. | |
virtual void | step () |
Step function that is called periodically. | |
virtual void | on_step_callback () |
Steps to execute periodically. To be redefined by derived Component classes. | |
void | add_parameter (const std::shared_ptr< state_representation::ParameterInterface > ¶meter, const std::string &description, bool read_only=false) |
Add a parameter. | |
template<typename T > | |
void | add_parameter (const std::string &name, const T &value, const std::string &description, bool read_only=false) |
Add a parameter. | |
std::shared_ptr< state_representation::ParameterInterface > | get_parameter (const std::string &name) const |
Get a parameter by name. | |
template<typename T > | |
T | get_parameter_value (const std::string &name) const |
Get a parameter value by name. | |
template<typename T > | |
void | set_parameter_value (const std::string &name, const T &value) |
Set the value of a parameter. | |
virtual bool | on_validate_parameter_callback (const std::shared_ptr< state_representation::ParameterInterface > ¶meter) |
Parameter validation function to be redefined by derived Component classes. | |
void | add_predicate (const std::string &predicate_name, bool predicate_value) |
Add a predicate to the map of predicates. | |
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. | |
bool | get_predicate (const std::string &predicate_name) const |
Get the logical value of a predicate. | |
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. | |
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. | |
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. | |
void | trigger (const std::string &trigger_name) |
Latch the trigger with the provided name. | |
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. | |
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. | |
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. | |
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. | |
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. | |
template<typename DataT > | |
std::string | create_output (modulo_core::communication::PublisherType publisher_type, 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. | |
void | publish_output (const std::string &signal_name) |
Trigger the publishing of an output. | |
void | remove_input (const std::string &signal_name) |
Remove an input from the map of inputs. | |
void | remove_output (const std::string &signal_name) |
Remove an output from the map of outputs. | |
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. | |
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. | |
void | add_periodic_callback (const std::string &name, const std::function< void(void)> &callback) |
Add a periodic callback function. | |
void | add_tf_broadcaster () |
Configure a transform broadcaster. | |
void | add_static_tf_broadcaster () |
Configure a static transform broadcaster. | |
void | add_tf_listener () |
Configure a transform buffer and listener. | |
void | send_transform (const state_representation::CartesianPose &transform) |
Send a transform to TF. | |
void | send_transforms (const std::vector< state_representation::CartesianPose > &transforms) |
Send a vector of transforms to TF. | |
void | send_static_transform (const state_representation::CartesianPose &transform) |
Send a static transform to TF. | |
void | send_static_transforms (const std::vector< state_representation::CartesianPose > &transforms) |
Send a vector of static transforms to TF. | |
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. | |
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. | |
rclcpp::QoS | get_qos () const |
Getter of the Quality of Service attribute. | |
void | set_qos (const rclcpp::QoS &qos) |
Set the Quality of Service for ROS publishers and subscribers. | |
virtual void | raise_error () |
Notify an error in the component. | |
void | publish_predicates () |
Helper function to publish all predicates. | |
void | publish_outputs () |
Helper function to publish all output signals. | |
void | evaluate_periodic_callbacks () |
Helper function to evaluate all periodic function callbacks. | |
void | finalize_interfaces () |
Finalize all interfaces. | |
+Protected Attributes | |
std::map< std::string, std::shared_ptr< modulo_core::communication::SubscriptionInterface > > | inputs_ |
Map of inputs. | |
std::map< std::string, std::shared_ptr< modulo_core::communication::PublisherInterface > > | outputs_ |
Map of outputs. | |
std::map< std::string, bool > | periodic_outputs_ |
Map of outputs with periodic publishing flag. | |
+Friends | |
class | ComponentInterfacePublicInterface |
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.
Definition at line 56 of file ComponentInterface.hpp.
+
+
|
+ +virtual | +
Virtual destructor.
+ +Definition at line 49 of file ComponentInterface.cpp.
+ +
+
|
+ +explicitprotected | +
Constructor with all node interfaces.
+interfaces | Shared pointer to all the node interfaces of parent class |
Definition at line 13 of file ComponentInterface.cpp.
+ +
+
|
+ +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 728 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 637 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 630 of file ComponentInterface.hpp.
+ +
+
|
+ +protected | +
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 |
ParameterException | if the parameter could not be added |
Definition at line 76 of file ComponentInterface.cpp.
+ +
+
|
+ +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 |
ParameterException | if the parameter could not be added |
Definition at line 590 of file ComponentInterface.hpp.
+ +
+
|
+ +protected | +
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 447 of file ComponentInterface.cpp.
+ +
+
|
+ +protected | +
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 190 of file ComponentInterface.cpp.
+ +
+
|
+ +protected | +
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 194 of file ComponentInterface.cpp.
+ +
+
|
+ +protected | +
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 394 of file ComponentInterface.cpp.
+ +
+
|
+ +protected | +
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 367 of file ComponentInterface.cpp.
+ +
+
|
+ +protected | +
Configure a static transform broadcaster.
+ +Definition at line 473 of file ComponentInterface.cpp.
+ +
+
|
+ +protected | +
Configure a transform broadcaster.
+ +Definition at line 462 of file ComponentInterface.cpp.
+ +
+
|
+ +protected | +
Configure a transform buffer and listener.
+ +Definition at line 486 of file ComponentInterface.cpp.
+ +
+
|
+ +protected | +
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 253 of file ComponentInterface.cpp.
+ +
+
|
+ +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_core::exceptions::AddSignalException | if the output could not be created (empty name, already registered) |
Definition at line 751 of file ComponentInterface.hpp.
+ +
+
|
+ +protected | +
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_core::exceptions::AddSignalException | if the input could not be declared (empty name or already created) |
Definition at line 286 of file ComponentInterface.cpp.
+ +
+
|
+ +protected | +
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_core::exceptions::AddSignalException | if the output could not be declared (empty name or already created) |
Definition at line 291 of file ComponentInterface.cpp.
+ +
+
|
+ +protected | +
Helper function to evaluate all periodic function callbacks.
+ +Definition at line 600 of file ComponentInterface.cpp.
+ +
+
|
+ +protected | +
Finalize all interfaces.
+ +Definition at line 612 of file ComponentInterface.cpp.
+ +
+
|
+ +protected | +
Get a parameter by name.
+name | The name of the parameter |
modulo_core::exceptions::ParameterException | if the parameter could not be found |
Definition at line 123 of file ComponentInterface.cpp.
+ +
+
|
+ +inlineprotected | +
Get a parameter value by name.
+T | The type of the parameter |
name | The name of the parameter |
modulo_core::exceptions::ParameterException | if the parameter value could not be accessed |
Definition at line 600 of file ComponentInterface.hpp.
+ +
+
|
+ +protected | +
Get the component period.
+double modulo_components::ComponentInterface::get_period | +( | +) | +const | +
Definition at line 58 of file ComponentInterface.cpp.
+ +std::chrono::nanoseconds modulo_components::ComponentInterface::get_period | +( | +) | +const | +
Definition at line 63 of file ComponentInterface.cpp.
+ +rclcpp::Duration modulo_components::ComponentInterface::get_period | +( | +) | +const | +
Definition at line 68 of file ComponentInterface.cpp.
+ +
+
|
+ +protected | +
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 216 of file ComponentInterface.cpp.
+ +
+
|
+ +protected | +
Getter of the Quality of Service attribute.
+Definition at line 549 of file ComponentInterface.cpp.
+ +
+
|
+ +protected | +
Get the component rate in Hertz.
+Definition at line 53 of file ComponentInterface.cpp.
+ +
+
|
+ +protected | +
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_core::exceptions::LookupTransformException | if TF buffer/listener are unconfigured or if the lookupTransform call failed |
Definition at line 513 of file ComponentInterface.cpp.
+ +
+
|
+ +protected | +
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_core::exceptions::LookupTransformException | if TF buffer/listener are unconfigured, if the lookupTransform call failed, or if the transform is too old |
Definition at line 522 of file ComponentInterface.cpp.
+ +
+
|
+ +protectedvirtual | +
Steps to execute periodically. To be redefined by derived Component classes.
+ +Definition at line 74 of file ComponentInterface.cpp.
+ +
+
|
+ +protectedvirtual | +
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 185 of file ComponentInterface.cpp.
+ +
+
|
+ +protected | +
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 328 of file ComponentInterface.cpp.
+ +
+
|
+ +protected | +
Helper function to publish all output signals.
+ +Definition at line 586 of file ComponentInterface.cpp.
+ +
+
|
+ +protected | +
Helper function to publish all predicates.
+ +Definition at line 574 of file ComponentInterface.cpp.
+ +
+
|
+ +protectedvirtual | +
Notify an error in the component.
+ +Reimplemented in modulo_components::Component, and modulo_components::LifecycleComponent.
+ +Definition at line 557 of file ComponentInterface.cpp.
+ +
+
|
+ +protected | +
Remove an input from the map of inputs.
+signal_name | The name of the input |
Definition at line 345 of file ComponentInterface.cpp.
+ +
+
|
+ +protected | +
Remove an output from the map of outputs.
+signal_name | The name of the output |
Definition at line 356 of file ComponentInterface.cpp.
+ +
+
|
+ +protected | +
Send a static transform to TF.
+transform | The transform to send |
Definition at line 505 of file ComponentInterface.cpp.
+ +
+
|
+ +protected | +
Send a vector of static transforms to TF.
+transforms | The vector of transforms to send |
Definition at line 509 of file ComponentInterface.cpp.
+ +
+
|
+ +protected | +
Send a transform to TF.
+transform | The transform to send |
Definition at line 497 of file ComponentInterface.cpp.
+ +
+
|
+ +protected | +
Send a vector of transforms to TF.
+transforms | The vector of transforms to send |
Definition at line 501 of file ComponentInterface.cpp.
+ +
+
|
+ +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 610 of file ComponentInterface.hpp.
+ +
+
|
+ +protected | +
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 234 of file ComponentInterface.cpp.
+ +
+
|
+ +protected | +
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 238 of file ComponentInterface.cpp.
+ +
+
|
+ +protected | +
Set the Quality of Service for ROS publishers and subscribers.
+qos | The desired Quality of Service |
Definition at line 553 of file ComponentInterface.cpp.
+ +
+
|
+ +protectedvirtual | +
Step function that is called periodically.
+ +Definition at line 72 of file ComponentInterface.cpp.
+ +
+
|
+ +protected | +
Latch the trigger with the provided name.
+trigger_name | The name of the trigger |
Definition at line 274 of file ComponentInterface.cpp.
+ +
+
|
+ +friend | +
Definition at line 58 of file ComponentInterface.hpp.
+ +
+
|
+ +protected | +
Map of inputs.
+ +Definition at line 445 of file ComponentInterface.hpp.
+ +
+
|
+ +protected | +
Map of outputs.
+ +Definition at line 446 of file ComponentInterface.hpp.
+ +
+
|
+ +protected | +
Map of outputs with periodic publishing flag.
+ +Definition at line 447 of file ComponentInterface.hpp.
+ +
+ Modulo 5.0.0
+
+ |
+
This is the complete list of members for modulo_components::LifecycleComponent, 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 | 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 | 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 | 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::LifecycleComponent | inlineprotected |
add_parameter(const std::shared_ptr< state_representation::ParameterInterface > ¶meter, const std::string &description, bool read_only=false) | modulo_components::ComponentInterface | protected |
add_parameter(const std::string &name, const T &value, const std::string &description, bool read_only=false) | modulo_components::ComponentInterface | inlineprotected |
add_periodic_callback(const std::string &name, const std::function< void(void)> &callback) | modulo_components::ComponentInterface | protected |
add_predicate(const std::string &predicate_name, bool predicate_value) | modulo_components::ComponentInterface | protected |
add_predicate(const std::string &predicate_name, const std::function< bool(void)> &predicate_function) | modulo_components::ComponentInterface | protected |
add_service(const std::string &service_name, const std::function< ComponentServiceResponse(void)> &callback) | modulo_components::ComponentInterface | protected |
add_service(const std::string &service_name, const std::function< ComponentServiceResponse(const std::string &string)> &callback) | modulo_components::ComponentInterface | protected |
add_static_tf_broadcaster() | modulo_components::ComponentInterface | protected |
add_tf_broadcaster() | modulo_components::ComponentInterface | protected |
add_tf_listener() | modulo_components::ComponentInterface | protected |
add_trigger(const std::string &trigger_name) | modulo_components::ComponentInterface | protected |
ComponentInterface(const std::shared_ptr< rclcpp::node_interfaces::NodeInterfaces< ALL_RCLCPP_NODE_INTERFACES > > &interfaces) | modulo_components::ComponentInterface | explicitprotected |
declare_input(const std::string &signal_name, const std::string &default_topic="", bool fixed_topic=false) | modulo_components::ComponentInterface | protected |
declare_output(const std::string &signal_name, const std::string &default_topic="", bool fixed_topic=false) | modulo_components::ComponentInterface | protected |
get_lifecycle_state() const | modulo_components::LifecycleComponent | protected |
get_parameter(const std::string &name) const | modulo_components::LifecycleComponent | protected |
get_parameter_value(const std::string &name) const | modulo_components::ComponentInterface | inlineprotected |
get_period() const | modulo_components::ComponentInterface | protected |
get_period() const (defined in modulo_components::ComponentInterface) | modulo_components::ComponentInterface | |
get_period() const (defined in modulo_components::ComponentInterface) | modulo_components::ComponentInterface | |
get_period() const (defined in modulo_components::ComponentInterface) | modulo_components::ComponentInterface | |
get_predicate(const std::string &predicate_name) const | modulo_components::ComponentInterface | protected |
get_qos() const | modulo_components::ComponentInterface | protected |
get_rate() const | modulo_components::ComponentInterface | protected |
LifecycleComponent(const rclcpp::NodeOptions &node_options, const std::string &fallback_name="LifecycleComponent") | modulo_components::LifecycleComponent | explicit |
LifecycleComponentPublicInterface (defined in modulo_components::LifecycleComponent) | modulo_components::LifecycleComponent | friend |
lookup_transform(const std::string &frame, const std::string &reference_frame, const tf2::TimePoint &time_point, const tf2::Duration &duration) | modulo_components::ComponentInterface | protected |
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 | protected |
on_activate_callback() | modulo_components::LifecycleComponent | protectedvirtual |
on_cleanup_callback() | modulo_components::LifecycleComponent | protectedvirtual |
on_configure_callback() | modulo_components::LifecycleComponent | protectedvirtual |
on_deactivate_callback() | modulo_components::LifecycleComponent | protectedvirtual |
on_error_callback() | modulo_components::LifecycleComponent | protectedvirtual |
on_shutdown_callback() | modulo_components::LifecycleComponent | protectedvirtual |
on_step_callback() | modulo_components::ComponentInterface | protectedvirtual |
on_validate_parameter_callback(const std::shared_ptr< state_representation::ParameterInterface > ¶meter) | modulo_components::ComponentInterface | protectedvirtual |
publish_output(const std::string &signal_name) | modulo_components::ComponentInterface | protected |
raise_error() override | modulo_components::LifecycleComponent | protectedvirtual |
remove_input(const std::string &signal_name) | modulo_components::ComponentInterface | protected |
remove_output(const std::string &signal_name) | modulo_components::ComponentInterface | protected |
send_static_transform(const state_representation::CartesianPose &transform) | modulo_components::ComponentInterface | protected |
send_static_transforms(const std::vector< state_representation::CartesianPose > &transforms) | modulo_components::ComponentInterface | protected |
send_transform(const state_representation::CartesianPose &transform) | modulo_components::ComponentInterface | protected |
send_transforms(const std::vector< state_representation::CartesianPose > &transforms) | modulo_components::ComponentInterface | protected |
set_parameter_value(const std::string &name, const T &value) | modulo_components::ComponentInterface | inlineprotected |
set_predicate(const std::string &predicate_name, bool predicate_value) | modulo_components::ComponentInterface | protected |
set_predicate(const std::string &predicate_name, const std::function< bool(void)> &predicate_function) | modulo_components::ComponentInterface | protected |
set_qos(const rclcpp::QoS &qos) | modulo_components::ComponentInterface | protected |
trigger(const std::string &trigger_name) | modulo_components::ComponentInterface | protected |
~ComponentInterface() | modulo_components::ComponentInterface | virtual |
~LifecycleComponent()=default | modulo_components::LifecycleComponent | virtual |
+ Modulo 5.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. | |
+virtual | ~LifecycleComponent ()=default |
Virtual default destructor. | |
Public Member Functions inherited from modulo_components::ComponentInterface | |
virtual | ~ComponentInterface () |
Virtual destructor. | |
template<> | |
double | get_period () const |
template<> | |
std::chrono::nanoseconds | get_period () const |
template<> | |
rclcpp::Duration | get_period () const |
+Protected Member Functions | |
std::shared_ptr< state_representation::ParameterInterface > | get_parameter (const std::string &name) const |
Get a parameter by name. | |
virtual bool | on_configure_callback () |
Steps to execute when configuring the component. | |
virtual bool | on_cleanup_callback () |
Steps to execute when cleaning up the component. | |
virtual bool | on_activate_callback () |
Steps to execute when activating the component. | |
virtual bool | on_deactivate_callback () |
Steps to execute when deactivating the component. | |
virtual bool | on_shutdown_callback () |
Steps to execute when shutting down the component. | |
virtual bool | on_error_callback () |
Steps to execute when handling errors. | |
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. | |
rclcpp_lifecycle::State | get_lifecycle_state () const |
Get the current lifecycle state of the component. | |
void | raise_error () override |
Trigger the shutdown and error transitions. | |
Protected Member Functions inherited from modulo_components::ComponentInterface | |
ComponentInterface (const std::shared_ptr< rclcpp::node_interfaces::NodeInterfaces< ALL_RCLCPP_NODE_INTERFACES > > &interfaces) | |
Constructor with all node interfaces. | |
double | get_rate () const |
Get the component rate in Hertz. | |
template<typename T > | |
T | get_period () const |
Get the component period. | |
virtual void | on_step_callback () |
Steps to execute periodically. To be redefined by derived Component classes. | |
void | add_parameter (const std::shared_ptr< state_representation::ParameterInterface > ¶meter, const std::string &description, bool read_only=false) |
Add a parameter. | |
template<typename T > | |
void | add_parameter (const std::string &name, const T &value, const std::string &description, bool read_only=false) |
Add a parameter. | |
std::shared_ptr< state_representation::ParameterInterface > | get_parameter (const std::string &name) const |
Get a parameter by name. | |
template<typename T > | |
T | get_parameter_value (const std::string &name) const |
Get a parameter value by name. | |
template<typename T > | |
void | set_parameter_value (const std::string &name, const T &value) |
Set the value of a parameter. | |
virtual bool | on_validate_parameter_callback (const std::shared_ptr< state_representation::ParameterInterface > ¶meter) |
Parameter validation function to be redefined by derived Component classes. | |
void | add_predicate (const std::string &predicate_name, bool predicate_value) |
Add a predicate to the map of predicates. | |
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. | |
bool | get_predicate (const std::string &predicate_name) const |
Get the logical value of a predicate. | |
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. | |
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. | |
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. | |
void | trigger (const std::string &trigger_name) |
Latch the trigger with the provided name. | |
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. | |
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. | |
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. | |
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. | |
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. | |
template<typename DataT > | |
std::string | create_output (modulo_core::communication::PublisherType publisher_type, 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. | |
void | publish_output (const std::string &signal_name) |
Trigger the publishing of an output. | |
void | remove_input (const std::string &signal_name) |
Remove an input from the map of inputs. | |
void | remove_output (const std::string &signal_name) |
Remove an output from the map of outputs. | |
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. | |
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. | |
void | add_periodic_callback (const std::string &name, const std::function< void(void)> &callback) |
Add a periodic callback function. | |
void | add_tf_broadcaster () |
Configure a transform broadcaster. | |
void | add_static_tf_broadcaster () |
Configure a static transform broadcaster. | |
void | add_tf_listener () |
Configure a transform buffer and listener. | |
void | send_transform (const state_representation::CartesianPose &transform) |
Send a transform to TF. | |
void | send_transforms (const std::vector< state_representation::CartesianPose > &transforms) |
Send a vector of transforms to TF. | |
void | send_static_transform (const state_representation::CartesianPose &transform) |
Send a static transform to TF. | |
void | send_static_transforms (const std::vector< state_representation::CartesianPose > &transforms) |
Send a vector of static transforms to TF. | |
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. | |
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. | |
rclcpp::QoS | get_qos () const |
Getter of the Quality of Service attribute. | |
void | set_qos (const rclcpp::QoS &qos) |
Set the Quality of Service for ROS publishers and subscribers. | |
void | publish_predicates () |
Helper function to publish all predicates. | |
void | publish_outputs () |
Helper function to publish all output signals. | |
void | evaluate_periodic_callbacks () |
Helper function to evaluate all periodic function callbacks. | |
void | finalize_interfaces () |
Finalize all interfaces. | |
+Friends | |
class | LifecycleComponentPublicInterface |
+Additional Inherited Members | |
Protected Attributes inherited from modulo_components::ComponentInterface | |
std::map< std::string, std::shared_ptr< modulo_core::communication::SubscriptionInterface > > | inputs_ |
Map of inputs. | |
std::map< std::string, std::shared_ptr< modulo_core::communication::PublisherInterface > > | outputs_ |
Map of outputs. | |
std::map< std::string, bool > | periodic_outputs_ |
Map of outputs with periodic publishing flag. | |
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 29 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 8 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 287 of file LifecycleComponent.hpp.
+ +
+
|
+ +protected | +
Get the current lifecycle state of the component.
+ +Definition at line 333 of file LifecycleComponent.cpp.
+ +
+
|
+ +protected | +
Get a parameter by name.
+name | The name of the parameter |
modulo_core::exceptions::ParameterException | if the parameter could not be found |
Definition at line 20 of file LifecycleComponent.cpp.
+ +
+
|
+ +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 131 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 96 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 70 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 158 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 232 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 206 of file LifecycleComponent.cpp.
+ +
+
|
+ +overrideprotectedvirtual | +
Trigger the shutdown and error transitions.
+ +Reimplemented from modulo_components::ComponentInterface.
+ +Definition at line 337 of file LifecycleComponent.cpp.
+ +Definition at line 31 of file LifecycleComponent.hpp.
+ +
+ Modulo 5.0.0
+
+ |
+
This is the complete list of members for modulo_controllers::BaseControllerInterface, including all inherited members.
+add_input(const std::string &name, const std::string &topic_name="") | modulo_controllers::BaseControllerInterface | inlineprotected |
add_input(const std::string &name, const std::string &topic_name) (defined in modulo_controllers::BaseControllerInterface) | modulo_controllers::BaseControllerInterface | inlineprotected |
add_input(const std::string &name, const std::string &topic_name) (defined in modulo_controllers::BaseControllerInterface) | modulo_controllers::BaseControllerInterface | inlineprotected |
add_input(const std::string &name, const std::string &topic_name) (defined in modulo_controllers::BaseControllerInterface) | modulo_controllers::BaseControllerInterface | inlineprotected |
add_output(const std::string &name, const std::string &topic_name="") | modulo_controllers::BaseControllerInterface | inlineprotected |
add_output(const std::string &name, const std::string &topic_name) (defined in modulo_controllers::BaseControllerInterface) | modulo_controllers::BaseControllerInterface | inlineprotected |
add_output(const std::string &name, const std::string &topic_name) (defined in modulo_controllers::BaseControllerInterface) | modulo_controllers::BaseControllerInterface | inlineprotected |
add_output(const std::string &name, const std::string &topic_name) (defined in modulo_controllers::BaseControllerInterface) | modulo_controllers::BaseControllerInterface | inlineprotected |
add_parameter(const std::shared_ptr< state_representation::ParameterInterface > ¶meter, const std::string &description, bool read_only=false) | modulo_controllers::BaseControllerInterface | protected |
add_parameter(const std::string &name, const T &value, const std::string &description, bool read_only=false) | modulo_controllers::BaseControllerInterface | inlineprotected |
add_predicate(const std::string &predicate_name, bool predicate_value) | modulo_controllers::BaseControllerInterface | protected |
add_predicate(const std::string &predicate_name, const std::function< bool(void)> &predicate_function) | modulo_controllers::BaseControllerInterface | protected |
add_service(const std::string &service_name, const std::function< ControllerServiceResponse(void)> &callback) | modulo_controllers::BaseControllerInterface | protected |
add_service(const std::string &service_name, const std::function< ControllerServiceResponse(const std::string &string)> &callback) | modulo_controllers::BaseControllerInterface | protected |
add_trigger(const std::string &trigger_name) | modulo_controllers::BaseControllerInterface | protected |
BaseControllerInterface() | modulo_controllers::BaseControllerInterface | |
get_command_mutex() | modulo_controllers::BaseControllerInterface | protected |
get_parameter(const std::string &name) const | modulo_controllers::BaseControllerInterface | protected |
get_parameter_value(const std::string &name) const | modulo_controllers::BaseControllerInterface | inlineprotected |
get_predicate(const std::string &predicate_name) const | modulo_controllers::BaseControllerInterface | protected |
get_qos() const | modulo_controllers::BaseControllerInterface | protected |
is_active() const | modulo_controllers::BaseControllerInterface | protected |
on_configure(const rclcpp_lifecycle::State &previous_state) override | modulo_controllers::BaseControllerInterface | |
on_init() override | modulo_controllers::BaseControllerInterface | |
on_validate_parameter_callback(const std::shared_ptr< state_representation::ParameterInterface > ¶meter) | modulo_controllers::BaseControllerInterface | protectedvirtual |
read_input(const std::string &name) | modulo_controllers::BaseControllerInterface | inlineprotected |
read_input(const std::string &name) (defined in modulo_controllers::BaseControllerInterface) | modulo_controllers::BaseControllerInterface | inlineprotected |
read_input(const std::string &name) (defined in modulo_controllers::BaseControllerInterface) | modulo_controllers::BaseControllerInterface | inlineprotected |
read_input(const std::string &name) (defined in modulo_controllers::BaseControllerInterface) | modulo_controllers::BaseControllerInterface | inlineprotected |
set_input_validity_period(double input_validity_period) | modulo_controllers::BaseControllerInterface | protected |
set_parameter_value(const std::string &name, const T &value) | modulo_controllers::BaseControllerInterface | inlineprotected |
set_predicate(const std::string &predicate_name, bool predicate_value) | modulo_controllers::BaseControllerInterface | protected |
set_predicate(const std::string &predicate_name, const std::function< bool(void)> &predicate_function) | modulo_controllers::BaseControllerInterface | protected |
set_qos(const rclcpp::QoS &qos) | modulo_controllers::BaseControllerInterface | protected |
trigger(const std::string &trigger_name) | modulo_controllers::BaseControllerInterface | protected |
write_output(const std::string &name, const T &data) | modulo_controllers::BaseControllerInterface | inlineprotected |
write_output(const std::string &name, const bool &data) (defined in modulo_controllers::BaseControllerInterface) | modulo_controllers::BaseControllerInterface | inline |
write_output(const std::string &name, const double &data) (defined in modulo_controllers::BaseControllerInterface) | modulo_controllers::BaseControllerInterface | inline |
write_output(const std::string &name, const std::vector< double > &data) (defined in modulo_controllers::BaseControllerInterface) | modulo_controllers::BaseControllerInterface | inline |
write_output(const std::string &name, const int &data) (defined in modulo_controllers::BaseControllerInterface) | modulo_controllers::BaseControllerInterface | inline |
write_output(const std::string &name, const std::string &data) (defined in modulo_controllers::BaseControllerInterface) | modulo_controllers::BaseControllerInterface | inline |
+ Modulo 5.0.0
+
+ |
+
Base controller class to combine ros2_control, control libraries and modulo. + More...
+ +#include <BaseControllerInterface.hpp>
+Public Member Functions | |
BaseControllerInterface () | |
Default constructor. | |
CallbackReturn | on_init () override |
Declare parameters and register the on_set_parameters callback. | |
CallbackReturn | on_configure (const rclcpp_lifecycle::State &previous_state) override |
Add signals. | |
template<> | |
void | write_output (const std::string &name, const bool &data) |
template<> | |
void | write_output (const std::string &name, const double &data) |
template<> | |
void | write_output (const std::string &name, const std::vector< double > &data) |
template<> | |
void | write_output (const std::string &name, const int &data) |
template<> | |
void | write_output (const std::string &name, const std::string &data) |
+Protected Member Functions | |
void | add_parameter (const std::shared_ptr< state_representation::ParameterInterface > ¶meter, const std::string &description, bool read_only=false) |
Add a parameter. | |
template<typename T > | |
void | add_parameter (const std::string &name, const T &value, const std::string &description, bool read_only=false) |
Add a parameter. | |
virtual bool | on_validate_parameter_callback (const std::shared_ptr< state_representation::ParameterInterface > ¶meter) |
Parameter validation function to be redefined by derived controller classes. | |
std::shared_ptr< state_representation::ParameterInterface > | get_parameter (const std::string &name) const |
Get a parameter by name. | |
template<typename T > | |
T | get_parameter_value (const std::string &name) const |
Get a parameter value by name. | |
template<typename T > | |
void | set_parameter_value (const std::string &name, const T &value) |
Set the value of a parameter. | |
void | add_predicate (const std::string &predicate_name, bool predicate_value) |
Add a predicate to the map of predicates. | |
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. | |
bool | get_predicate (const std::string &predicate_name) const |
Get the logical value of a predicate. | |
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. | |
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. | |
void | add_trigger (const std::string &trigger_name) |
Add a trigger to the controller. | |
void | trigger (const std::string &trigger_name) |
Latch the trigger with the provided name. | |
template<typename T > | |
void | add_input (const std::string &name, const std::string &topic_name="") |
Add an input to the controller. | |
template<typename T > | |
void | add_output (const std::string &name, const std::string &topic_name="") |
Add an output to the controller. | |
void | set_input_validity_period (double input_validity_period) |
Set the input validity period of input signals. | |
template<typename T > | |
std::optional< T > | read_input (const std::string &name) |
Read the most recent message of an input. | |
template<typename T > | |
void | write_output (const std::string &name, const T &data) |
Write an object to an output. | |
void | add_service (const std::string &service_name, const std::function< ControllerServiceResponse(void)> &callback) |
Add a service to trigger a callback function with no input arguments. | |
void | add_service (const std::string &service_name, const std::function< ControllerServiceResponse(const std::string &string)> &callback) |
Add a service to trigger a callback function with a string payload. | |
rclcpp::QoS | get_qos () const |
Getter of the Quality of Service attribute. | |
void | set_qos (const rclcpp::QoS &qos) |
Set the Quality of Service for ROS publishers and subscribers. | |
bool | is_active () const |
Check if the controller is currently in state active or not. | |
std::timed_mutex & | get_command_mutex () |
Get the reference to the command mutex. | |
template<> | |
void | add_input (const std::string &name, const std::string &topic_name) |
template<> | |
void | add_input (const std::string &name, const std::string &topic_name) |
template<> | |
void | add_input (const std::string &name, const std::string &topic_name) |
template<> | |
void | add_output (const std::string &name, const std::string &topic_name) |
template<> | |
void | add_output (const std::string &name, const std::string &topic_name) |
template<> | |
void | add_output (const std::string &name, const std::string &topic_name) |
template<> | |
std::optional< bool > | read_input (const std::string &name) |
template<> | |
std::optional< double > | read_input (const std::string &name) |
template<> | |
std::optional< int > | read_input (const std::string &name) |
Base controller class to combine ros2_control, control libraries and modulo.
+ +Definition at line 105 of file BaseControllerInterface.hpp.
+modulo_controllers::BaseControllerInterface::BaseControllerInterface | +( | +) | ++ |
Default constructor.
+ +Definition at line 22 of file BaseControllerInterface.cpp.
+ +
+
|
+ +inlineprotected | +
Definition at line 562 of file BaseControllerInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Definition at line 569 of file BaseControllerInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Definition at line 584 of file BaseControllerInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Add an input to the controller.
+Inputs should be added in the on_init function of the derived controllers. Doing this will create a ROS 2 subscription for the message type.
T | The type of the input data |
name | The name of the input |
topic_name | The topic name of the input (defaults to ~/name) |
Definition at line 528 of file BaseControllerInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Definition at line 627 of file BaseControllerInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Definition at line 632 of file BaseControllerInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Definition at line 643 of file BaseControllerInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Add an output to the controller.
+Outputs should be added in the on_init function of the derived controllers. Doing this will create a ROS 2 publisher for the message type and wrap it in a RealtimePublisher.
T | The type of the output data |
name | The name of the output |
topic_name | The topic name of the output (defaults to ~/name) |
Definition at line 607 of file BaseControllerInterface.hpp.
+ +
+
|
+ +protected | +
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 |
+
|
+ +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 |
Definition at line 488 of file BaseControllerInterface.hpp.
+ +
+
|
+ +protected | +
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 168 of file BaseControllerInterface.cpp.
+ +
+
|
+ +protected | +
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 172 of file BaseControllerInterface.cpp.
+ +
+
|
+ +protected | +
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 ControllerServiceResponse |
Definition at line 508 of file BaseControllerInterface.cpp.
+ +
+
|
+ +protected | +
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 ControllerServiceResponse |
Definition at line 475 of file BaseControllerInterface.cpp.
+ +
+
|
+ +protected | +
Add a trigger to the controller.
+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 230 of file BaseControllerInterface.cpp.
+ +
+
|
+ +protected | +
Get the reference to the command mutex.
+Definition at line 554 of file BaseControllerInterface.cpp.
+ +
+
|
+ +protected | +
Get a parameter by name.
+name | The name of the parameter |
Definition at line 102 of file BaseControllerInterface.cpp.
+ +
+
|
+ +inlineprotected | +
Get a parameter value by name.
+T | The type of the parameter |
name | The name of the parameter |
Definition at line 498 of file BaseControllerInterface.hpp.
+ +
+
|
+ +protected | +
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 193 of file BaseControllerInterface.cpp.
+ +
+
|
+ +protected | +
Getter of the Quality of Service attribute.
+Definition at line 542 of file BaseControllerInterface.cpp.
+ +
+
|
+ +protected | +
Check if the controller is currently in state active or not.
+Definition at line 550 of file BaseControllerInterface.cpp.
+ +
+
|
+ +override | +
Add signals.
+previous_state | The previous lifecycle state |
Definition at line 39 of file BaseControllerInterface.cpp.
+ +
+
|
+ +override | +
Declare parameters and register the on_set_parameters callback.
+Definition at line 25 of file BaseControllerInterface.cpp.
+ +
+
|
+ +protectedvirtual | +
Parameter validation function to be redefined by derived controller 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 controller 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 |
Reimplemented in modulo_controllers::RobotControllerInterface.
+ +Definition at line 164 of file BaseControllerInterface.cpp.
+ +
+
|
+ +inlineprotected | +
Read the most recent message of an input.
+T | The expected type of the input data |
name | The name of the input |
Definition at line 653 of file BaseControllerInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Definition at line 653 of file BaseControllerInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Definition at line 653 of file BaseControllerInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Definition at line 653 of file BaseControllerInterface.hpp.
+ +
+
|
+ +protected | +
Set the input validity period of input signals.
+input_validity_period | The desired input validity period |
Definition at line 421 of file BaseControllerInterface.cpp.
+ +
+
|
+ +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 508 of file BaseControllerInterface.hpp.
+ +
+
|
+ +protected | +
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 211 of file BaseControllerInterface.cpp.
+ +
+
|
+ +protected | +
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 215 of file BaseControllerInterface.cpp.
+ +
+
|
+ +protected | +
Set the Quality of Service for ROS publishers and subscribers.
+qos | The desired Quality of Service |
Definition at line 546 of file BaseControllerInterface.cpp.
+ +
+
|
+ +protected | +
Latch the trigger with the provided name.
+trigger_name | The name of the trigger |
Definition at line 251 of file BaseControllerInterface.cpp.
+ +
+
|
+ +inline | +
Definition at line 846 of file BaseControllerInterface.hpp.
+ +
+
|
+ +inline | +
Definition at line 851 of file BaseControllerInterface.hpp.
+ +
+
|
+ +inline | +
Definition at line 861 of file BaseControllerInterface.hpp.
+ +
+
|
+ +inline | +
Definition at line 866 of file BaseControllerInterface.hpp.
+ +
+
|
+ +inline | +
Definition at line 856 of file BaseControllerInterface.hpp.
+ +
+
|
+ +inlineprotected | +
Write an object to an output.
+This uses the realtime publisher from add_output() to simplify publishing data in the realtime context of the control loop.
T | The type of the the object to publish |
name | The name of the output |
state | The object to publish |
Definition at line 753 of file BaseControllerInterface.hpp.
+ +
+ Modulo 5.0.0
+
+ |
+
This is the complete list of members for modulo_controllers::ControllerInterface, including all inherited members.
+
+ Modulo 5.0.0
+
+ |
+
+Public Member Functions | |
ControllerInterface (bool claim_all_state_interfaces=false) | |
Default constructor. | |
CallbackReturn | on_init () override |
Declare parameters. | |
CallbackReturn | on_configure (const rclcpp_lifecycle::State &previous_state) final |
Set class properties from parameters. | |
CallbackReturn | on_activate (const rclcpp_lifecycle::State &previous_state) final |
Initialize internal data attributes from configured interfaces and wait for valid states from hardware. | |
CallbackReturn | on_deactivate (const rclcpp_lifecycle::State &previous_state) final |
Deactivate the controller. | |
controller_interface::return_type | update (const rclcpp::Time &time, const rclcpp::Duration &period) final |
Read the state interfaces, perform control evaluation and write the command interfaces. | |
controller_interface::InterfaceConfiguration | state_interface_configuration () const final |
Configure the state interfaces. | |
controller_interface::InterfaceConfiguration | command_interface_configuration () const final |
Configure the command interfaces. | |
Public Member Functions inherited from modulo_controllers::BaseControllerInterface | |
BaseControllerInterface () | |
Default constructor. | |
CallbackReturn | on_init () override |
Declare parameters and register the on_set_parameters callback. | |
CallbackReturn | on_configure (const rclcpp_lifecycle::State &previous_state) override |
Add signals. | |
template<> | |
void | write_output (const std::string &name, const bool &data) |
template<> | |
void | write_output (const std::string &name, const double &data) |
template<> | |
void | write_output (const std::string &name, const std::vector< double > &data) |
template<> | |
void | write_output (const std::string &name, const int &data) |
template<> | |
void | write_output (const std::string &name, const std::string &data) |
+Protected Member Functions | |
virtual CallbackReturn | add_interfaces () |
Add interfaces like parameters, signals, services, and predicates to the controller. | |
virtual CallbackReturn | on_configure () |
Configure the controller. | |
virtual CallbackReturn | on_activate () |
Activate the controller. | |
virtual CallbackReturn | on_deactivate () |
Deactivate the controller. | |
virtual controller_interface::return_type | read_state_interfaces () |
Read the state interfaces. | |
virtual controller_interface::return_type | write_command_interfaces (const rclcpp::Duration &period) |
Write the command interfaces. | |
virtual controller_interface::return_type | evaluate (const rclcpp::Time &time, const std::chrono::nanoseconds &period)=0 |
The control logic callback. | |
void | add_state_interface (const std::string &name, const std::string &interface) |
Add a state interface to the controller by name. | |
void | add_command_interface (const std::string &name, const std::string &interface) |
Add a command interface to the controller by name. | |
std::unordered_map< std::string, double > | get_state_interfaces (const std::string &name) const |
Get a map containing the state interfaces by name of the parent tag. | |
double | get_state_interface (const std::string &name, const std::string &interface) const |
Get the value of a state interface by name. | |
double | get_command_interface (const std::string &name, const std::string &interface) const |
Get the value of a command interface by name. | |
void | set_command_interface (const std::string &name, const std::string &interface, double value) |
Set the value of a command interface by name. | |
Protected Member Functions inherited from modulo_controllers::BaseControllerInterface | |
void | add_parameter (const std::shared_ptr< state_representation::ParameterInterface > ¶meter, const std::string &description, bool read_only=false) |
Add a parameter. | |
template<typename T > | |
void | add_parameter (const std::string &name, const T &value, const std::string &description, bool read_only=false) |
Add a parameter. | |
virtual bool | on_validate_parameter_callback (const std::shared_ptr< state_representation::ParameterInterface > ¶meter) |
Parameter validation function to be redefined by derived controller classes. | |
std::shared_ptr< state_representation::ParameterInterface > | get_parameter (const std::string &name) const |
Get a parameter by name. | |
template<typename T > | |
T | get_parameter_value (const std::string &name) const |
Get a parameter value by name. | |
template<typename T > | |
void | set_parameter_value (const std::string &name, const T &value) |
Set the value of a parameter. | |
void | add_predicate (const std::string &predicate_name, bool predicate_value) |
Add a predicate to the map of predicates. | |
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. | |
bool | get_predicate (const std::string &predicate_name) const |
Get the logical value of a predicate. | |
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. | |
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. | |
void | add_trigger (const std::string &trigger_name) |
Add a trigger to the controller. | |
void | trigger (const std::string &trigger_name) |
Latch the trigger with the provided name. | |
template<typename T > | |
void | add_input (const std::string &name, const std::string &topic_name="") |
Add an input to the controller. | |
template<typename T > | |
void | add_output (const std::string &name, const std::string &topic_name="") |
Add an output to the controller. | |
void | set_input_validity_period (double input_validity_period) |
Set the input validity period of input signals. | |
template<typename T > | |
std::optional< T > | read_input (const std::string &name) |
Read the most recent message of an input. | |
template<typename T > | |
void | write_output (const std::string &name, const T &data) |
Write an object to an output. | |
void | add_service (const std::string &service_name, const std::function< ControllerServiceResponse(void)> &callback) |
Add a service to trigger a callback function with no input arguments. | |
void | add_service (const std::string &service_name, const std::function< ControllerServiceResponse(const std::string &string)> &callback) |
Add a service to trigger a callback function with a string payload. | |
rclcpp::QoS | get_qos () const |
Getter of the Quality of Service attribute. | |
void | set_qos (const rclcpp::QoS &qos) |
Set the Quality of Service for ROS publishers and subscribers. | |
bool | is_active () const |
Check if the controller is currently in state active or not. | |
std::timed_mutex & | get_command_mutex () |
Get the reference to the command mutex. | |
template<> | |
void | add_input (const std::string &name, const std::string &topic_name) |
template<> | |
void | add_input (const std::string &name, const std::string &topic_name) |
template<> | |
void | add_input (const std::string &name, const std::string &topic_name) |
template<> | |
void | add_output (const std::string &name, const std::string &topic_name) |
template<> | |
void | add_output (const std::string &name, const std::string &topic_name) |
template<> | |
void | add_output (const std::string &name, const std::string &topic_name) |
template<> | |
std::optional< bool > | read_input (const std::string &name) |
template<> | |
std::optional< double > | read_input (const std::string &name) |
template<> | |
std::optional< int > | read_input (const std::string &name) |
+Protected Attributes | |
std::string | hardware_name_ |
The hardware name provided by a parameter. | |
Definition at line 10 of file ControllerInterface.hpp.
+modulo_controllers::ControllerInterface::ControllerInterface | +( | +bool | +claim_all_state_interfaces = false | ) | ++ |
Default constructor.
+claim_all_state_interfaces | Flag to indicate if all state interfaces should be claimed |
Definition at line 9 of file ControllerInterface.cpp.
+ +
+
|
+ +protected | +
Add a command interface to the controller by name.
+name | The name of the parent tag, e.g. the name of the joint, sensor or gpio |
interface | The desired command interface |
Definition at line 85 of file ControllerInterface.cpp.
+ +
+
|
+ +protectedvirtual | +
Add interfaces like parameters, signals, services, and predicates to the controller.
+This function is called during the on_init
callback of the base class to perform post-construction steps.
Reimplemented in modulo_controllers::RobotControllerInterface.
+ +Definition at line 40 of file ControllerInterface.cpp.
+ +
+
|
+ +protected | +
Add a state interface to the controller by name.
+name | The name of the parent tag, e.g. the name of the joint, sensor or gpio |
interface | The desired state interface |
Definition at line 81 of file ControllerInterface.cpp.
+ +
+
|
+ +final | +
Configure the command interfaces.
+Definition at line 107 of file ControllerInterface.cpp.
+ +
+
|
+ +protectedpure virtual | +
The control logic callback.
+This method should be overridden by derived classes. It is called in the update() method between reading the state interfaces and writing the command interfaces.
time | The controller clock time |
period | Time elapsed since the last control evaluation |
+
|
+ +protected | +
Get the value of a command interface by name.
+name | The name of the parent tag, e.g. the name of the joint, sensor or gpio |
interface | The desired command interface |
out_of_range | if the desired command interface is not available |
Definition at line 279 of file ControllerInterface.cpp.
+ +
+
|
+ +protected | +
Get the value of a state interface by name.
+name | The name of the parent tag, e.g. the name of the joint, sensor or gpio |
interface | The desired state interface |
out_of_range | if the desired state interface is not available |
Definition at line 275 of file ControllerInterface.cpp.
+ +
+
|
+ +protected | +
Get a map containing the state interfaces by name of the parent tag.
+name | The name of the parent tag, e.g. the name of the joint, sensor or gpio |
out_of_range | if the desired state interface is not available |
Definition at line 271 of file ControllerInterface.cpp.
+ +
+
|
+ +protectedvirtual | +
Activate the controller.
+This method should be overridden by derived classes.
Reimplemented in modulo_controllers::RobotControllerInterface.
+ +Definition at line 195 of file ControllerInterface.cpp.
+ +
+
|
+ +final | +
Initialize internal data attributes from configured interfaces and wait for valid states from hardware.
+This functions calls the internal on_activate() method
previous_state | The previous lifecycle state |
Definition at line 142 of file ControllerInterface.cpp.
+ +
+
|
+ +protectedvirtual | +
Configure the controller.
+This method should be overridden by derived classes.
Reimplemented in modulo_controllers::RobotControllerInterface.
+ +Definition at line 77 of file ControllerInterface.cpp.
+ +
+
|
+ +final | +
Set class properties from parameters.
+This functions calls the internal on_configure() method
previous_state | The previous lifecycle state |
Definition at line 45 of file ControllerInterface.cpp.
+ +
+
|
+ +protectedvirtual | +
Deactivate the controller.
+This method should be overridden by derived classes.
Definition at line 209 of file ControllerInterface.cpp.
+ +
+
|
+ +final | +
Deactivate the controller.
+previous_state | The previous lifecycle state |
Definition at line 200 of file ControllerInterface.cpp.
+ +
+
|
+ +override | +
Declare parameters.
+Definition at line 12 of file ControllerInterface.cpp.
+ +
+
|
+ +protectedvirtual | +
Read the state interfaces.
+Definition at line 254 of file ControllerInterface.cpp.
+ +
+
|
+ +protected | +
Set the value of a command interface by name.
+name | The name of the parent tag, e.g. the name of the sensor or gpio |
interface | The name of the command interface |
value | The new value of the interface |
Definition at line 283 of file ControllerInterface.cpp.
+ +
+
|
+ +final | +
Configure the state interfaces.
+Definition at line 124 of file ControllerInterface.cpp.
+ +
+
|
+ +final | +
Read the state interfaces, perform control evaluation and write the command interfaces.
+time | The controller clock time |
period | Time elapsed since the last control evaluation |
Definition at line 214 of file ControllerInterface.cpp.
+ +
+
|
+ +protectedvirtual | +
Write the command interfaces.
+period | Time elapsed since the last control evaluation |
Definition at line 263 of file ControllerInterface.cpp.
+ +
+
|
+ +protected | +
The hardware name provided by a parameter.
+ +Definition at line 169 of file ControllerInterface.hpp.
+ +
+ Modulo 5.0.0
+
+ |
+
This is the complete list of members for modulo_controllers::RobotControllerInterface, including all inherited members.
+
+ Modulo 5.0.0
+
+ |
+
Base controller class that automatically associates joints with a JointState object. + More...
+ +#include <RobotControllerInterface.hpp>
+Public Member Functions | |
RobotControllerInterface () | |
Default constructor. | |
RobotControllerInterface (bool robot_model_required, const std::string &control_type="", bool load_geometries=false) | |
Constructor with robot model flag and a control type to determine the command interfaces to claim. | |
CallbackReturn | add_interfaces () override |
Add interfaces like parameters, signals, services, and predicates to the controller. | |
CallbackReturn | on_configure () override |
Configure the controller. | |
CallbackReturn | on_activate () override |
Activate the controller. | |
Public Member Functions inherited from modulo_controllers::ControllerInterface | |
ControllerInterface (bool claim_all_state_interfaces=false) | |
Default constructor. | |
CallbackReturn | on_init () override |
Declare parameters. | |
CallbackReturn | on_configure (const rclcpp_lifecycle::State &previous_state) final |
Set class properties from parameters. | |
CallbackReturn | on_activate (const rclcpp_lifecycle::State &previous_state) final |
Initialize internal data attributes from configured interfaces and wait for valid states from hardware. | |
CallbackReturn | on_deactivate (const rclcpp_lifecycle::State &previous_state) final |
Deactivate the controller. | |
controller_interface::return_type | update (const rclcpp::Time &time, const rclcpp::Duration &period) final |
Read the state interfaces, perform control evaluation and write the command interfaces. | |
controller_interface::InterfaceConfiguration | state_interface_configuration () const final |
Configure the state interfaces. | |
controller_interface::InterfaceConfiguration | command_interface_configuration () const final |
Configure the command interfaces. | |
Public Member Functions inherited from modulo_controllers::BaseControllerInterface | |
BaseControllerInterface () | |
Default constructor. | |
CallbackReturn | on_init () override |
Declare parameters and register the on_set_parameters callback. | |
CallbackReturn | on_configure (const rclcpp_lifecycle::State &previous_state) override |
Add signals. | |
template<> | |
void | write_output (const std::string &name, const bool &data) |
template<> | |
void | write_output (const std::string &name, const double &data) |
template<> | |
void | write_output (const std::string &name, const std::vector< double > &data) |
template<> | |
void | write_output (const std::string &name, const int &data) |
template<> | |
void | write_output (const std::string &name, const std::string &data) |
+Protected Member Functions | |
const state_representation::JointState & | get_joint_state () |
Access the joint state object. | |
const state_representation::CartesianState & | get_cartesian_state () |
Access the Cartesian state object. | |
const state_representation::CartesianWrench & | get_ft_sensor () |
Access the Cartesian wrench object. | |
void | compute_cartesian_state () |
Compute the Cartesian state from forward kinematics of the current joint state. | |
void | set_joint_command (const state_representation::JointState &joint_command) |
Set the joint command object. | |
bool | on_validate_parameter_callback (const std::shared_ptr< state_representation::ParameterInterface > ¶meter) override |
Parameter validation function to be redefined by derived controller classes. | |
Protected Member Functions inherited from modulo_controllers::ControllerInterface | |
virtual CallbackReturn | on_deactivate () |
Deactivate the controller. | |
virtual controller_interface::return_type | evaluate (const rclcpp::Time &time, const std::chrono::nanoseconds &period)=0 |
The control logic callback. | |
void | add_state_interface (const std::string &name, const std::string &interface) |
Add a state interface to the controller by name. | |
void | add_command_interface (const std::string &name, const std::string &interface) |
Add a command interface to the controller by name. | |
std::unordered_map< std::string, double > | get_state_interfaces (const std::string &name) const |
Get a map containing the state interfaces by name of the parent tag. | |
double | get_state_interface (const std::string &name, const std::string &interface) const |
Get the value of a state interface by name. | |
double | get_command_interface (const std::string &name, const std::string &interface) const |
Get the value of a command interface by name. | |
void | set_command_interface (const std::string &name, const std::string &interface, double value) |
Set the value of a command interface by name. | |
Protected Member Functions inherited from modulo_controllers::BaseControllerInterface | |
void | add_parameter (const std::shared_ptr< state_representation::ParameterInterface > ¶meter, const std::string &description, bool read_only=false) |
Add a parameter. | |
template<typename T > | |
void | add_parameter (const std::string &name, const T &value, const std::string &description, bool read_only=false) |
Add a parameter. | |
std::shared_ptr< state_representation::ParameterInterface > | get_parameter (const std::string &name) const |
Get a parameter by name. | |
template<typename T > | |
T | get_parameter_value (const std::string &name) const |
Get a parameter value by name. | |
template<typename T > | |
void | set_parameter_value (const std::string &name, const T &value) |
Set the value of a parameter. | |
void | add_predicate (const std::string &predicate_name, bool predicate_value) |
Add a predicate to the map of predicates. | |
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. | |
bool | get_predicate (const std::string &predicate_name) const |
Get the logical value of a predicate. | |
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. | |
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. | |
void | add_trigger (const std::string &trigger_name) |
Add a trigger to the controller. | |
void | trigger (const std::string &trigger_name) |
Latch the trigger with the provided name. | |
template<typename T > | |
void | add_input (const std::string &name, const std::string &topic_name="") |
Add an input to the controller. | |
template<typename T > | |
void | add_output (const std::string &name, const std::string &topic_name="") |
Add an output to the controller. | |
void | set_input_validity_period (double input_validity_period) |
Set the input validity period of input signals. | |
template<typename T > | |
std::optional< T > | read_input (const std::string &name) |
Read the most recent message of an input. | |
template<typename T > | |
void | write_output (const std::string &name, const T &data) |
Write an object to an output. | |
void | add_service (const std::string &service_name, const std::function< ControllerServiceResponse(void)> &callback) |
Add a service to trigger a callback function with no input arguments. | |
void | add_service (const std::string &service_name, const std::function< ControllerServiceResponse(const std::string &string)> &callback) |
Add a service to trigger a callback function with a string payload. | |
rclcpp::QoS | get_qos () const |
Getter of the Quality of Service attribute. | |
void | set_qos (const rclcpp::QoS &qos) |
Set the Quality of Service for ROS publishers and subscribers. | |
bool | is_active () const |
Check if the controller is currently in state active or not. | |
std::timed_mutex & | get_command_mutex () |
Get the reference to the command mutex. | |
template<> | |
void | add_input (const std::string &name, const std::string &topic_name) |
template<> | |
void | add_input (const std::string &name, const std::string &topic_name) |
template<> | |
void | add_input (const std::string &name, const std::string &topic_name) |
template<> | |
void | add_output (const std::string &name, const std::string &topic_name) |
template<> | |
void | add_output (const std::string &name, const std::string &topic_name) |
template<> | |
void | add_output (const std::string &name, const std::string &topic_name) |
template<> | |
std::optional< bool > | read_input (const std::string &name) |
template<> | |
std::optional< double > | read_input (const std::string &name) |
template<> | |
std::optional< int > | read_input (const std::string &name) |
+Protected Attributes | |
std::shared_ptr< robot_model::Model > | robot_ |
Robot model object generated from URDF. | |
std::string | task_space_frame_ |
The frame in task space for forward kinematics calculations, if applicable. | |
std::string | ft_sensor_name_ |
The name of a force torque sensor in the hardware description. | |
std::string | ft_sensor_reference_frame_ |
The sensing reference frame. | |
Protected Attributes inherited from modulo_controllers::ControllerInterface | |
std::string | hardware_name_ |
The hardware name provided by a parameter. | |
Base controller class that automatically associates joints with a JointState object.
+The robot controller interface extends the functionality of the modulo controller interface byautomatically claiming all state interfaces from joints and command interfaces of a given type (position, velocity, effort or acceleration) for those same joints. Joint state and command are associated with these interfaces and abstracted as JointState pointers for derived classes to access. A robot model, Cartesian state and force-torque sensor state are similarly available based on the URDF and state interfaces.
+ +Definition at line 23 of file RobotControllerInterface.hpp.
+modulo_controllers::RobotControllerInterface::RobotControllerInterface | +( | +) | ++ |
Default constructor.
+ +Definition at line 18 of file RobotControllerInterface.cpp.
+ +
+
|
+ +explicit | +
Constructor with robot model flag and a control type to determine the command interfaces to claim.
+robot_model_required | Flag to indicate if a robot model is required for the controller |
control_type | One of [position, velocity, effort or acceleration] |
load_geometries | If true, load the URDF geometries into the robot model for collision features |
Definition at line 20 of file RobotControllerInterface.cpp.
+ +
+
|
+ +overridevirtual | +
Add interfaces like parameters, signals, services, and predicates to the controller.
+This function is called during the on_init
callback of the base class to perform post-construction steps.
Declare additional parameters.
+ +Reimplemented from modulo_controllers::ControllerInterface.
+ +Definition at line 35 of file RobotControllerInterface.cpp.
+ +
+
|
+ +protected | +
Compute the Cartesian state from forward kinematics of the current joint state.
+This should only be used if a robot model has been generated, in which case the forward kinematics is calculated to get pose and twist for the desired target frame.
+ +Definition at line 302 of file RobotControllerInterface.cpp.
+ +
+
|
+ +protected | +
Access the Cartesian state object.
+This internally calls compute_cartesian_state()
Definition at line 292 of file RobotControllerInterface.cpp.
+ +
+
|
+ +protected | +
Access the Cartesian wrench object.
+Definition at line 298 of file RobotControllerInterface.cpp.
+ +
+
|
+ +protected | +
Access the joint state object.
+Definition at line 288 of file RobotControllerInterface.cpp.
+ +
+
|
+ +overridevirtual | +
Activate the controller.
+This method should be overridden by derived classes.
Initialize a fore torque sensor if applicable
+ +Reimplemented from modulo_controllers::ControllerInterface.
+ +Definition at line 176 of file RobotControllerInterface.cpp.
+ +
+
|
+ +overridevirtual | +
Configure the controller.
+This method should be overridden by derived classes.
Create a robot model from the robot description, get and sort the joints and construct the internal joint state object.
+ +Reimplemented from modulo_controllers::ControllerInterface.
+ +Definition at line 59 of file RobotControllerInterface.cpp.
+ +
+
|
+ +overrideprotectedvirtual | +
Parameter validation function to be redefined by derived controller 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 controller 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 |
Reimplemented from modulo_controllers::BaseControllerInterface.
+ +Definition at line 356 of file RobotControllerInterface.cpp.
+ +
+
|
+ +protected | +
Set the joint command object.
+joint_command | A JointState command object |
Definition at line 314 of file RobotControllerInterface.cpp.
+ +
+
|
+ +protected | +
The name of a force torque sensor in the hardware description.
+ +Definition at line 100 of file RobotControllerInterface.hpp.
+ +
+
|
+ +protected | +
The sensing reference frame.
+ +Definition at line 101 of file RobotControllerInterface.hpp.
+ +
+
|
+ +protected | +
Robot model object generated from URDF.
+ +Definition at line 97 of file RobotControllerInterface.hpp.
+ +
+
|
+ +protected | +
The frame in task space for forward kinematics calculations, if applicable.
+ +Definition at line 98 of file RobotControllerInterface.hpp.
+ +
+ Modulo 5.0.0
+
+ |
+
This is the complete list of members for modulo_core::Predicate, including all inherited members.
+get_value() const (defined in modulo_core::Predicate) | modulo_core::Predicate | inline |
Predicate(const std::function< bool(void)> &predicate_function) (defined in modulo_core::Predicate) | modulo_core::Predicate | inlineexplicit |
query() (defined in modulo_core::Predicate) | modulo_core::Predicate | inline |
set_predicate(const std::function< bool(void)> &predicate_function) (defined in modulo_core::Predicate) | modulo_core::Predicate | inline |
+ Modulo 5.0.0
+
+ |
+
+Public Member Functions | |
Predicate (const std::function< bool(void)> &predicate_function) | |
bool | get_value () const |
void | set_predicate (const std::function< bool(void)> &predicate_function) |
std::optional< bool > | query () |
Definition at line 13 of file Predicate.hpp.
+
+
|
+ +inlineexplicit | +
Definition at line 15 of file Predicate.hpp.
+ +
+
|
+ +inline | +
Definition at line 17 of file Predicate.hpp.
+ +
+
|
+ +inline | +
Definition at line 21 of file Predicate.hpp.
+ +
+
|
+ +inline | +
Definition at line 19 of file Predicate.hpp.
+ +
+ Modulo 5.0.0
+
+ |
+
This is the complete list of members for modulo_core::communication::MessagePair< MsgT, DataT >, including all inherited members.
+
+ Modulo 5.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. | |
MessagePair (std::shared_ptr< DataT > data, std::shared_ptr< rclcpp::Clock > clock) | |
Constructor of the MessagePair that requires custom message types only. | |
MsgT | write_message () const |
Write the value of the data pointer to a ROS message. | |
void | read_message (const MsgT &message) |
Read a ROS message and store the value in the data pointer. | |
std::shared_ptr< DataT > | get_data () const |
Get the data pointer. | |
void | set_data (const std::shared_ptr< DataT > &data) |
Set the data pointer. | |
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 |
+
|
+ +inline | +
Constructor of the MessagePair that requires custom message types only.
+data | The pointer referring to the data stored in the MessagePair |
clock | The ROS clock for translating messages |
Definition at line 34 of file MessagePair.hpp.
+ +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 12 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 17 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 22 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 26 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 31 of file MessagePair.cpp.
+ +
+
|
+ +inline | +
Get the data pointer.
+ +Definition at line 178 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 148 of file MessagePair.hpp.
+ +
+
|
+ +inline | +
Set the data pointer.
+modulo_core::exceptions::NullPointerException | if the provided data pointer is null |
Definition at line 183 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 112 of file MessagePair.hpp.
+ +
+ Modulo 5.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 5.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. | |
+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. | |
template<typename MsgT , typename DataT > | |
MsgT | write () |
Get the ROS message of a derived MessagePair instance through the MessagePairInterface pointer. | |
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. | |
MessageType | get_type () const |
Get the MessageType of the MessagePairInterface. | |
Interface class to enable non-templated writing and reading ROS messages from derived MessagePair instances through dynamic down-casting.
+ +Definition at line 19 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 93 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 115 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 110 of file MessagePairInterface.hpp.
+ +
+ Modulo 5.0.0
+
+ |
+
This is the complete list of members for modulo_core::communication::PublisherHandler< PubT, MsgT >, including all inherited members.
+
+ Modulo 5.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. | |
~PublisherHandler () override | |
Destructor to explicitly reset the publisher pointer. | |
virtual void | activate () override |
Activate ROS publisher of a derived PublisherHandler instance through the PublisherInterface pointer. | |
virtual void | deactivate () override |
Deactivate ROS publisher of a derived PublisherHandler instance through the PublisherInterface pointer. | |
void | publish () override |
Publish the data stored in the message pair through the ROS publisher of a derived PublisherHandler instance through the PublisherInterface pointer. | |
void | publish (const MsgT &message) const |
Publish the ROS message through the ROS publisher. | |
std::shared_ptr< PublisherInterface > | create_publisher_interface (const std::shared_ptr< MessagePairInterface > &message_pair) |
Create a PublisherInterface instance from the current PublisherHandler. | |
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. | |
+ | 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. | |
std::shared_ptr< MessagePairInterface > | get_message_pair () const |
Get the pointer to the message pair of the PublisherInterface. | |
void | set_message_pair (const std::shared_ptr< MessagePairInterface > &message_pair) |
Set the pointer to the message pair of the PublisherInterface. | |
PublisherType | get_type () const |
Get the type of the publisher interface. | |
+Additional Inherited Members | |
Protected Attributes inherited from modulo_core::communication::PublisherInterface | |
std::shared_ptr< MessagePairInterface > | message_pair_ |
The pointer to the stored MessagePair instance. | |
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 19 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 69 of file PublisherHandler.hpp.
+ +
+
|
+ +override | +
Destructor to explicitly reset the publisher pointer.
+ +Definition at line 73 of file PublisherHandler.hpp.
+ +
+
|
+ +inlineoverridevirtual | +
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 |
Reimplemented from modulo_core::communication::PublisherInterface.
+ +Definition at line 78 of file PublisherHandler.hpp.
+ +
+
|
+ +inline | +
Create a PublisherInterface instance from the current PublisherHandler.
+message_pair | The message pair of the PublisherInterface |
Definition at line 135 of file PublisherHandler.hpp.
+ +
+
|
+ +inlineoverridevirtual | +
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 |
Reimplemented from modulo_core::communication::PublisherInterface.
+ +Definition at line 92 of file PublisherHandler.hpp.
+ +
+
|
+ +inlineoverridevirtual | +
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, ...) |
Reimplemented from modulo_core::communication::PublisherInterface.
+ +Definition at line 106 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 122 of file PublisherHandler.hpp.
+ +
+ Modulo 5.0.0
+
+ |
+
This is the complete list of members for modulo_core::communication::PublisherInterface, including all inherited members.
+activate() | modulo_core::communication::PublisherInterface | virtual |
deactivate() | modulo_core::communication::PublisherInterface | virtual |
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 | |
message_pair_ | modulo_core::communication::PublisherInterface | protected |
publish() | modulo_core::communication::PublisherInterface | virtual |
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 5.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. | |
+ | 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. | |
virtual void | activate () |
Activate ROS publisher of a derived PublisherHandler instance through the PublisherInterface pointer. | |
virtual void | deactivate () |
Deactivate ROS publisher of a derived PublisherHandler instance through the PublisherInterface pointer. | |
virtual void | publish () |
Publish the data stored in the message pair through the ROS publisher of a derived PublisherHandler instance through the PublisherInterface pointer. | |
std::shared_ptr< MessagePairInterface > | get_message_pair () const |
Get the pointer to the message pair of the PublisherInterface. | |
void | set_message_pair (const std::shared_ptr< MessagePairInterface > &message_pair) |
Set the pointer to the message pair of the PublisherInterface. | |
PublisherType | get_type () const |
Get the type of the publisher interface. | |
+Protected Attributes | |
std::shared_ptr< MessagePairInterface > | message_pair_ |
The pointer to the stored MessagePair instance. | |
Interface class to enable non-templated activating/deactivating/publishing of ROS publishers from derived PublisherHandler instances through dynamic down-casting.
+ +Definition at line 20 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 17 of file PublisherInterface.cpp.
+ +
+
|
+ +virtual | +
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 |
Reimplemented in modulo_core::communication::PublisherHandler< PubT, MsgT >.
+ +Definition at line 20 of file PublisherInterface.cpp.
+ +
+
|
+ +virtual | +
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 |
Reimplemented in modulo_core::communication::PublisherHandler< PubT, MsgT >.
+ +Definition at line 25 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 130 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 78 of file PublisherInterface.cpp.
+ +PublisherType modulo_core::communication::PublisherInterface::get_type | +( | +) | +const | +
Get the type of the publisher interface.
+Definition at line 89 of file PublisherInterface.cpp.
+ +
+
|
+ +virtual | +
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, ...) |
Reimplemented in modulo_core::communication::PublisherHandler< PubT, MsgT >.
+ +Definition at line 30 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 82 of file PublisherInterface.cpp.
+ +
+
|
+ +protected | +
The pointer to the stored MessagePair instance.
+ +Definition at line 110 of file PublisherInterface.hpp.
+ +
+ Modulo 5.0.0
+
+ |
+
This is the complete list of members for modulo_core::communication::SubscriptionHandler< MsgT >, including all inherited members.
+
+ Modulo 5.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, const rclcpp::Logger &logger=rclcpp::get_logger("SubscriptionHandler")) | |
Constructor with the message pair. | |
~SubscriptionHandler () override | |
Destructor to explicitly reset the subscription pointer. | |
std::shared_ptr< rclcpp::Subscription< MsgT > > | get_subscription () const |
Getter of the ROS subscription. | |
void | set_subscription (const std::shared_ptr< rclcpp::Subscription< MsgT > > &subscription) |
Setter of the ROS subscription. | |
void | set_user_callback (const std::function< void()> &user_callback) |
Setter of a user callback function to be executed after the subscription callback. | |
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. | |
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. | |
Public Member Functions inherited from modulo_core::communication::SubscriptionInterface | |
SubscriptionInterface (std::shared_ptr< MessagePairInterface > message_pair=nullptr) | |
Constructor with the message pair. | |
+ | 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. | |
std::shared_ptr< MessagePairInterface > | get_message_pair () const |
Get the pointer to the message pair of the SubscriptionInterface. | |
void | set_message_pair (const std::shared_ptr< MessagePairInterface > &message_pair) |
Set the pointer to the message pair of the SubscriptionInterface. | |
+Additional Inherited Members | |
Protected Attributes inherited from modulo_core::communication::SubscriptionInterface | |
std::shared_ptr< MessagePairInterface > | message_pair_ |
The pointer to the stored MessagePair instance. | |
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 15 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 |
logger | An optional ROS logger to do logging from the subscription callback |
Definition at line 102 of file SubscriptionHandler.hpp.
+ +
+
|
+ +override | +
Destructor to explicitly reset the subscription pointer.
+ +Definition at line 107 of file SubscriptionHandler.hpp.
+ +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 158 of file SubscriptionHandler.hpp.
+ +
+
|
+ +inline | +
Get a callback function that will be associated with the ROS subscription to receive and translate messages.
+ +Definition at line 125 of file SubscriptionHandler.hpp.
+ +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 152 of file SubscriptionHandler.hpp.
+ +std::shared_ptr< rclcpp::Subscription< MsgT > > modulo_core::communication::SubscriptionHandler< MsgT >::get_subscription | +( | +) | +const | +
Getter of the ROS subscription.
+ +Definition at line 112 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 117 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 146 of file SubscriptionHandler.hpp.
+ +
+ Modulo 5.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 | |
message_pair_ | modulo_core::communication::SubscriptionInterface | protected |
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 5.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. | |
+ | 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. | |
std::shared_ptr< MessagePairInterface > | get_message_pair () const |
Get the pointer to the message pair of the SubscriptionInterface. | |
void | set_message_pair (const std::shared_ptr< MessagePairInterface > &message_pair) |
Set the pointer to the message pair of the SubscriptionInterface. | |
+Protected Attributes | |
std::shared_ptr< MessagePairInterface > | message_pair_ |
The pointer to the stored MessagePair instance. | |
Interface class to enable non-templated subscriptions with ROS subscriptions from derived SubscriptionHandler instances through dynamic down-casting.
+ +Definition at line 19 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 5 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 74 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 8 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 12 of file SubscriptionInterface.cpp.
+ +
+
|
+ +protected | +
The pointer to the stored MessagePair instance.
+ +Definition at line 70 of file SubscriptionInterface.hpp.
+ +
+ Modulo 5.0.0
+
+ |
+
This is the complete list of members for modulo_core::exceptions::AddServiceException, including all inherited members.
+AddServiceException(const std::string &msg) (defined in modulo_core::exceptions::AddServiceException) | modulo_core::exceptions::AddServiceException | inlineexplicit |
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 5.0.0
+
+ |
+
An exception class to notify errors when adding a service. + More...
+ +#include <exceptions.hpp>
+Public Member Functions | |
AddServiceException (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 errors when adding a service.
+This is an exception class to be thrown if there is a problem while adding a service to a modulo class.
+ +Definition at line 30 of file exceptions.hpp.
+
+
|
+ +inlineexplicit | +
Definition at line 32 of file exceptions.hpp.
+ +
+ Modulo 5.0.0
+
+ |
+
This is the complete list of members for modulo_core::exceptions::AddSignalException, including all inherited members.
+AddSignalException(const std::string &msg) (defined in modulo_core::exceptions::AddSignalException) | modulo_core::exceptions::AddSignalException | inlineexplicit |
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 5.0.0
+
+ |
+
An exception class to notify errors when adding a signal. + More...
+ +#include <exceptions.hpp>
+Public Member Functions | |
AddSignalException (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 errors when adding a signal.
+This is an exception class to be thrown if there is a problem while adding a signal to a modulo class.
+ +Definition at line 40 of file exceptions.hpp.
+
+
|
+ +inlineexplicit | +
Definition at line 42 of file exceptions.hpp.
+ +
+ Modulo 5.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 5.0.0
+
+ |
+
A base class for all core exceptions. + More...
+ +#include <exceptions.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 exceptions.hpp.
+
+
|
+ +inlineexplicit | +
Definition at line 19 of file exceptions.hpp.
+ +
+
|
+ +inlineprotected | +
Definition at line 22 of file exceptions.hpp.
+ +
+ Modulo 5.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 5.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 <exceptions.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 50 of file exceptions.hpp.
+
+
|
+ +inlineexplicit | +
Definition at line 52 of file exceptions.hpp.
+ +
+ Modulo 5.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 5.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 <exceptions.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 60 of file exceptions.hpp.
+
+
|
+ +inlineexplicit | +
Definition at line 62 of file exceptions.hpp.
+ +
+ Modulo 5.0.0
+
+ |
+
This is the complete list of members for modulo_core::exceptions::LookupTransformException, 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 |
LookupTransformException(const std::string &msg) (defined in modulo_core::exceptions::LookupTransformException) | modulo_core::exceptions::LookupTransformException | inlineexplicit |
+ Modulo 5.0.0
+
+ |
+
An exception class to notify an error while looking up TF transforms. + More...
+ +#include <exceptions.hpp>
+Public Member Functions | |
LookupTransformException (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 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 71 of file exceptions.hpp.
+
+
|
+ +inlineexplicit | +
Definition at line 73 of file exceptions.hpp.
+ +
+ Modulo 5.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 5.0.0
+
+ |
+
An exception class to notify that the translation of a ROS message failed. + More...
+ +#include <exceptions.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 80 of file exceptions.hpp.
+
+
|
+ +inlineexplicit | +
Definition at line 82 of file exceptions.hpp.
+ +
+ Modulo 5.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 5.0.0
+
+ |
+
An exception class to notify that a certain pointer is null. + More...
+ +#include <exceptions.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 90 of file exceptions.hpp.
+
+
|
+ +inlineexplicit | +
Definition at line 92 of file exceptions.hpp.
+ +
+ Modulo 5.0.0
+
+ |
+
This is the complete list of members for modulo_core::exceptions::ParameterException, 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 |
ParameterException(const std::string &msg) (defined in modulo_core::exceptions::ParameterException) | modulo_core::exceptions::ParameterException | inlineexplicit |
+ Modulo 5.0.0
+
+ |
+
An exception class to notify errors with parameters in modulo classes. + More...
+ +#include <exceptions.hpp>
+Public Member Functions | |
ParameterException (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 errors with parameters in modulo classes.
+This is an exception class to be thrown if there is a problem with parameters (overriding, inconsistent types, undeclared, ...).
+ +Definition at line 101 of file exceptions.hpp.
+
+
|
+ +inlineexplicit | +
Definition at line 103 of file exceptions.hpp.
+ +
+ Modulo 5.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 5.0.0
+
+ |
+
An exception class to notify incompatibility when translating parameters from different sources. + More...
+ +#include <exceptions.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 112 of file exceptions.hpp.
+
+
|
+ +inlineexplicit | +
Definition at line 114 of file exceptions.hpp.
+ +
+ Modulo 5.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 &node, 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 5.0.0
+
+ |
+
+Public Member Functions | |
PredicatesListener (const std::string &node, 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 & | +node, | +
+ | + | 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 5.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 5.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 5.0.0
+
+ |
+
Definition at line 21 of file concepts.hpp.
+
+ Modulo 5.0.0
+
+ |
+
Definition at line 31 of file concepts.hpp.
+
+ Modulo 5.0.0
+
+ |
+
Definition at line 17 of file concepts.hpp.
+
+ Modulo 5.0.0
+
+ |
+
Definition at line 26 of file concepts.hpp.
+
+ Modulo 5.0.0
+
+ |
+
▼Nmodulo_core | Modulo Core |
▼Nconcepts | |
RPrimitiveDataT | |
RCoreDataT | |
RTranslatedMsgT | |
RCustomT |
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+Files | |
BaseControllerInterface.cpp | |
ControllerInterface.cpp | |
RobotControllerInterface.cpp | |
+ Modulo 5.0.0
+
+ |
+
+Directories | |
communication | |
translators | |
+Files | |
concepts.hpp | |
EncodedState.hpp | |
exceptions.hpp | |
Predicate.hpp | |
+ Modulo 5.0.0
+
+ |
+
+Files | |
BaseControllerInterface.hpp | |
ControllerInterface.hpp | |
RobotControllerInterface.hpp | |
+ Modulo 5.0.0
+
+ |
+
+Directories | |
modulo_core | |
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+Directories | |
modulo_utils | |
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+Files | |
MessagePair.cpp | |
MessagePairInterface.cpp | |
PublisherInterface.cpp | |
SubscriptionHandler.cpp | |
SubscriptionInterface.cpp | |
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+Directories | |
modulo_controllers | |
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+Directories | |
modulo_components | |
+ Modulo 5.0.0
+
+ |
+
+Directories | |
communication | |
translators | |
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+Directories | |
testutils | |
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+Directories | |
src | |
+ Modulo 5.0.0
+
+ |
+
+Directories | |
testutils | |
+Files | |
parsing.hpp | |
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+Directories | |
src | |
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
▼ source | |
▼ modulo_components | |
▼ include | |
▼ modulo_components | |
Component.hpp | |
ComponentInterface.hpp | |
LifecycleComponent.hpp | |
▼ src | |
Component.cpp | |
ComponentInterface.cpp | |
LifecycleComponent.cpp | |
▼ modulo_controllers | |
▼ include | |
▼ modulo_controllers | |
BaseControllerInterface.hpp | |
ControllerInterface.hpp | |
RobotControllerInterface.hpp | |
▼ src | |
BaseControllerInterface.cpp | |
ControllerInterface.cpp | |
RobotControllerInterface.cpp | |
▼ modulo_core | |
▼ include | |
▼ modulo_core | |
▼ communication | |
MessagePair.hpp | |
MessagePairInterface.hpp | |
MessageType.hpp | |
PublisherHandler.hpp | |
PublisherInterface.hpp | |
PublisherType.hpp | |
SubscriptionHandler.hpp | |
SubscriptionInterface.hpp | |
▼ translators | |
message_readers.hpp | |
message_writers.hpp | |
parameter_translators.hpp | |
concepts.hpp | |
EncodedState.hpp | |
exceptions.hpp | |
Predicate.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 | |
parsing.hpp | |
▼ src | |
▼ testutils | |
PredicatesListener.cpp |
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
+ Modulo 5.0.0
+
+ |
+
▼Cmodulo_components::ComponentInterface | Base interface class for modulo components to wrap a ROS Node with custom behaviour |
Cmodulo_components::Component | A wrapper for rclcpp::Node to simplify application composition through unified component interfaces |
Cmodulo_components::LifecycleComponent | A wrapper for rclcpp_lifecycle::LifecycleNode to simplify application composition through unified component interfaces while supporting lifecycle states and transitions |
CComponentInterfacePublicInterface | 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 |
Cmodulo_controllers::ControllerInput | Input structure to save topic data in a realtime buffer and timestamps in one object |
▼Ccontroller_interface::ControllerInterface | |
▼Cmodulo_controllers::BaseControllerInterface | Base controller class to combine ros2_control, control libraries and modulo |
▼Cmodulo_controllers::ControllerInterface | |
Cmodulo_controllers::RobotControllerInterface | Base controller class that automatically associates joints with a JointState object |
Cmodulo_controllers::ControllerServiceResponse | Response structure to be returned by controller 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::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::Component | A wrapper for rclcpp::Node to simplify application composition through unified component interfaces |
Cmodulo_utils::testutils::PredicatesListener | |
Cmodulo_utils::testutils::ServiceClient< SrvT > | |
Cmodulo_core::Predicate | |
▼Cstd::runtime_error | |
▼Cmodulo_core::exceptions::CoreException | A base class for all core exceptions |
Cmodulo_core::exceptions::AddServiceException | An exception class to notify errors when adding a service |
Cmodulo_core::exceptions::AddSignalException | An exception class to notify errors when adding a signal |
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::LookupTransformException | An exception class to notify an error while looking up TF transforms |
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::ParameterException | An exception class to notify errors with parameters in modulo classes |
Cmodulo_core::exceptions::ParameterTranslationException | An exception class to notify incompatibility when translating parameters from different sources |
+ Modulo 5.0.0
+
+ |
+
Modulo is part of the AICA robotics framework.
+It is an extension layer to ROS 2 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.
+Modulo API documentation is available at aica-technology.github.io/modulo.
+To start developing custom components and controllers with modulo, refer to the aica-technology/component-template repository and corresponding documentation at https://docs.aica.tech/docs/category/custom-components.
+The core package implements interoperability between ROS 2 and state_representation data types, allowing state data and parameters to be directly translated and handled as messages on the ROS 2 interface layer.
+Modulo components are wrappers for ROS 2 Nodes which abstract low-level ROS methods for greater user convenience and consistency between components.
+While ROS 2 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 ROS 2 with ROS 1 in order to publish/subscribe to topics from ROS 1.
+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.
+