Main Content

getMotionStatus

Get current motion status of the robot

Since R2022a

Description

example

[result,state] = getMotionStatus(ur) returns the goal state of the ROS action client connected through ROS interface.

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;

Get the current motion status of the cobot and the goal state.

[result,state] = getMotionStatus(ur);

Input Arguments

collapse all

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

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