M-File Help: Arbotix View code for Arbotix

Arbotix

Interface to Arbotix robot controller

Methods

Arbotix Constructor, establishes serial communications
delete Destructor, closes serial connection
getpos Get joint angles
setpos Set joint angles and optionally speed
relax Control relax (zero torque) state
setled Control LEDs on servos
gettemp Temperature of motors
writedata1 Write byte data to servo control table
writedata2 Write word data to servo control table
readdata Read servo control table
command Execute command on servo
flush Flushes serial data buffer

Example

arb=Arbotix('port', '/dev/tty.usbserial-A800JDPN', 'nservos', 5);

Notes


Arbotix.Arbotix

Create Arbotix interface object

dm = Arbotix(options) is an object that represents a connection to a chain of Arbotix servos connected via an Arbotix controller and serial link to the host computer.

Options

'port', P Name of the serial port device, eg. /dev/tty.USB0
'baud', B Set baud rate (default 38400)
'debug', D Debug level, show communications packets (default 0)
'nservos', N Number of servos in the chain

Arbotix.a2e

Convert angle to encoder

E = ARB.A2E(a) is a vector of encoder values E corresponding to the vector of joint angles a.


Arbotix.char

Convert Arbotix status to string

C = ARB.char() is a string that succinctly describes the status of the Arbotix controller link.


Arbotix.command

Execute command on servo

R = ARB.COMMAND(id, instruc) executes the instruction instruc on servo id.

R = ARB.COMMAND(id, instruc, data) as above but the vector data forms the payload of the command message, and all numeric values in data must be in the range 0 to 255.

The optional output argument R is a structure holding the return status.

Notes

See also

Arbotix.receive, Arbotix.flush


Arbotix.delete

Close the serial connection

delete(dm) closes the serial connection and removes the dm object from the workspace.


Arbotix.discover

how many servos in the chain


Arbotix.display

Display parameters

ARB.display() displays the servo parameters in compact single line format.

Notes

See also

Arbotix.char


Arbotix.e2a

Convert encoder to angle

a = ARB.E2A(E) is a vector of joint angles a corresponding to the vector of encoder values E.


Arbotix.flush

Flush the receive buffer

ARB.FLUSH() flushes the serial input buffer, data is discarded.

s = ARB.FLUSH() as above but returns a vector of all bytes flushed from the channel.

Notes

See also

Arbotix.receive, Arbotix.parse


Arbotix.getpos

Get position

p = ARB.GETPOS(id) is the position (0-1023) of servo id.

p = ARB.GETPOS([]) is a vector (1xN) of positions of servos 1 to N.

Notes


Arbotix.gettemp

Get temperature

T = ARB.GETTEMP(id) is the tempeature (deg C) of servo id.

T = ARB.GETTEMP() is a vector (1xN) of the temperature of servos 1 to N.

Notes


Arbotix.parse

Parse Arbotix return strings

ARB.PARSE(s) parses the string returned from the Arbotix controller and prints diagnostic text. The string s contains a mixture of Dynamixel style return packets and diagnostic text.

Notes

See also

Arbotix.flush, Arbotix.command


Arbotix.readdata

Read byte data from servo control table

R = ARB.READDATA(id, addr) reads the successive elements of the servo control table for servo id, starting at address addr. The complete return status in the structure R, and the byte data is a vector in the field 'params'.

Notes

See also

Arbotix.receive, Arbotix.command


Arbotix.receive

Decode Arbotix return packet

R = ARB.RECEIVE() reads and parses the return packet from the Arbotix and returns a structure with the following fields:

id The id of the servo that sent the message
error Error code, 0 means OK
params The returned parameters, can be a vector of byte values

Notes


Arbotix.relax

Control relax state

ARB.RELAX(id) causes the servo id to enter zero-torque (relax state) ARB.RELAX(id, FALSE) causes the servo id to enter position-control mode ARB.RELAX([]) causes servos 1 to N to relax ARB.RELAX() as above ARB.RELAX([], FALSE) causes servos 1 to N to enter position-control mode.

Notes


Arbotix.setled

Set LEDs on servos

ARB.led(id, status) sets the LED on servo id to on or off according to the status (logical).

ARB.led([], status) as above but the LEDs on servos 1 to N are set.

Notes


Arbotix.setpath

Load a path into Arbotix controller

ARB.setpath(jt) stores the path jt (PxN) in the Arbotix controller where P is the number of points on the path and N is the number of robot joints.


Arbotix.setpos

Set position

ARB.SETPOS(id, pos) sets the position (0-1023) of servo id. ARB.SETPOS(id, pos, SPEED) as above but also sets the speed.

ARB.SETPOS(pos) sets the position of servos 1-N to corresponding elements of the vector pos (1xN). ARB.SETPOS(pos, SPEED) as above but also sets the velocity SPEED (1xN).

Notes


Arbotix.setpos_sync

speed are vectors


Arbotix.syncwrite

column per actuator


Arbotix.writedata1

Write byte data to servo control table

ARB.WRITEDATA1(id, addr, data) writes the successive elements of data to the servo control table for servo id, starting at address addr. The values of data must be in the range 0 to 255.

Notes

See also

Arbotix.writedata2, Arbotix.command


Arbotix.writedata2

Write word data to servo control table

ARB.WRITEDATA2(id, addr, data) writes the successive elements of data to the servo control table for servo id, starting at address addr. The values of data must be in the range 0 to 65535.

Notes

See also

Arbotix.writedata1, Arbotix.command


 

© 1990-2014 Peter Corke.