Skip to content

Commit cf2a8f6

Browse files
committed
Update trajectory_point_interface documentation
1 parent 62fdb1a commit cf2a8f6

File tree

5 files changed

+53
-12
lines changed

5 files changed

+53
-12
lines changed

doc/architecture/instruction_executor.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ Instruction Executor
66
The Instruction Executor is a convenience wrapper to make common robot instructions such as point
77
to point motions easily accessible. Currently, it supports the following instructions:
88

9-
* Excecute MoveJ point to point motions
9+
* Execute MoveJ point to point motions
1010
* Execute MoveL point to point motions
11-
* Execute sequences consisting of MoveJ and MoveL instructions
11+
* Execute MoveP point to point motions
12+
* Execute MoveC circular motions
13+
* Execute sequences consisting of the motion primitives above
1214

1315
The Instruction Executor uses the :ref:`trajectory_point_interface` and the
1416
:ref:`reverse_interface`

doc/architecture/trajectory_point_interface.rst

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,32 @@ representations in 21 datafields. The data fields have the following meaning:
3939
===== =====
4040
index meaning
4141
===== =====
42-
0-5 trajectory point positions (floating point)
43-
6-11 trajectory point velocities (floating point)
44-
12-17 trajectory point accelerations (floating point)
45-
18 trajectory point type (0: MOVEJ, 1: MOVEL, 51: SPLINE)
46-
19 trajectory point time (in seconds, floating point)
42+
0-5 trajectory point positions (Multiplied by ``MULT_JOINTSTATE``)
43+
6-11 trajectory point velocities (Multiplied by ``MULT_JOINTSTATE``). For MOVEC, this contains the "via pose".
44+
12-17 trajectory point accelerations (Multiplied by ``MULT_JOINTSTATE``).
45+
46+
For MOVEC:
47+
48+
- 12: velocity (Multiplied by ``MULT_JOINTSTATE``)
49+
- 13: acceleration (Multiplied by ``MULT_JOINTSTATE``)
50+
- 14: mode
51+
52+
18 trajectory point type
53+
54+
- 0: MOVEJ
55+
- 1: MOVEL
56+
- 2: MOVEP
57+
- 3: MOVEC
58+
- 51: SPLINE)
59+
60+
19 trajectory point time (in seconds, multiplied by ``MULT_TIME``)
4761
20 depending on trajectory point type
4862

49-
- MOVEJ, MOVEL: point blend radius (in meters, floating point)
63+
- MOVEJ, MOVEL: point blend radius (in meters, multiplied by ``MULT_TIME``)
5064
- SPLINE: spline type (1: CUBIC, 2: QUINTIC)
5165
===== =====
66+
67+
where
68+
69+
- ``MULT_JOINTSTATE``: 1000000
70+
- ``MULT_TIME``: 1000

doc/examples/instruction_executor.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,12 @@ To run a sequence of motions, create an
4444
:end-at: instruction_executor->executeMotion(motion_sequence);
4545

4646
Each element in the motion sequence can be a different motion type. In the example, there are two
47-
``MoveJ`` motions and two ``MoveL`` motion. The primitives' parameters are directly forwarded to
47+
``MoveJ`` motions, a ``MoveL`` motion and a ``MoveP`` motion. The primitives' parameters are directly forwarded to
4848
the underlying script functions, so the parameter descriptions for them apply, as well.
4949
Particularly, you may want to choose between either a time-based execution speed or an acceleration
50-
/ velocity parametrization. The latter will be ignored if a time > 0 is given.
50+
/ velocity parametrization for some move functions. The latter will be ignored if a time > 0 is given.
51+
52+
Please refer to the script manual for details.
5153

5254
Execute a single motion
5355
-----------------------

examples/instruction_executor.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ int main(int argc, char* argv[])
8989

9090
std::make_shared<urcl::control::MoveLPrimitive>(urcl::Pose(-0.203, 0.263, 0.559, 0.68, -1.083, -2.076), 0.1,
9191
std::chrono::seconds(2)),
92-
std::make_shared<urcl::control::MoveLPrimitive>(urcl::Pose{ -0.203, 0.463, 0.559, 0.68, -1.083, -2.076 }, 0.1,
93-
std::chrono::seconds(2)),
92+
std::make_shared<urcl::control::MovePPrimitive>(urcl::Pose{ -0.203, 0.463, 0.559, 0.68, -1.083, -2.076 }, 0.1, 0.4,
93+
0.4),
9494
};
9595
instruction_executor->executeMotion(motion_sequence);
9696

@@ -105,6 +105,8 @@ int main(int argc, char* argv[])
105105
// goal time parametrization -- acceleration and velocity will be ignored
106106
instruction_executor->moveL({ -0.203, 0.463, 0.559, 0.68, -1.083, -2.076 }, 0.1, 0.1, goal_time_sec);
107107

108+
instruction_executor->moveP({ -0.203, 0.263, 0.559, 0.68, -1.083, -2.076 }, 1.5, 1.5);
109+
108110
g_my_robot->ur_driver_->stopControl();
109111
return 0;
110112
}

include/ur_client_library/ur/instruction_executor.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,27 @@ class InstructionExecutor
108108
* \param acceleration Tool acceleration [m/s^2]
109109
* \param velocity Tool speed [m/s]
110110
* \param blend_radius The blend radius to use for the motion.
111+
*
111112
* \return True if the robot has reached the target, false otherwise.
112113
*/
113114
bool moveP(const urcl::Pose& target, const double acceleration = 1.4, const double velocity = 1.04,
114115
const double blend_radius = 0.0);
115116

117+
/**
118+
* \brief Move the robot to a pose target using movec
119+
*
120+
* This function will move the robot to the given pose target in a circular motion going through via. The robot will
121+
* move with the given acceleration and velocity. The function will return once the robot has reached the target.
122+
*
123+
* \param via The circle will be defined by the current pose (the end pose of the previous motion), the target and the
124+
* via point.
125+
* \param target The pose target to move to.
126+
* \param acceleration Tool acceleration [m/s^2]
127+
* \param velocity Tool speed [m/s]
128+
* \param blend_radius The blend radius to use for the motion.
129+
*
130+
* \return True if the robot has reached the target, false otherwise.
131+
*/
116132
bool moveC(const urcl::Pose& via, const urcl::Pose& target, const double acceleration = 1.4,
117133
const double velocity = 1.04, const double blend_radius = 0.0, const int32_t mode = 0);
118134

0 commit comments

Comments
 (0)