Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
urcl::comm::ReverseInterface Class Reference

The ReverseInterface class handles communication to the robot. It starts a server and waits for the robot to connect via its URCaps program. More...

#include <reverse_interface.h>

Public Member Functions

 ReverseInterface ()=delete
 
 ReverseInterface (uint32_t port, std::function< void(bool)> handle_program_state)
 Creates a ReverseInterface object including a TCPServer. More...
 
void setKeepaliveCount (const uint32_t &count)
 Set the Keepalive count. This will set the number of allowed timeout reads on the robot. More...
 
bool write (const vector6d_t *positions, const ControlMode control_mode=ControlMode::MODE_IDLE)
 Writes needed information to the robot to be read by the URCaps program. More...
 
 ~ReverseInterface ()
 Disconnects possible clients so the reverse interface object can be safely destroyed. More...
 

Private Member Functions

template<typename T >
size_t append (uint8_t *buffer, T &val)
 
void connectionCallback (const int filedescriptor)
 
void disconnectionCallback (const int filedescriptor)
 
void messageCallback (const int filedescriptor, char *buffer)
 

Private Attributes

int client_fd_
 
std::function< void(bool)> handle_program_state_
 
uint32_t keepalive_count_
 
TCPServer server_
 

Static Private Attributes

static const int32_t MULT_JOINTSTATE = 1000000
 

Detailed Description

The ReverseInterface class handles communication to the robot. It starts a server and waits for the robot to connect via its URCaps program.

Definition at line 58 of file reverse_interface.h.

Constructor & Destructor Documentation

urcl::comm::ReverseInterface::ReverseInterface ( )
delete
urcl::comm::ReverseInterface::ReverseInterface ( uint32_t  port,
std::function< void(bool)>  handle_program_state 
)
inline

Creates a ReverseInterface object including a TCPServer.

Parameters
portPort the Server is started on
handle_program_stateFunction handle to a callback on program state changes.

Definition at line 68 of file reverse_interface.h.

urcl::comm::ReverseInterface::~ReverseInterface ( )
inline

Disconnects possible clients so the reverse interface object can be safely destroyed.

Definition at line 82 of file reverse_interface.h.

Member Function Documentation

template<typename T >
size_t urcl::comm::ReverseInterface::append ( uint8_t *  buffer,
T &  val 
)
inlineprivate

Definition at line 175 of file reverse_interface.h.

void urcl::comm::ReverseInterface::connectionCallback ( const int  filedescriptor)
inlineprivate

Definition at line 141 of file reverse_interface.h.

void urcl::comm::ReverseInterface::disconnectionCallback ( const int  filedescriptor)
inlineprivate

Definition at line 156 of file reverse_interface.h.

void urcl::comm::ReverseInterface::messageCallback ( const int  filedescriptor,
char *  buffer 
)
inlineprivate

Definition at line 163 of file reverse_interface.h.

void urcl::comm::ReverseInterface::setKeepaliveCount ( const uint32_t &  count)
inline

Set the Keepalive count. This will set the number of allowed timeout reads on the robot.

Parameters
countNumber of allowed timeout reads on the robot.

Definition at line 135 of file reverse_interface.h.

bool urcl::comm::ReverseInterface::write ( const vector6d_t positions,
const ControlMode  control_mode = ControlMode::MODE_IDLE 
)
inline

Writes needed information to the robot to be read by the URCaps program.

Parameters
positionsA vector of joint targets for the robot
control_modeControl mode assigned to this command. See documentation of ControlMode for details on possible values.
Returns
True, if the write was performed successfully, false otherwise.

Definition at line 95 of file reverse_interface.h.

Member Data Documentation

int urcl::comm::ReverseInterface::client_fd_
private

Definition at line 169 of file reverse_interface.h.

std::function<void(bool)> urcl::comm::ReverseInterface::handle_program_state_
private

Definition at line 182 of file reverse_interface.h.

uint32_t urcl::comm::ReverseInterface::keepalive_count_
private

Definition at line 183 of file reverse_interface.h.

const int32_t urcl::comm::ReverseInterface::MULT_JOINTSTATE = 1000000
staticprivate

Definition at line 172 of file reverse_interface.h.

TCPServer urcl::comm::ReverseInterface::server_
private

Definition at line 170 of file reverse_interface.h.


The documentation for this class was generated from the following file:


ur_client_library
Author(s): Thomas Timm Andersen, Simon Rasmussen, Felix Exner, Lea Steffen, Tristan Schnell
autogenerated on Sun May 9 2021 02:16:26