sendServoJCommands
Description
sendServoJCommands(
sends Servoj commands to control the joint positions of Universal Robots cobot through
the RTDE interface based on the specified joint configuration.ur
, jointConfig
)
sendServoJCommands(
specifies options using one or more name-value arguments in addition to the input
arguments in previous syntaxes. You can use the name-value arguments to set the maximum
duration, velocity, acceleration, look-ahead time, and parameter gain.ur
, jointConfig
, Name=Value
)
Examples
Send Servoj Commands to Control Joint Positions of Cobot
Connect to a physical or simulated cobot by using the
urRTDEClient
object.
ur = urRTDEClient('172.19.98.176');
ur = urRTDEClient with properties: CobotName: 'universalUR5e' URControllerIP: '172.19.98.176' ControllerVersion: '5.11.1.0' RTDEFrequency: 125 ConnectionTimeOut: 10 RigidBodyTree: [1×1 rigidBodyTree]
Send Servoj commands to control joint positions of the cobot by specifying maximum duration, velocity, acceleration, look-ahead time, and parameter gain.
jointWaypoints = [0.0,1.57,-1.57,0,0,3.14]; sendServoJCommands(ur, jointWaypoints, EndTime=0.008, Acceleration=0.1, Velocity=0.1, LookAheadTime=0.1, PGain=300);
Input Arguments
ur
— Connection to Universal Robots cobot
urRTDEClient
object
Connection to a physical or simulated cobot from Universal Robots, specified as
a urRTDEClient
object.
jointConfig
— Desired joint configuration
numeric vector
Desired joint configuration of the physical or simulated cobot, specified as a 1-by-6 numeric vector in the range [-pi,pi].
Data Types: array
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Example:
sendServoJCommands(ur, jointWaypoints, Acceleration=0.1)
EndTime
— Maximum duration to complete motion
5
(default) | numeric scalar
Maximum duration (in seconds) by which the physical or simulated cobot must try to complete the motion to reach the desired joint position, specified as a numeric scalar.
Data Types: double
Acceleration
— Acceleration to control trapezoidal speed profile
1.4
(default) | numeric scalar
Acceleration (in rad/s2) to control trapezoidal speed profile of the trajectory, specified as a numeric scalar.
Example:
sendServoJCommands(ur, jointWaypoints,Acceleration=1.2)
Note
If 'EndTime'
is a non-zero value,
'Acceleration'
is ignored because time takes
precedence. To use 'Acceleration'
, set
'EndTime'
to 0
.
Velocity
— Velocity to control trapezoidal speed profile
1.05
(default) | numeric scalar
Velocity (in rad/s) to control trapezoidal speed profile of trajectory, specified as a numeric scalar.
Example:
sendServoJCommands(ur, jointWaypoints,Velocity=1.0)
Note
If you specify 'EndTime'
argument, the
'Velocity'
argument value has no impact because the
'EndTime'
argument has priority over the velocity and
acceleration settings.
LookAheadTime
— Look-ahead time for joint transition
0.1
(default) | numeric scalar
Look-ahead time (in seconds) for joint transition from current position to the next based on the current velocity, specified as a numeric scalar. This option is useful for error calculation and to smoothen the trajectory. A low value gives a fast reaction, and a high value prevents overshoot.
Example:
sendServoJCommands(ur, jointWaypoints, Velocity=1,
LookAheadTime=0.15)
PGain
— Proportional gain to modify magnitude of error
300
(default) | numeric scalar
Proportional gain to modify the magnitude of error between actual and desired positions, specified as a numeric scalar. The function uses this value to adjust the position of cobot. This value is similar to the proportional gain of a PID controller.
Example:
sendServoJCommands(ur, jointWaypoints,PGain=500)
Version History
Introduced in R2024a
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)