This class is a wrapper around the dashboard server.
More...
#include <dashboard_client.h>
|
virtual bool | open (int socket_fd, struct sockaddr *address, size_t address_len) |
|
virtual void | setOptions (int socket_fd) |
|
bool | setup (std::string &host, int port) |
|
|
std::string | read () |
|
void | rtrim (std::string &str, const std::string &chars="\t\n\v\f\r ") |
|
bool | send (const std::string &text) |
|
This class is a wrapper around the dashboard server.
For every Dashboard command there exists a wrapper function that will send the request and wait for the server's response.
For documentation about the dashboard server, please see
Definition at line 44 of file dashboard_client.h.
urcl::DashboardClient::DashboardClient |
( |
const std::string & |
host | ) |
|
Constructor that shall be used by default.
- Parameters
-
host | IP address of the robot |
Definition at line 35 of file dashboard_client.cpp.
urcl::DashboardClient::DashboardClient |
( |
| ) |
|
|
delete |
virtual urcl::DashboardClient::~DashboardClient |
( |
| ) |
|
|
virtualdefault |
bool urcl::DashboardClient::connect |
( |
| ) |
|
Opens a connection to the dasboard server on the host as specified in the constructor.
- Returns
- True on successful connection, false otherwise.
Definition at line 39 of file dashboard_client.cpp.
void urcl::DashboardClient::disconnect |
( |
| ) |
|
Makes sure no connection to the dashboard server is held inside the object.
Definition at line 55 of file dashboard_client.cpp.
virtual bool urcl::DashboardClient::open |
( |
int |
socket_fd, |
|
|
struct sockaddr * |
address, |
|
|
size_t |
address_len |
|
) |
| |
|
inlineprotectedvirtual |
std::string urcl::DashboardClient::read |
( |
| ) |
|
|
private |
void urcl::DashboardClient::rtrim |
( |
std::string & |
str, |
|
|
const std::string & |
chars = "\t\n\v\f\r " |
|
) |
| |
|
inlineprivate |
bool urcl::DashboardClient::send |
( |
const std::string & |
text | ) |
|
|
private |
std::string urcl::DashboardClient::sendAndReceive |
( |
const std::string & |
command | ) |
|
Sends a command through the socket and waits for an answer.
- Parameters
-
command | Command that will be sent to the server. It is important, that the command sent is finished with a '
' (newline) so it will be processed by the server. |
- Returns
- Answer as received by the server cut off any trailing newlines.
Definition at line 92 of file dashboard_client.cpp.
const int urcl::DashboardClient::DASHBOARD_SERVER_PORT = 29999 |
std::string urcl::DashboardClient::host_ |
|
private |
int urcl::DashboardClient::port_ |
|
private |
std::mutex urcl::DashboardClient::write_mutex_ |
|
private |
The documentation for this class was generated from the following files:
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