Main Content
Read Joint Angles
This section helps you to connect the KINOVA® Gen3 7-DoF Ultralightweight Robot arm to ROS network and read joint angles using MATLAB®.
Execute the following commands in the MATLAB sequentially to read joint angles from the robot. As explained in KINOVA github page, the first part of the ROS topic,
'my_gen3’
might be different based on the robot name set during
the roslaunch
command.
Create subscriber for a ROS topic /my_gen3/joint_states
and receive
the latest message.
jSub = rossubscriber('/my_gen3/joint_states');
jMsg = receive(jSub);
Extract the joint angles from the received data.
angles = int16(jMsg.Position(1:7)'.*180/pi); disp(angles);