Class ReceivingInterface

Inheritance Relationships

Base Type

  • public Poco::Runnable

Derived Type

Class Documentation

class ReceivingInterface : public Poco::Runnable

The ReceivingInterface class is the base class for all receiving interfaces, such as ClientControlModeInterface, etc.

Subclassed by ClientMotionCommandInterface

Public Functions

ReceivingInterface(const Poco::Net::IPAddress &hostadress, Poco::UInt16 port, rclcpp::Node::SharedPtr node)

Constructs a new ReceivingInterface object.

Parameters:
  • hostadress – The IP address of the Navigator to connect to

  • port – The port number for the binary connection

  • node – A shared pointer to the ROS 2 node

virtual ~ReceivingInterface()

Destroys the ReceivingInterface object.

virtual void onReadEvent(const Poco::AutoPtr<Poco::Net::ReadableNotification> &notification)

Callback method invoked when data is available on the socket.

Parameters:

notification – A smart pointer to the ReadableNotification

void run()

The main execution loop for the receiving interface.

Protected Functions

virtual size_t tryToParseData(const std::vector<char> &datagram_buffer, rclcpp::Node::SharedPtr node) = 0

Actual function to be overwritten by child to handle data, e.g., convert to ros messages and publish.

Parameters:

datagram_buffer – The data received via the binary connection socket

Returns:

amount of bytes successfully parsed and can be removed from the buffer (0 if not parsing failed)

Protected Attributes

rclcpp::Node::SharedPtr node_

Node.