Skip to content

Commit 4214290

Browse files
committed
Update dashboard client documentation
1 parent e0ff005 commit 4214290

File tree

3 files changed

+30
-19
lines changed

3 files changed

+30
-19
lines changed

doc/architecture.rst

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ fully functioning robot interface. For details on how to use it, please see the
1616
.. toctree::
1717
:maxdepth: 1
1818

19-
architecture/script_sender
19+
architecture/dashboard_client
2020
architecture/rtde_client
21+
architecture/script_sender
2122

2223
The ``UrDriver``'s modules will be explained in the following.
2324

@@ -59,17 +60,3 @@ sendScript()
5960
This function sends given URScript code directly to the secondary interface. The
6061
``sendRobotProgram()`` function is a special case that will send the script code given in the
6162
``RTDEClient`` constructor.
62-
63-
DashboardClient
64-
---------------
65-
66-
The ``DashboardClient`` wraps the calls on the `Dashboard server <https://www.universal-robots.com/articles/ur-articles/dashboard-server-e-series-port-29999/>`_
67-
directly into C++ functions.
68-
69-
After connecting to the dashboard server by using the ``connect()`` function, dashboard calls can be
70-
sent using the ``sendAndReceive()`` function. Answers from the dashboard server will be returned as
71-
string from this function. If no answer is received, a ``UrException`` is thrown.
72-
73-
Note: In order to make this more useful developers are expected to wrap this bare interface into
74-
something that checks the returned string for something that is expected. See the
75-
`DashboardClientROS <https://github.com/UniversalRobots/Universal_Robots_ROS_Driver/blob/master/ur_robot_driver/include/ur_robot_driver/dashboard_client_ros.h>`_ as an example.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
DashboardClient
2+
===============
3+
4+
The ``DashboardClient`` wraps the calls on the `Dashboard server <https://www.universal-robots.com/articles/ur-articles/dashboard-server-e-series-port-29999/>`_
5+
directly into C++ functions.
6+
7+
After connecting to the dashboard server by using the ``connect()`` function, dashboard calls can be
8+
sent using the ``sendAndReceive()`` function. Answers from the dashboard server will be returned as
9+
string from this function. If no answer is received, a ``UrException`` is thrown.
10+
11+
The `dashboard_example.cpp <https://github.com/UniversalRobots/Universal_Robots_Client_Library/blob/master/examples/dashboard_example.cpp>`_ shows how to use this class:
12+
13+
.. literalinclude:: ../../examples/dashboard_example.cpp
14+
:language: c++
15+
:caption: examples/dashboard_example.cpp
16+
:linenos:
17+
:lineno-match:
18+
:start-at: std::make_unique<DashboardClient>
19+
:end-at: my_dashboard->commandCloseSafetyPopup();
20+
21+
22+
.. note::
23+
In order to make this more useful developers are expected to wrap this bare interface into
24+
something that checks the returned string for something that is expected. See the
25+
`DashboardClientROS <https://github.com/UniversalRobots/Universal_Robots_ROS_Driver/blob/master/ur_robot_driver/include/ur_robot_driver/dashboard_client_ros.h>`_ as an example.
26+

examples/dashboard_example.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,8 @@ int main(int argc, char* argv[])
5757
robot_ip = std::string(argv[1]);
5858
}
5959

60-
// Making the robot ready for the program by:
61-
// Connect the the robot Dashboard
62-
std::unique_ptr<DashboardClient> my_dashboard;
63-
my_dashboard.reset(new DashboardClient(robot_ip));
60+
// Connect to the robot Dashboard Server
61+
auto my_dashboard = std::make_unique<DashboardClient>(robot_ip);
6462
if (!my_dashboard->connect())
6563
{
6664
URCL_LOG_ERROR("Could not connect to dashboard");

0 commit comments

Comments
 (0)