Get current joint configuration from the robot
waits for the next published joint state from the Universal Robots cobot connected through
ROS interface, and returns current joint configuration. If no message is received in 5
seconds, the function displays an error.
allows you to specify a timeout for obtaining the current joint configuration from the
Universal Robots cobot connected through ROS interface. If no message is received within the
specified time, the function displays an error.
Obtain Joint Configuration from Cobot
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 configuration of the cobot.
jointangles = getJointConfiguration(ur);
jointAngles = 1×6 0.0001 -1.9552 1.6748 -2.5979 -0.0001 0.2542
Specify a timeout of 10 seconds while obtaining current joint configuration of the cobot.
jointangles = getJointConfiguration(ur,10);
ur — Connection to Universal Robots cobot
Connection to physical or simulated cobot from Universal Robots, specified as a
timeout — Timeout in seconds
Timeout value by which the joint configuration must be obtained from the simulated cobot, specified in seconds.
jointangles — Current joint configuration
character vector |
Current joint configuration, returned as a 1-by-6 vector of angles in radians.
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Introduced in R2022a