Main Content

sendCartesianPoseAndWait

Command robot to move to desired Cartesian pose and wait for the motion to complete

Since R2022a

Description

ROS or ROS2 interface

example

[result,state] = sendCartesianPoseAndWait(ur,pose) commands the Universal Robots cobot connected through ROS or ROS2 interface, and waits for the robot to complete the motion, based on the specified Cartesian pose of the end-effector. The function returns the goal state and the result.

example

[result,state] = sendCartesianPoseAndWait(ur,pose,EndTime=endtime,TimeOut=timeout) commands the Universal Robots cobot connected through ROS or ROS2 interface, and waits for the robot to complete the motion, based on the specified Cartesian pose of the end-effector, maximum duration, and timeout. The method commands the robot to complete the motion from current Cartesian pose to the desired Cartesian pose within the duration and returns the goal state and the result. If the server does not return the result with in the additional timeout period that you specified, the function displays an error.

RTDE interface

example

[result,state] = sendCartesianPoseAndWait(ur,pose) commands the Universal Robots cobot connected through RTDE interface, and waits for the robot to complete the motion, based on the specified Cartesian pose of the end-effector. The function returns the goal state and the result.

example

[result,state] = sendCartesianPoseandWait(ur,pose,Name=Value) commands the Universal Robots cobot connected through RTDE interface, and waits for the robot to complete the motion, based on the specified Cartesian pose of the end-effector, and sets the velocity, acceleration, and blend radius properties using one or more optional name-value arguments.

Examples

collapse all

Connect to a physical or simulated cobot, using either urROSNode or urROS2Node object (based on the option for connectivity – ROS or ROS 2, which you selected in the Hardware Setup screen).

  • Connect to a physical or simulated cobot at IP address 192.168.2.112 on the ROS network.

    ur = urROSNode('192.168.2.112');
  • Connect to a physical or simulated cobot on the ROS 2 network.

    ur = urROS2Node;

Command the cobot to by providing the desired Cartesian pose and by specifying the time to reach the pose as 7 seconds, and a timeout (to display an error message otherwise) as 8 seconds.

pose = [-pi/2  0  -pi/2 0.5    0    0.8];
[result,state] = sendCartesianPose(ur,pose,EndTime=7,TimeOut=8);
result = 
   1
state = 'succeeded'

Connect to a physical or simulated cobot, using urRTDEClient object.

ur = urRTDEClient('172.19.98.176');

Command the cobot to by providing the desired Cartesian pose and by specifying the time to reach the pose as 7 seconds.

pose = [-pi/2  0  -pi/2 0.5    0    0.8];
[result,state] = sendCartesianPose(ur,pose,EndTime=7);
result = 
   1
state = 'succeeded'

Command the cobot to by providing the desired Cartesian pose, and by specifying the optional parameters - velocity, acceleration, and blend radius.

pose = [-pi/2  0  -pi/2 0.5    0    0.8];
[result,state] = sendCartesianPoseAndWait(ur, pose,'Acceleration'=1.2, 'Velocity'=1.0,'BlendRadius'=0.05);
result = 
   1
state = 'succeeded'

Input Arguments

collapse all

Connection to physical or simulated cobot from Universal Robots, specified as a urROSNode object, a urROS2Node object, or a urRTDEClient object.

Desired Cartesian pose of the simulated cobot, represented as a 1-by-6 numeric vector, in the form of [thetaz thetay thetax x y z]. The units are radians and seconds respectively for the three axes.

Data Types: numeric

Maximum duration by which the simulated cobot must try to complete the motion to reach the desired cartesian pose, specified in seconds.

Data Types: double

Timeout period for receiving a result message, specified as a scalar in seconds. If the client does not receive a new result message in that time period, an error is displayed.

Minimum value of timeout = endtime + 2 seconds.

Data Types: double

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: [result,state] = sendCartesianPoseAndWait(ur,pose,EndTime=endtime)

Note

These name-value arguments are valid only if this function is used along with the urRTDEClient object, for connecting through RTDE interface.

Acceleration to control trapezoidal speed profile of trajectory.

Example: sendCartesianPoseAndWait(ur,pose,"Acceleration",acceleration)

Note

If you specify 'EndTime' name-value argument, setting the 'Acceleration' value has no impact. This is because the time setting has priority over velocity and acceleration settings.

Velocity to control trapezoidal speed profile of trajectory.

Example: sendCartesianPoseAndWait(ur,pose,"Velocity",velocity)

Note

If you specify 'EndTime' name-value argument, setting the 'Velocity' value has no impact. This is because the time setting has priority over velocity and acceleration settings.

Blend radius for waypoints to pass through, when the cobot does not need to stop.

Example: sendCartesianPoseAndWait(ur,pose,"BlendRadius",blendRadius)

Output Arguments

collapse all

Motion status of simulated cobot from Universal Robots, specified as a logical scalar. result is 1 if state is succeeded.

Data Types: logical

Final goal state of the simulated cobot, returned as one of the following:

  • 'pending' — Goal was received, but has not yet been accepted or rejected.

  • 'active' — Goal was accepted and is running on the server.

  • 'succeeded' — Goal executed successfully.

  • 'preempted' — An action client canceled the goal before it finished executing.

  • 'rejected' — The goal was not accepted after being in the 'pending' state. The action server typically triggers this status.

  • 'aborted' — The goal was aborted before it finished executing. The action server typically aborts a goal.

  • 'recalled' — A client canceled the goal while it was in the 'pending' state.

  • 'lost' — An internal error occurred in the action client.

Data Types: char

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced in R2022a