28 #ifndef UR_ROBOT_DRIVER_DASHBOARD_CLIENT_DASHBOARD_CLIENT_H_INCLUDED 29 #define UR_ROBOT_DRIVER_DASHBOARD_CLIENT_DASHBOARD_CLIENT_H_INCLUDED 91 bool sendRequest(
const std::string& command,
const std::string& expected);
103 std::string
sendRequestString(
const std::string& command,
const std::string& expected);
114 bool waitForReply(
const std::string& command,
const std::string& expected,
115 std::chrono::duration<double> timeout = std::chrono::seconds(30));
130 bool retryCommand(
const std::string& requestCommand,
const std::string& requestExpectedResponse,
131 const std::string& waitRequest,
const std::string& waitExpectedResponse,
132 const std::chrono::duration<double> timeout,
133 const std::chrono::duration<double> retry_period = std::chrono::seconds(1));
150 bool commandPowerOn(
const std::chrono::duration<double> timeout = std::chrono::seconds(300));
433 virtual bool open(
int socket_fd,
struct sockaddr* address,
size_t address_len)
435 return ::connect(socket_fd, address, address_len) == 0;
448 void assertVersion(
const std::string& e_series_min_ver,
const std::string& cb3_min_ver,
449 const std::string& required_call);
450 bool send(
const std::string& text);
452 void rtrim(std::string& str,
const std::string& chars =
"\t\n\v\f\r ");
460 #endif // ifndef UR_ROBOT_DRIVER_DASHBOARD_CLIENT_DASHBOARD_CLIENT_H_INCLUDED void assertVersion(const std::string &e_series_min_ver, const std::string &cb3_min_ver, const std::string &required_call)
Makes sure that the dashboard_server's version is above the required version.
bool commandGetSerialNumber(std::string &serial_number)
Get Serial number.
std::string sendRequestString(const std::string &command, const std::string &expected)
Sends command and compare it with the expected answer.
bool commandSafetyMode(std::string &safety_mode)
Get Safety mode.
bool commandSetUserRole(const std::string &user_role)
Send Set user role command (Only available for CB3)
VersionInformation polyscope_version_
bool waitForReply(const std::string &command, const std::string &expected, std::chrono::duration< double > timeout=std::chrono::seconds(30))
brief Sends a command and wait until it returns the expected answer
bool commandIsProgramSaved()
Send "Is program saved" request command.
bool retryCommand(const std::string &requestCommand, const std::string &requestExpectedResponse, const std::string &waitRequest, const std::string &waitExpectedResponse, const std::chrono::duration< double > timeout, const std::chrono::duration< double > retry_period=std::chrono::seconds(1))
Keep Sending the requesting Command and wait until it returns the expected answer.
bool commandGetRobotModel(std::string &robot_model)
Get Robot model.
bool send(const std::string &text)
bool commandUnlockProtectiveStop()
Send Unlock Protective stop popup command.
virtual ~DashboardClient()=default
bool commandClosePopup()
Send Close popup command.
bool commandStop()
Send Stop program command.
bool commandGenerateSupportFile(const std::string &dir_path)
Send Generate support file command.
bool commandBrakeRelease()
Send Brake release command.
std::string sendAndReceive(const std::string &command)
Sends a command through the socket and waits for an answer.
bool commandPopup(const std::string &popup_text)
Send popup command.
bool commandQuit()
Send Quit command.
void rtrim(std::string &str, const std::string &chars="\\\")
bool commandClearOperationalMode()
Send Clear operational mode command.
const int DASHBOARD_SERVER_PORT
bool sendRequest(const std::string &command, const std::string &expected)
Sends command and compare it with the expected answer.
bool commandShutdown()
Send Shutdown command.
bool commandLoadProgram(const std::string &program_file_name)
Send Load program command.
bool commandProgramState(std::string &program_state)
Get Program state.
bool commandSafetyStatus(std::string &safety_status)
Get Safety status.
bool commandAddToLog(const std::string &log_text)
Send text to log.
bool connect()
Opens a connection to the dashboard server on the host as specified in the constructor.
bool commandSaveLog()
Flush the polyscope log to the log_history.txt file.
bool commandLoadInstallation(const std::string &installation_file_name)
Send Load installation command.
bool commandPowerOn(const std::chrono::duration< double > timeout=std::chrono::seconds(300))
Send Power on command.
bool commandPowerOff()
Send Power off command.
bool commandRunning()
Send Running command.
bool commandRobotMode(std::string &robot_mode)
Get Robot mode.
Class for TCP socket abstraction.
bool commandGetLoadedProgram(std::string &loaded_program)
Get Loaded Program.
virtual bool open(int socket_fd, struct sockaddr *address, size_t address_len)
This class is a wrapper around the dashboard server.
void disconnect()
Makes sure no connection to the dashboard server is held inside the object.
bool commandIsInRemoteControl()
Send "Is in remote control" query command.
bool commandPause()
Send Pause program command.
bool commandRestartSafety()
Send Restart Safety command.
bool commandPlay()
Send Play program command.
bool commandGenerateFlightReport(const std::string &report_type)
Send Generate flight report command.
bool commandSetOperationalMode(const std::string &operational_mode)
Send Set operational mode command (Only available for e-series)
bool commandGetUserRole(std::string &user_role)
Send Get user role command (Only available for CB3)
bool commandGetOperationalMode(std::string &operational_mode)
Get Operational mode.
bool commandCloseSafetyPopup()
Send Close safety popup command.
bool commandPolyscopeVersion(std::string &polyscope_version)
Get Polyscope version.