Main Content

getJointVelocity

Get current joint velocities from the robot

Description

jointvelocity=getJointVelocity(ur) waits for the next published joint state from the Universal Robots cobot connected through ROS interface, and returns current joint velocities. If no message is received in 5 seconds, the function displays an error.

example

jointvelocity=getJointVelocity(ur,timeout) allows you to specify a timeout for obtaining the current joint velocities from the Universal Robots cobot connected through ROS interface. If no message is received within the specified time, the function displays an error.

Examples

collapse all

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

ur = universalrobot('192.168.2.112');

Get current joint velocities of the cobot.

jointangles = getJointVelocity(ur);
jointVelocity = 1×6    
10-12 x

   -0.2650    0.3293   -0.1815   -0.2142    0.2368   -0.0602

Specify a timeout of 10 seconds while obtaining current joint configuration of the cobot.

jointangles = getJointVelocity(ur,10);

Input Arguments

collapse all

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

Timeout value by which the joint velocities must be obtained from the simulated cobot, specified in seconds.

Data Types: double

Output Arguments

collapse all

Current joint velocities, returned as a 1-by-6 vector of angular velocity in rad/s (radians per second).

Data Types: double

Extended Capabilities

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

Version History

Introduced in R2022a