DESERT 4.0.0
UDPPosition Class Reference

#include <udpposition.h>

Inheritance diagram for UDPPosition:
Inheritance graph
Collaboration diagram for UDPPosition:
Collaboration graph

Public Member Functions

 UDPPosition ()
 
virtual ~UDPPosition ()=default
 
virtual double getX ()
 
virtual double getY ()
 
virtual double getZ ()
 
virtual int command (int argc, const char *const *argv)
 
virtual void setX (double x)
 
virtual void setY (double y)
 
virtual void setZ (double z)
 
int debugLevel () const
 
void setPosition (const PositionData &pos)
 

Private Attributes

int debug_
 
unsigned int m_UdpReceivePort
 
unsigned int m_SocketReadTimeout {50000}
 
std::mutex mutex_
 
PositionListener< UDPPosition > * p_PositionListener {nullptr}
 

Constructor & Destructor Documentation

◆ UDPPosition()

UDPPosition::UDPPosition ( )

Constructor

References debug_, and m_UdpReceivePort.

◆ ~UDPPosition()

virtual UDPPosition::~UDPPosition ( )
virtualdefault

Destructor

Member Function Documentation

◆ command()

int UDPPosition::command ( int  argc,
const char *const *  argv 
)
virtual

TCL command interpreter setdest <integer value>integer value>integer value>: set the movement pattern: the firts two values define the point to be reached (i.e., the direction of the movement) and the third value defines the speed to be used

Moreover it inherits all the OTcl method of Position

Parameters
argcnumber of arguments in argv
argvarray of strings which are the comand parameters (Note that argv[0] is the name of the object)
Returns
TCL_OK or TCL_ERROR whether the command has been dispatched succesfully or no

References debug_, m_SocketReadTimeout, m_UdpReceivePort, p_PositionListener, StoppableThread::Running(), StoppableThread::Start(), and StoppableThread::Stop().

Here is the call graph for this function:

◆ debugLevel()

int UDPPosition::debugLevel ( ) const
inline

References debug_.

◆ getX()

double UDPPosition::getX ( )
virtual

Method that return the current projection of the node on the x-axis. If it's necessary (updating time ia expired), update the position values before returns it.

References mutex_.

◆ getY()

double UDPPosition::getY ( )
virtual

Method that return the current projection of the node on the y-axis. If it's necessary (updating time ia expired), update the position values before returns it.

References mutex_.

◆ getZ()

double UDPPosition::getZ ( )
virtual

Method that return the current projection of the node on the z-axis. If it's necessary (updating time ia expired), update the position values before returns it.

References mutex_.

◆ setPosition()

void UDPPosition::setPosition ( const PositionData pos)

◆ setX()

void UDPPosition::setX ( double  x)
virtual

References mutex_.

◆ setY()

void UDPPosition::setY ( double  y)
virtual

References mutex_.

◆ setZ()

void UDPPosition::setZ ( double  z)
virtual

References mutex_.

Member Data Documentation

◆ debug_

int UDPPosition::debug_
private

◆ m_SocketReadTimeout

unsigned int UDPPosition::m_SocketReadTimeout {50000}
private

Socket timeout for select() call in [us]

Referenced by command().

◆ m_UdpReceivePort

unsigned int UDPPosition::m_UdpReceivePort
private

Position receive port number for UDP socket

Referenced by command(), and UDPPosition().

◆ mutex_

std::mutex UDPPosition::mutex_
private

Referenced by getX(), getY(), getZ(), setPosition(), setX(), setY(), and setZ().

◆ p_PositionListener

PositionListener<UDPPosition>* UDPPosition::p_PositionListener {nullptr}
private

Referenced by command().


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