Dynamixel AX-18A in MATLAB
1. Download RoboPlus
- http://www.robotis.com/xe/1132559
- 561MB
- Installation is straightforward. But it requires some patience..
- Perhaps... we may not need this.
2. Download 'usb2dynamixel'
3. Addpath SDK API in MATLAB
- http://support.robotis.com/ko/software/dynamixel_sdk/usb2dynamixel/windows/matlab.htm
4. Use following codes
%
% DYNAMIXEL AX-18A
%
addpath(genpath('usb2dynamixel'))
clc;
clear;
close all;
%% INITIALIZE
global_vars;
loadlibrary('dynamixel', 'dynamixel.h');
loadlibrary('dynamixel','dxl_matlab.h');
libfunctions('dynamixel');
%% CONNECT
DEFAULT_PORTNUM = 13; % COM PORT ID
DEFAULT_BAUDNUM = 1; % 1Mbps
res = connectDXL(DEFAULT_PORTNUM, DEFAULT_BAUDNUM);
%% DEFAULT SETTING
default_Vel = 100; % 0 for maximum torque
default_Pos = 0;
setVel_all(default_Vel);
setPos_all(default_Pos);
%% SET POSITION
setPos_one(1, 150);
setPos_one(2, 150);
%% DISCONNECT
disconnectDXL();