orc
Class AX12Servo

java.lang.Object
  extended by orc.AX12Servo

public class AX12Servo
extends java.lang.Object


Field Summary
static int BROADCAST_ADDRESS
           
static int ERROR_ANGLE_LIMIT
           
static int ERROR_CHECKSUM
           
static int ERROR_INSTRUCTION
           
static int ERROR_OVERHEAT
           
static int ERROR_OVERLOAD
           
static int ERROR_RANGE
           
static int ERROR_VOLTAGE
           
 boolean verbose
           
 
Constructor Summary
AX12Servo(Orc orc, int id)
           
AX12Servo(Orc orc, int id, double pos0, double val0, double pos1, double val1)
           
 
Method Summary
 void changeServoID(int oldID, int newID)
          This method changes the servo ID from oldID to newID.
 int getId()
           
 AX12Status getStatus()
           
static void main(java.lang.String[] args)
           
 boolean ping()
           
 void remap(double pos0, double val0, double pos1, double val1)
          Remap the angle scale (and possibly enforce clamping.)
 void setGoalDegrees(double deg, double speedfrac, double torquefrac)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

verbose

public boolean verbose

ERROR_INSTRUCTION

public static final int ERROR_INSTRUCTION
See Also:
Constant Field Values

ERROR_OVERLOAD

public static final int ERROR_OVERLOAD
See Also:
Constant Field Values

ERROR_CHECKSUM

public static final int ERROR_CHECKSUM
See Also:
Constant Field Values

ERROR_RANGE

public static final int ERROR_RANGE
See Also:
Constant Field Values

ERROR_OVERHEAT

public static final int ERROR_OVERHEAT
See Also:
Constant Field Values

ERROR_ANGLE_LIMIT

public static final int ERROR_ANGLE_LIMIT
See Also:
Constant Field Values

ERROR_VOLTAGE

public static final int ERROR_VOLTAGE
See Also:
Constant Field Values

BROADCAST_ADDRESS

public static final int BROADCAST_ADDRESS
See Also:
Constant Field Values
Constructor Detail

AX12Servo

public AX12Servo(Orc orc,
                 int id)

AX12Servo

public AX12Servo(Orc orc,
                 int id,
                 double pos0,
                 double val0,
                 double pos1,
                 double val1)
Method Detail

remap

public void remap(double pos0,
                  double val0,
                  double pos1,
                  double val1)
Remap the angle scale (and possibly enforce clamping.)

Parameters:
pos0 - Actual servo position [0,300] corresponding to an input of val0.
val0 - The value which will be mapped to the servo position pos0.
pos1 - Actual servo position [0, 300] corresponding to an input of val1.
val1 - The value which will be mapped to the servo position pos1. Suppose that you wish to define a joint with a range of 30 degrees [0, 30] that will swing between [170, 200] in the servo's native coordinates. You would call (170, 0, 200, 30).

changeServoID

public void changeServoID(int oldID,
                          int newID)
This method changes the servo ID from oldID to newID. It is OK to use this method on bus.

Parameters:
oldID - [0x00, 0xFD]
newID - [0x00, 0xFD]

ping

public boolean ping()

setGoalDegrees

public void setGoalDegrees(double deg,
                           double speedfrac,
                           double torquefrac)
Parameters:
deg - [0, 300]
speedfrac - [0, 1]

getStatus

public AX12Status getStatus()

getId

public int getId()

main

public static void main(java.lang.String[] args)