| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectohmm.Grasp
public class Grasp
Arm IK and grasping demo (CS4610 LAB3 and 4 solution).
ikDemo() is the top-level driver for interactive arm IK (LAB3 part
 one).
graspDemo(float, float) is the top-level driver for blind world-fram grasping
 (LAB3 part two).
Many of the component functions are also available for use independently.
| Field Summary | |
|---|---|
| static float | ARM_OFFSETRadial offset in mm from robot frame origin to grip point. | 
| protected  boolean | armEnabledWhether arm is enabled. | 
|  float | dIncrement amount in mm for ikDemo(). | 
| static float | D_INCRDefault increment amount in mm for ikDemo(). | 
| static float | D_MAXIncrement limits in mm for ikDemo(). | 
| static float | D_MINIncrement limits in mm for ikDemo(). | 
| static float | EE_TOLEE position tolerance in mm. | 
|  float | gripGripper state. | 
|  float | gx_rGrip point location in mm in robot frame. | 
|  float | gx_wTarget location in world mm. | 
|  float | gy_wTarget location in world mm. | 
|  float | gz_rGrip point location in mm in robot frame. | 
|  float | gz_wTarget location in world mm. | 
| static float[] | HOMEHome pose joint angles. | 
| static float | HOME_TO_GRIPExtension distance in mm from home to grip. | 
| static float | HOME_TO_GROUNDExtension distance in mm from home to ground. | 
| static float | INTERP_SPEEDEE interpolation speed in mm/sec for interpolateArm(float, float). | 
| static float | L0Arm constants in mm. | 
| static float | L1Arm constants in mm. | 
|  OHMMDrive | ohmmThe OHMMDriveobject. | 
| static float | PIFloat cover of Math constant. | 
| static java.lang.String | RXTX_PORTRXTX port filename. | 
| static float[] | SALUTESalute pose joint angles. | 
| static float[] | STOW_DOWNStow joint angles. | 
| static float[] | STOW_UPStow joint angles. | 
| protected  boolean | stowUpWhether next stow should be in up position. | 
| private static java.lang.String | svnid | 
| static float | SXArm constants in mm. | 
| static float | SZArm constants in mm. | 
| static float | T0_MAXJoint angle limits in rad. | 
| static float | T0_MINJoint angle limits in rad. | 
| static float | T1_MAXJoint angle limits in rad. | 
| static float | T1_MINJoint angle limits in rad. | 
| static float | T2_MAXJoint angle limits in rad. | 
| static float | T2_MINJoint angle limits in rad. | 
|  float[] | thetaArm joint angles in rad. | 
| static float | THETA_TOLJoint angle tolerance in rad. | 
|  float | thetaYawRobot orientation in rad. | 
| static java.lang.String | USAGEUsage message. | 
| static float | WXArm constants in mm. | 
| static float | WZArm constants in mm. | 
|  float[] | xytRobot pose in world frame. | 
| Constructor Summary | |
|---|---|
| Grasp()Inits ohmmonRXTX_PORT. | |
| Grasp(OHMMDrive ohmm)Inits ohmm. | |
| Method Summary | |
|---|---|
| static float | abs(float t)float cover of eponymous Math API | 
|  void | armFK()Covers armFK(boolean), always local. | 
|  void | armFK(boolean local)Update fields from current hardware state. | 
|  boolean | armIK()Covers armIK(boolean), always local. | 
|  boolean | armIK(boolean local)Update joint angle fields from target pose fields. | 
|  void | armWait()Block until arm motion completes. | 
| static float | atan2(float y,
      float x)float cover of eponymous Math API | 
|  void | cal()Similar to home(boolean)but goes to calibration pose. | 
| static float | cos(float t)float cover of eponymous Math API | 
| static int | div(int n,
    int d)float division with rounding | 
|  void | driveWait()Block until drive motion completes. | 
|  void | dumpArm()Dump current thetaandgx_r,gz_r. | 
| static java.lang.String | fmt(float f)format a float | 
| static java.lang.String | fmt(float[] f)covers fmt(float, float, float) | 
| static java.lang.String | fmt(float x,
    float y,
    float z)format three float | 
|  void | graspDemo(float x,
          float y)Runs the grasping demo. | 
|  void | home()Covers home(boolean), always local. | 
|  void | home(boolean local)Home the arm, then armFK(boolean). | 
|  void | ikDemo()Runs the interactive ik demo. | 
|  void | ikHelp()Show interactive help for interactive IK. | 
|  void | init()Disable drive orientation servo, reset hardware odomery, reinit and enable arm hardware, and home(boolean)(global). | 
|  void | interpolateArm(float dx,
               float dz)Interpolate vertical plane arm motion along a line in task space. | 
| static void | main(java.lang.String[] argv)Demo driver, see USAGE. | 
| static float | max(float y,
    float x)float cover of eponymous Math API | 
| static float | min(float y,
    float x)float cover of eponymous Math API | 
|  void | orientAndWait(float toTheta)Yaw robot and wait for motion to finish. | 
| static int | parseInt(java.lang.String s)convienence to parse an int | 
| static void | print(java.lang.String s)convenience to print to System.out | 
| static void | println(java.lang.String s)convenience to print to System.out | 
|  void | salute()Salute the arm, then armFK(boolean). | 
| static float | sign(float t)get float sign | 
| static float | sin(float t)float cover of eponymous Math API | 
| static float | sqrt(float f)float cover of eponymous Math API | 
|  void | stow()Covers stow(boolean), down. | 
|  void | stow(boolean up)Stow the arm, then armFK(boolean). | 
| static float | toDeg(float t)float cover of eponymous Math API | 
| static float | toRad(float t)float cover of eponymous Math API | 
|  void | updateArm()Covers updateArm(boolean, boolean), always local, no spew. | 
|  void | updateArm(boolean spew)Covers updateArm(boolean, boolean), always local. | 
|  void | updateArm(boolean local,
          boolean spew)armIK(boolean)then set arm hardware to the newtheta. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
private static final java.lang.String svnid
public static final java.lang.String USAGE
public static final float PI
public static final java.lang.String RXTX_PORT
public static final float THETA_TOL
public static final float EE_TOL
public static final float INTERP_SPEED
interpolateArm(float, float).
public static final float T0_MIN
public static final float T0_MAX
public static final float T1_MIN
public static final float T1_MAX
public static final float T2_MIN
public static final float T2_MAX
public static final float[] HOME
public static final float[] SALUTE
public static final float[] STOW_UP
public static final float[] STOW_DOWN
public static final float SX
public static final float SZ
public static final float L0
public static final float L1
public static final float WX
public static final float WZ
public static final float D_INCR
ikDemo().
public static final float D_MAX
ikDemo().
public static final float D_MIN
ikDemo().
public static final float HOME_TO_GROUND
public static final float HOME_TO_GRIP
public static final float ARM_OFFSET
public OHMMDrive ohmm
OHMMDrive object.
public float d
ikDemo().
public float thetaYaw
public float[] theta
public float gx_r
public float gz_r
public float gx_w
public float gy_w
public float gz_w
public float[] xyt
public float grip
protected boolean armEnabled
protected boolean stowUp
| Constructor Detail | 
|---|
public Grasp()
      throws java.io.IOException
ohmm on RXTX_PORT.
java.io.IOException
public Grasp(OHMMDrive ohmm)
      throws java.io.IOException
Inits ohmm.
ohmm - an existing OHMMDrive
java.io.IOException| Method Detail | 
|---|
public static void main(java.lang.String[] argv)
                 throws java.io.IOException
USAGE.
java.io.IOExceptionpublic void ikDemo()
public void graspDemo(float x,
                      float y)
x - target x location in world frame mmy - target y location in world frame mmpublic void ikHelp()
Show interactive help for interactive IK.
public void dumpArm()
public void orientAndWait(float toTheta)
Yaw robot and wait for motion to finish.
public void interpolateArm(float dx,
                           float dz)
Interpolate vertical plane arm motion along a line in task space.
dx - change in EE x position in robot frame mmdz - change in EE z position in robot frame mm
 The interpolation starts at the current EE location (gx_r,
 gz_r) in robot frame (updated by a call to armFK(boolean), local
 FK) and proceeds at INTERP_SPEED mm/sec.
public void armWait()
public void driveWait()
public void home(boolean local)
Home the arm, then armFK(boolean).
local - whether to home only the arm joints (local) or also to
 include the robot yaw (global)public void home()
home(boolean), always local.
public void cal()
home(boolean) but goes to calibration pose.
public void stow(boolean up)
Stow the arm, then armFK(boolean).
up - whether to stow in up positionpublic void stow()
stow(boolean), down.
public void salute()
Salute the arm, then armFK(boolean).
public void init()
Disable drive orientation servo, reset hardware odomery, reinit and
 enable arm hardware, and home(boolean) (global).
public void updateArm(boolean local,
                      boolean spew)
armIK(boolean) then set arm hardware to the new theta.
public void updateArm(boolean spew)
updateArm(boolean, boolean), always local.
public void updateArm()
updateArm(boolean, boolean), always local, no spew.
public void armFK(boolean local)
Update fields from current hardware state.
Always updates theta from the hardware, then gx_r,
 gz_r.
Global FK also updates xyt from hardware odometry, then thetaYaw, gx_w, gy_w, gz_w.
local - whether to do local FK, else globalpublic void armFK()
armFK(boolean), always local.
public boolean armIK(boolean local)
Update joint angle fields from target pose fields.
Updatestheta from
 Global IK also updates xyt from hardware odometry, then gx_r, gz_r and thetaYaw.
local - whether to do local IK, else global
public boolean armIK()
armIK(boolean), always local.
public static float toDeg(float t)
public static float toRad(float t)
public static float sqrt(float f)
public static float cos(float t)
public static float sin(float t)
public static float abs(float t)
public static float sign(float t)
public static int div(int n,
                      int d)
public static float atan2(float y,
                          float x)
public static float max(float y,
                        float x)
public static float min(float y,
                        float x)
public static java.lang.String fmt(float f)
public static java.lang.String fmt(float x,
                                   float y,
                                   float z)
public static java.lang.String fmt(float[] f)
fmt(float, float, float)
public static void println(java.lang.String s)
public static void print(java.lang.String s)
public static int parseInt(java.lang.String s)
                    throws java.lang.NumberFormatException
java.lang.NumberFormatException| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||