Skip to content

Commit e8e7642

Browse files
committed
Update documentation
1 parent 69674c3 commit e8e7642

File tree

6 files changed

+21
-19
lines changed

6 files changed

+21
-19
lines changed

doc/examples/force_mode.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@ Force Mode example
66
The ``ur_client_library`` supports leveraging the robot's force mode directly. An example on how to
77
use it can be found in `force_mode_example.cpp <https://github.com/UniversalRobots/Universal_Robots_Client_Library/blob/master/examples/force_mode_example.cpp>`_.
88

9-
In order to utilize force mode, we'll have to create and initialize a full ``UrDriver`` object
10-
first:
9+
In order to utilize force mode, we'll have to create and initialize a driver object
10+
first. We use the ``ExampleRobotWrapper`` class for this example. That starts a :ref:`ur_driver`
11+
and a :ref:`dashboard_client` to communicate with the robot:
1112

1213
.. literalinclude:: ../../examples/force_mode_example.cpp
1314
:language: c++
1415
:caption: examples/force_mode_example.cpp
1516
:linenos:
1617
:lineno-match:
17-
:start-at: // Now the robot is ready to receive a program
18+
:start-at: bool headless_mode = true;
1819
:end-at: // End of initialization
1920

2021
Start force mode

doc/examples/instruction_executor.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ The `instruction_executor.cpp <https://github.com/UniversalRobots/Universal_Robo
2020
:caption: examples/instruction_executor.cpp
2121
:linenos:
2222
:lineno-match:
23-
:start-at: std::unique_ptr<urcl::ToolCommSetup> tool_comm_setup;
24-
:end-at: auto instruction_executor = std::make_shared<urcl::InstructionExecutor>(g_my_driver);
23+
:start-at: bool headless_mode = true;
24+
:end-at: auto instruction_executor = std::make_shared<urcl::InstructionExecutor>(g_my_robot->ur_driver_);
2525

2626
At first, a ``InstructionExecutor`` object is created with the URDriver object as it needs that
2727
for communication with the robot.
@@ -61,6 +61,6 @@ To run a single motion, the ``InstructionExecutor`` provides the methods ``moveJ
6161
:linenos:
6262
:lineno-match:
6363
:start-at: double goal_time_sec = 2.0;
64-
:end-before: g_my_driver->stopControl();
64+
:end-before: g_my_robot->ur_driver_->stopControl();
6565

6666
Again, time parametrization has priority over acceleration / velocity parameters.

doc/examples/tool_contact_example.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ tool contact mode to detect collisions and stop the robot.
1212
As a basic concept, we will move the robot linearly in the negative z axis until the tool hits
1313
something or the program's timeout is hit.
1414

15-
At first, we create a ``UrDriver`` object as usual:
15+
At first, we create a initialize a driver as usual:
1616

1717
.. literalinclude:: ../../examples/tool_contact_example.cpp
1818
:language: c++
1919
:caption: examples/tool_contact_example.cpp
2020
:linenos:
2121
:lineno-match:
22-
:start-at: std::unique_ptr<ToolCommSetup> tool_comm_setup;
23-
:end-before: g_my_driver->registerToolContactResultCallback
22+
:start-at: bool headless_mode = true;
23+
:end-before: g_my_robot->ur_driver_->registerToolContactResultCallback
2424

2525
We use a small helper function to make sure that the reverse interface is active and connected
2626
before proceeding.
@@ -45,8 +45,8 @@ This function is registered as a callback to the driver and then tool_contact mo
4545
:caption: examples/tool_contact_example.cpp
4646
:linenos:
4747
:lineno-match:
48-
:start-at: g_my_driver->registerToolContactResultCallback(&handleToolContactResult);
49-
:end-at: g_my_driver->startToolContact()
48+
:start-at: g_my_robot->ur_driver_->registerToolContactResultCallback(&handleToolContactResult);
49+
:end-at: g_my_robot->ur_driver_->startToolContact()
5050

5151
Once everything is initialized, we can start a control loop commanding the robot to move in the
5252
negative z direction until the program timeout is hit or a tool contact is detected:

doc/examples/trajectory_point_interface.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ At first, we create a ``UrDriver`` object as usual:
1414
:caption: examples/trajectory_point_interface.cpp
1515
:linenos:
1616
:lineno-match:
17-
:start-at: std::unique_ptr<urcl::ToolCommSetup> tool_comm_setup;
17+
:start-at: bool headless_mode = true;
1818
:end-before: // --------------- INITIALIZATION END -------------------
1919

2020
We use a small helper function to make sure that the reverse interface is active and connected
@@ -45,8 +45,8 @@ That callback can be registered at the ``UrDriver`` object:
4545
:caption: examples/trajectory_point_interface.cpp
4646
:linenos:
4747
:lineno-match:
48-
:start-at: g_my_driver->registerTrajectoryDoneCallback(&trajDoneCallback);
49-
:end-at: g_my_driver->registerTrajectoryDoneCallback(&trajDoneCallback);
48+
:start-at: g_my_robot->ur_driver_->registerTrajectoryDoneCallback(&trajDoneCallback);
49+
:end-at: g_my_robot->ur_driver_->registerTrajectoryDoneCallback(&trajDoneCallback);
5050

5151

5252
MoveJ Trajectory
@@ -67,12 +67,12 @@ parameters. The following example shows execution of a 2-point trajectory using
6767
In fact, the path is followed twice, once parametrized by a segment duration and once using maximum
6868
velocity / acceleration settings. If a duration > 0 is given for a segment, the velocity and
6969
acceleration settings will be ignored as in the underlying URScript functions. In the example
70-
above, each of the ``g_my_driver->writeTrajectoryPoint()`` calls will be translated into a
70+
above, each of the ``g_my_robot->ur_driver_->writeTrajectoryPoint()`` calls will be translated into a
7171
``movej`` command in URScript.
7272

7373
While the trajectory is running, we need to tell the robot program that connection is still active
7474
and we expect the trajectory to be running. This is being done by the
75-
``g_my_driver->writeTrajectoryControlMessage(urcl::control::TrajectoryControlMessage::TRAJECTORY_NOOP);``
75+
``g_my_robot->ur_driver_->writeTrajectoryControlMessage(urcl::control::TrajectoryControlMessage::TRAJECTORY_NOOP);``
7676
call.
7777

7878
MoveL Trajectory

doc/examples/ur_driver.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ example.
2020
Initialization
2121
--------------
2222

23-
At first, we create a ``UrDriver`` object giving it the robot's IP address, script file and RTDE
23+
At first, we create a ``ExampleRobotWrapper`` object giving it the robot's IP address, script file and RTDE
2424
recipes.
2525

2626
.. literalinclude:: ../../examples/full_driver.cpp
2727
:language: c++
2828
:caption: examples/full_driver.cpp
2929
:linenos:
3030
:lineno-match:
31-
:start-at: std::unique_ptr<ToolCommSetup> tool_comm_setup;
32-
:end-at: std::move(tool_comm_setup)
31+
:start-at: bool headless_mode = true;
32+
:end-at: // --------------- INITIALIZATION END -------------------
3333

3434
Robot control loop
3535
------------------

examples/full_driver.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ int main(int argc, char* argv[])
6868
URCL_LOG_ERROR("External Control script not running.");
6969
return 1;
7070
}
71+
// --------------- INITIALIZATION END -------------------
7172

7273
// Increment depends on robot version
7374
double increment_constant = 0.0005;

0 commit comments

Comments
 (0)