shady.sim
Interface ShadySimAPI

All Superinterfaces:
ShadyCommonAPI
All Known Subinterfaces:
MemberShadySimAPI
All Known Implementing Classes:
MemberShadySim, ShadySim

public interface ShadySimAPI
extends ShadyCommonAPI

Shady simulator extended API.

A ShadySim by default simulates motions that take time according to the nominal actuator speeds. It can be put into "discrete mode" (see setDiscreteMode(boolean)) so that requested motions happen discretely (i.e. in a single step, without simulating the passage of time). That allows the caller to quickly move things, and also allows the caller to simulate the passage of time.

Copyright (C) 2006 Marsette A. Vona, III

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Author:
Marsette (Marty) A. Vona, III

Field Summary
static java.lang.String cvsid
          CVS id.
 
Fields inherited from interface shady.common.ShadyCommonAPI
CLOSED_STATE, COLLISION, ESTOP, GRIPPER_CLOSE, GRIPPER_OPEN, GRIPPER_OPERATION_TARGET_STATE, IMPLEMENTATION_FAULT, LEFT, LOW_BATTERY, MOTION_LIMIT, OPEN_STATE, OVER_CURRENT, OVER_TEMP, RIGHT, TILT, TIMEOUT, UNALIGNED, UNKNOWN, WOULD_COLLIDE, WOULD_DUEL, WOULD_MOTION_LIMIT, WOULD_TILT
 
Method Summary
 void chargeBattery(double newBatteryLevel)
          Simulate charging the battery.
 double getAccel()
          Get the simulation time acceleration factor.
 boolean getDiscreteMode()
          Check whether this ShadySim is in discrete mode.
 double getShadyTime()
          Get the acceltime in accelseconds relative to an arbitrary epoch.
 void pause()
          Pause this ShadySim.
 void rechargeBattery()
          Convenience method to fully chargeBattery(double).
 void setAccel(double accel)
          Set the simulation time acceleration factor.
 void setDiscreteMode(boolean discreteMode)
          Set whether this ShadySim is in discrete mode.
 void shadySleep(double seconds)
          Sleep the current thread for the requested number of accelseconds.
 void unPause()
          Un-pause() this ShadySim.
 
Methods inherited from interface shady.common.ShadyCommonAPI
beginAccumulatingMotion, closeGripper, closeGripper, closeShade, endAccumulatingMotion, faultName, getAccountingInfo, getAccountingInfo, getBarrelAngle, getBarrelRotationLimit, getCenterToCenterDistance, getClock, getCurrentPower, getFault, getFault, getFaultDetails, getGripperState, getGripperWidth, getGripQuality, getName, getNumActiveActuators, getPose, getPose, getShadeAngle, getShadeOpenAngle, getState, getState, getTotalLength, isAccumulatingMotion, isGripperAligned, isGripperAligned, isGripperClosed, isGripperOpen, isNameSet, isShadeClosed, isShadeOpen, openGripper, openShade, pick, reset, resetAccounting, rotateBarrel, rotateBarrelTo, rotateShade, setName, setPose, setState, setWouldDuelOverride, setWouldTiltOverride, simultaneousMotion, stop
 

Field Detail

cvsid

static final java.lang.String cvsid

CVS id.

See Also:
Constant Field Values
Method Detail

setDiscreteMode

void setDiscreteMode(boolean discreteMode)

Set whether this ShadySim is in discrete mode.

See the class header doc for a description of discrete mode.

Parameters:
discreteMode - true iff this ShadySim should be in discrete mode

getDiscreteMode

boolean getDiscreteMode()

Check whether this ShadySim is in discrete mode.

See the class header doc for a description of discrete mode.

Returns:
true iff this ShadySim is in discrete mode

rechargeBattery

void rechargeBattery()

Convenience method to fully chargeBattery(double).


chargeBattery

void chargeBattery(double newBatteryLevel)

Simulate charging the battery.

Parameters:
newBatteryLevel - the new battery level, in Joules

setAccel

void setAccel(double accel)

Set the simulation time acceleration factor.

A factor of 2.0 means the simulation runs twice as fast as reality would.

Parameters:
accel - the simulation time acceleration factor

getAccel

double getAccel()

Get the simulation time acceleration factor.

Returns:
the simulation time acceleration factor

getShadyTime

double getShadyTime()

Get the acceltime in accelseconds relative to an arbitrary epoch.

Returns:
the acceltime in accelseconds relative to an arbitrary epoch

shadySleep

void shadySleep(double seconds)
                throws java.lang.InterruptedException

Sleep the current thread for the requested number of accelseconds.

Parameters:
seconds - how long to sleep in accelseconds, non-negative
Throws:
java.lang.InterruptedException

pause

void pause()

Pause this ShadySim.

This ShadySim will act like time has stopped until it is unPause()d. Any ongoing non-discrete motions or shadySleep(double)s will stop, and the threads that were blocked for them will remain blocked. Any future non-discrete motions or shadySleep(double)s will not start and the calling threads will block until the pause is removed and the motion completes.


unPause

void unPause()

Un-pause() this ShadySim.