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 12 of file MessagePairInterface.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.
|
inlinenodiscard |
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.
|
inlinenodiscard |
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.