#include "defines.h" #include "StringTool.h" #include #include "friremote.h" #ifndef SVR_HANDLING #define SVR_HANDLING // Serve status typedef enum {waiting, handshake, accepted, done} svr_state; class SvrHandling : private StringTool { private: svr_state c_state; //Handshake bool handshakeAccepted(SocketObject& client); //Handle client void handle(SocketObject& client); //Handling request for current Joint Values void GetPositionJoints(SocketObject& client); //Get Position as POSE Matrix void GetPositionHomRowWise(SocketObject& client); //Get Force/torque values from TCP void GetForceTorqueTcp(SocketObject& client); //Move to given Joint combination void MovePTPJoints(SocketObject& client, std::string& args); //Move to given POSE position void MoveHomRowWiseStatus(SocketObject& client, std::string& args); //Set Velocity void SetSpeed(SocketObject& client, std::string& args); //Set Acceleration void SetAccel(SocketObject& client, std::string& args); //Starting Potential Field Movement Mode void StartPotFieldMode(SocketObject& client, std::string& args); //Stopping Potential Field Movement Mode void StopPotFieldMode(SocketObject& client, std::string& args); //Setting Target Position HomRowWise for Potential Move void SetPos(SocketObject& client, std::string& args); //Setting Target Position as Joints for Potential Move void SetJoints(SocketObject& client, std::string& args); //Cartesian Movement //Move to given POSE position void MoveCartesian(SocketObject& client, std::string& args); //Do Ultrasound void DoUltrasound(SocketObject& client, std::string& args); //Quit void quit(SocketObject& client); //DEBUGGING void debug(SocketObject& client); public: //Constructor SvrHandling(); //Destructor virtual ~SvrHandling(); //Rund server @port void run(int port); //Get current timestamp std::string timestamp(); }; #endif