Main Content

Read Current Joint Angles from KINOVA Gen3 Robot Arm

This example shows you how to connect to the KINOVA Gen3 7-DoF Ultralightweight Robot arm with Simulink® using Robot Operating System (ROS). This includes ROS message Subscribe block to get feedback from the robot.

Products Required

  • MATLAB®

  • Simulink

  • Robotics System Toolbox™

  • ROS Toolbox™

Hardware Required

KINOVA® Gen3 Robot

Introduction

Robotics System Toolbox Support Package for Manipulators enables you to control manipulators using MATLAB and Simulink. This support package utilizes ROS packages provided by robot manufacturers to acquire various sensor data, simulate robot models, and control the robot. You can prototype algorithms and perform simulations of these robots using rigid body tree models from Robotics System Toolbox™ or Simscape™ Multibody™ robot models. This support package also allows you to connect with the robot hardware to test and validate your algorithms.

In this example, sensor_msgs/JointState ROS message is used to get current joint configuration of Kinova® Gen3 robot.

Prerequisites

Model

Open the manipdemo_getAnglesROS model.

The model consists of a ROS subscriber block which is configured for /my_gen3/joint_states ROS topic. As explained in the Github page of Kinova Robotics, the first part of the ROS topic, 'my_gen3' might be different based on the robot name set during the roslaunch command. The joint angles and gripper position is extracted from the received message and then displayed using Display blocks.

Run the Model

After launching required ROS nodes and connecting to the ROS network, click Simulate on the Simulink toolbar and then click Run. The Display blocks in Simulink displays the current joint angles and gripper position of the robot.