getMotionStatus
Description
Examples
Obtain Current Motion Status from Cobot
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;
Get the current motion status of the cobot and the goal state.
[result,state] = getMotionStatus(ur);
Input Arguments
ur
— Connection to Universal Robots cobot
object
Connection to physical or simulated cobot from Universal Robots, specified as a
urROSNode
object or a urROS2Node
object.
Output Arguments
result
— Motion status of Universal Robots cobot
logical scalar | 1
| 0
Motion status of simulated cobot from Universal Robots, specified as a logical
scalar. result
is 1
if
state
is succeeded
.
Data Types: logical
state
— Final goal state
character vector
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
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 (한국어)