Class RobotReceiveTimeout

Class Documentation

class RobotReceiveTimeout

RobotReceiveTimeout class containing a timeout configuration.

This robot receive timeout is used to configure the read timeout for the reverse socket running in the external control script. The read timeout is the number of milliseconds until the read action times out. A timeout of 0 or negative number indicates that the function should not return until a read is completed, this will make the read function on the robot blocking. This can be set using the function off().

Public Functions

RobotReceiveTimeout() = delete
~RobotReceiveTimeout() = default
int verifyRobotReceiveTimeout(const comm::ControlMode control_mode, const std::chrono::milliseconds step_time) const

Helper function to verify that the robot receive timeout is configured appropriately given the current control mode.

Parameters:
  • control_mode – current control mode

  • step_time – The robots step time

Returns:

receive timeout in milliseconds

Public Members

std::chrono::milliseconds timeout_

Public Static Functions

static RobotReceiveTimeout millisec(const unsigned int milliseconds = 20)

Create a RobotReceiveTimeout object with a specific timeout given in milliseconds.

Parameters:

milliseconds – robot receive timeout

Returns:

RobotReceiveTimeout object

static RobotReceiveTimeout sec(const float seconds = 0.02)

Create a RobotReceiveTimeout object with a specific timeout given in seconds.

Parameters:

seconds – robot receive timeout

Returns:

RobotReceiveTimeout object

static RobotReceiveTimeout off()

Creates a RobotReceiveTimeout object with no timeout, this will make the read function on the robot blocking.

Returns:

RobotReceiveTimeout object

Public Static Attributes

static constexpr std::chrono::milliseconds MAX_RT_RECEIVE_TIMEOUT_MS = std::chrono::milliseconds(200)