50 : TclClass(
"Position/UDP")
70 if (strcasecmp(argv[1],
"start") == 0)
73 LOG_MSG_ERROR(NOW <<
"::UDPPosition: position listener thread already started!");
91 else if (strcasecmp(argv[1],
"stop") == 0)
98 LOG_MSG_INFO(NOW <<
"::UDPPosition: stopping position listener");
106 return Position::command(argc, argv);
112 LOG_MSG_INFO(NOW <<
"::UDPPosition: setting position to [" << pos.
x <<
"," << pos.
y <<
"," << pos.
z <<
"]");
113 std::unique_lock<std::mutex> lock(
mutex_);
114 Position::setX(pos.
x);
115 Position::setY(pos.
y);
116 Position::setZ(pos.
z);
122 std::unique_lock<std::mutex> lock(
mutex_);
123 return Position::getX();
128 std::unique_lock<std::mutex> lock(
mutex_);
129 return Position::getY();
134 std::unique_lock<std::mutex> lock(
mutex_);
135 return Position::getZ();
140 std::unique_lock<std::mutex> lock(
mutex_);
145 std::unique_lock<std::mutex> lock(
mutex_);
150 std::unique_lock<std::mutex> lock(
mutex_);
Position listener thread with UDP socket.
bool Running()
Returns the current state of the thread.
bool Start(bool exc_info=false)
Start the thread.
void Stop(bool wait=false)
Stop the thread, needs call(s) to StopRequested() in the Run() worker function to check for the stop ...
TclObject * create(int, const char *const *)
virtual double getX()
Method that return the current projection of the node on the x-axis.
virtual void setZ(double z)
virtual void setY(double y)
unsigned int m_SocketReadTimeout
Socket timeout for select() call in [us].
UDPPosition()
Constructor.
virtual void setX(double x)
virtual int command(int argc, const char *const *argv)
TCL command interpreter setdest <integer value>integer value>integer value>: set the movement pattern...
void setPosition(const PositionData &pos)
PositionListener< UDPPosition > * p_PositionListener
virtual double getY()
Method that return the current projection of the node on the y-axis.
unsigned int m_UdpReceivePort
Position receive port number for UDP socket.
virtual double getZ()
Method that return the current projection of the node on the z-axis.
#define LOG_MSG_INFO(msg)
#define LOG_MSG_ERROR(msg)
Position data structure for submitting node positions to DESERT in ENU coordinates.
UDPPositionClass class_uwsmposition
Provides the definition of the class UDPPosition.