MATLAB IndyDCP client
Indy Toolbox is a set of MATLAB functions for users to interface with Indy Framework 2.0 and control Indy robots. Beneath the top-level directory, there are multiple files and subdirectories:
core : It contains functions and scripts to setup and handle communication with Indy Framework.
simplecommand : Functions to send simple commands to Indy Framework.
Simple commands mostly do not require input parameters and complex feedbacks.
mediumcommand : Functions to send medium commands to Indy Framework.
Medium commands mostly require a few of input parameters and no complex feedbacks.
extendedcommand : Functions to send extended commands to Indy Framework.
Extended commands require very long input parameters such as a list of waypoints or interpolated trajectory.
getcommand : Functions to send request-data commands to Indy Framework.
Users use Get commands to retrieve robot current status such as joint positions and velocities.
example : Sample scripts demonstrate how to use extended commands.
startup_toolbox.m : This script adds all subdirectories above to the MATLAB search path.
The Indy Toolbox is freely available from the Github repository. Installation can be performed by following two steps.
Clone the repository using any Git tool.
Execute the startup_toolbox.m script located in the top-level directory to add the toolbox to your MATLAB path.
The Indy Toolbox operates on computers with MATLAB installed. It is compatible with most of MATLAB versions. Furthermore, the toolbox requires Ethernet connection to IndyCB, which is control box of Indy, in order to transfer commands and robot status. After installation, the Indy Toolbox can be used immediately without any further configuration.
The Indy Toolkit communicates with Indy Framework via an Indy-DCP-based socket connection. Therefore, configuration information for the socket is required and set inside the SetupConnection.m script in the ** folder. Before executing the script, let us look at its content shown in the Code for more details.
- RobotName : Name of Indy model (e.g. NRMK-Indy7 for Indy7 model)
- IPAddress : IP Address of STEP (i.e., control box)
- Port : TCP Port number (6066)
- Connection : This global object will handle socket connection with Indy Framework since this script is executed.
- IndyDCPConnect : Start a connection to IndyDCP server on STEP
1 2 3 4 5 6 7 8 9 10
Stop Socket Connection
In the core folder, there is another script named CleanupConnection.m to terminate connection and clean internal variables. This script should be executed before closing the system.
Call Toolkit Functions
All functions of the Indy Toolkit are separated into four groups: simplecommand, mediumcommand, extendedcommand, and getcommand as explained in the previous section. The functions must be called after connection is established. Each function is implemented in a file with the same name. Users are free to look at and modify the content of the functions.
Before using the Indy Toolkit, be sure the Indy Framework operating in STEP.
By assuming that the robot model is Indy7 and IP address is 192.168.10.10.108 as in the Code, let us setup workspace and socket connection as below.
1 2 3
Call a simple function (e.g. Move to Home position)
Call a medium command (e.g. Move to absolute joint-space target)
1 2 3
Get robot's joint positions and velocities via a getting command
1 2 3
Execute a list of waypoints via an extended command
1 2 3 4 5 6 7 8 9 10 11
Close socket connection
Indy Dedicated TCP/IP Protocol
Indy Dedicated TCI/IP Protocol (Indy DCP) is the main protocol for Indy Toolkit to communicate with Indy Framework. In general, the IndyDCP requires following information to handle the connection. Please refer to IndyDCP protocol for more details about the protocol.
IPAddress : IP Address of STEP
Port : Port number of Indy DCP socket
Robot Name : Reserved name of Indy model. "NRMK-IndyRP" is for IndyRP* and "NRMK-Indy7" is for *Indy7.
Invoke ID : ID of sending requests
To ease users' work, there is a global connection variable in which those settings are maintained during the whole connection time. As a result, users only need to set the information in the SetupConnection.m script and let the system do the rest.
Simple, Medium, and Get Commands
Simple, Medium, and Get commands are the APIs users may try at first to get used to the Indy Toolkit. They are called in the same way as other MATLAB functions. Below list is the APIs and their detail description.
MoveHome.m : Move to pre-defined home position.
MoveZero.m : Move to zero position where all joint angles are zero.
StopSlow.m : Stop robot motion within a short time.
StopEmergency.m : Stop robot motion immediately.
ResetRobot.m : Soft recover robot from emergency events.
SetDirectTeaching.m : Set robot to gravity compensation mode.
FinishDirectTeaching.m : Set robot back to joint-space control mode.
MoveJointTo.m : Move to absolute joint-space position (degree)
MoveJointBy.m : Move to relative joint-space position (degree)
MoveTaskTo.m : Move to absolute 6D-space position (meter, degree)
MoveTaskBy.m : Move to relative 6D-space position (meter, degree)
IsRobotReady.m : Retrieve robot status whether it is ready for operation or not
GetJointPosition.m : Retrieve current joint angles (degree)
GetJointVelocity.m : Retrieve current joint velocities (degree/s)
GetTooltipPosition.m : Retrieve the Tool Center Point (TCP) position with respect to global coordinate (meter, degree)
Currently, the Indy Toolkit provides users with two extended APIs for joint space. The MoveJointWaypoints is for motion through high-level waypoints while the MoveExtendedTrajectory is for low-level interpolated points. The usage of MoveJointWaypoints was described in the previous section. Below example is about MoveExtendedTrajectory.
The Code script demonstrates how to test an algorithm of trajectory interpolation developed in MATLAB on Indy robot. In the example, vel_profile_interpolation is supposed to be a newly developed velocity-profile interpolation. It receives start and goal states including start position and velocity and target velocity and acceleration as input. Then, the vel_profile_interpolation calculates desired positions, velocities, and accelerations at each cycle and stores all data into pd, vd, and ad arrays respectively. Finally, the MoveExtendedTrajectory function is called to send those arrays to Indy Framework for execution.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
Figures below shows experimental results of extended trajectory interpolation on Indy robot. The first figure draws computed trajectory (i.e. positions and velocities) of vel_profile_interpolation while the other figure is a capture of recorded trajectory of the Indy after the MoveExtendedTrajectory is called. The similarity of two figures proves that the MATLAB-based developed trajectory was executed correctly on Indy robot.