|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.yobotics.simulationconstructionset.SimulationConstructionSet
public class SimulationConstructionSet
Title: SimulationConstructionSet
Description: Class for constructing a simulation and for setting many of the configuration options for the simulation. Many of the methods provided by this class provide easy access to features that may be modified directly elsewhere. As a result the documentation provided in this class is of a general nature; for more detailed information see the tutorial or the class in question.
Cameras and Viewports
The simulation construction set provides a camera interface that is both robust and versatile. Cameras can easily be configured to track or follow your robot from any conceivable angle.
The following provides a brief introduction to this functionality. For more detailed information see Camera
and ViewportConfiguration
.
Cameras
Each camera has two main parameters: fix and position. A camera's fix is the point in space at which the camera is looking, while the position is the location of the camera itself. These parameters can be configured at any time for the camera currently selected by the user. This camera is often referred to as the currently active camera and is identified by the red outline which surrounds it.
Cameras may also be configured to track or follow the robot. These two modes are referred to as track and dolly respectively. In track mode the camera remains stationary keeping the robot in view by moving its fix. When in dolly mode the camera's position is modified to keep up with the robot. If both modes are enabled the camera will keep up with the robot while maintaining a constant view. These features function by monitoring a YoVariable for each axis using the change in its value to modify the fix and or position of the camera. The variables used by dolly and track modes are independant and may be changed at any time. Each mode may also be configured with an offset to augment the fix or position with respect to the target. In track mode this offset defaults to zero, keeping the camera's view directly on the target. Dolly mode has a default offset of (2.0,12.0,0.0) without which the camera would be ontop of the robot.
A camera may also be mounted to the robot itself, providing a "robot cam" view. To accomplish this, a camera mount must be created and added to a joint on the robot. Once the mount exists it may be specified by name in a camera configuration. There is no way to mount a camera to the robot without a configuration.While the ability to manipulate the active camera is useful, the true power of this system is the ability to store predefined camera configurations for easy access. Once configured, a camera may be accessed in the GUI via the Viewport drop down menu or added to a ViewportConfiguration. The following are several examples of camera configurations.
CameraConfiguration camera1 = new CameraConfiguration("camera 1");
camera1.setCameraFix(0.0, 0.0, 0.6);
camera1.setCameraPosition(-9.0, 3.0, 0.8);
camera1.setCameraTracking(true, true, true, false);
camera1.setCameraDolly(false, true, true, false);
sim.setupCamera(camera1);
CameraConfiguration camera2 = new CameraConfiguration("camera 2");
camera2.setCameraFix(0.0, 0.0, 0.6);
camera2.setCameraPosition(-9.0, 3.0, 0.15);
camera2.setCameraTracking(true, true, true, false);
camera2.setCameraDolly(true, true, true, false);
camera2.setCameraDollyOffsets(-3.6, 4.0, 0.0);
camera2.setCameraTrackingOffsets(0.0, 0.0, 0.0);
sim.setupCamera(camera2);
CameraConfiguration camera3 = new CameraConfiguration("robot cam");
camera3.setCameraMount("robot cam mount");
sim.setupCamera(camera3);
In the examples above camera 1 is tracking only, camera 2 is tracking and dollying, and camera 3 is mounted to the robot. "sim" is an instance of SimulationConstructionSet
ViewportConfigurations
Once several CameraConfigurations have been created and added to the simulation, a ViewportConfiguration
may be assembled.
ViewportConfigurations allow a set of cameras to be displayed in a single window with each camera assigned to a specific position and size.
Once created, ViewportConfigurations may be selected via the Viewport drop down menu. It is also possible to create a ViewportWindow based on a ViewportConfiguration.
Display Groups
A single simulation can easily involve a large number of variables which the user is interested in displaying. This section provides a general overview of the methods currently implemented to facilitate this.
VarGroups
VarGroups provide a convienent means by which to group and reference YoVariables. A group may be created by providing a list of YoVariable names, regular expressions, or both. By default, a group named "all" containing every simulation variable is created. Once created, a VarGroup may be selected for display from the Configuration drop down menu. VarGroups are also used during the creation of Configurations and while exporting data.
sim.setupVarGroup("kinematics", new String[]{"t"}, new String[]{"q_.*", "qd_.*"});
In the example above, a VarGroup named kinematics is created which contains the YoVariable named "t" along with all YoVariables who's names begin with "q_." or "qd_.".
sim.setupVarGroup("torques", null, new String[]{"t", "tau_.*"});
This example creates a VarGroup named "torques" containing the variable "t" as well as all YoVariables who's names begin with "tau_.". For more information on regular expressions see java.util.regex.Pattern.
GraphGroups
Much like VarGroups, graph groups provide a means to store and reference a set of graphs. GraphGroups are identified by name and contain a list of graphs, each of which may display a maximum of four variables.
At creation, separate GraphConfigurations
can be provided for each graph which allow the configuration of graph min and max values. Once a GraphGroup has been added
to the simulation it may be selected from the configuration drop down menu. Separate GraphWindows similar to ViewportWindows may be creating using a specific GraphGroup, which is often helpful
when screen space is an issue. GraphGroups can be used in conjunction with VarGroups when Configurations are created.
sim.setupGraphGroup("states", new String[][]{{"left_state", "right_state"}, {"t"}, {"q_x", "q_z"}});
sim.setupGraphGroup("joint angles", new String[][]{{"left_state", "right_state"}, {"q_lh"}, {"q_lk"}, {"q_la"}, {"q_rh"}, {"q_rk"}, {"q_ra"}});
sim.setupGraphGroup("joint velocities", new String[][]{{"qd_lh"}, {"qd_lk"}, {"qd_la"}, {"qd_rh"}, {"qd_rk"}, {"qd_ra"}});
Examples two and three create a graph per specified variable.
sim.setupGraphGroup("joint torques", new String[][]{{"tau_lh"}, {"tau_lk"}, {"tau_la"}, {"tau_rh"}, {"tau_rk"}, {"tau_ra"}}, 2);
In example four, each variable has a separate graph, however, these graphs are displayed in two columns. Graphs are placed left to right, top to bottom beginning at the top left corner. A single graph panel can display a maximum of 24 graphs over 4 columns.
EntryBoxGroups
EntryBoxGroups provide an easy means to select between different sets of variables for entry. Once created an EntryBoxGroup may be selected from the Configuration drop down menu and or added to a Configuration directly. Entry boxes appear at the bottom of the main GUI frame and allow the user to modify variable values during simulation. EntryBoxGroups are referenced by their names given at creation. YoVariables may be specified by name or by regular expression when added.
sim.setupEntryBoxGroup("control vars1", new String[]{"t_gain","t_damp","hip_d","hip_hold","hip_gain","hip_damp", "swing_gain_knee","swing_damp_knee", "q_x", "q_y", "q_z"});
sim.setupEntryBoxGroup("control vars1", new String[]{"t_gain","t_damp","hip_d","hip_hold","hip_gain","hip_damp", "swing_gain_knee","swing_damp_knee"}, new String[]{"q_*"});
In the first example, the 11 variables are specified by name. The second example specifies some variables by name as well as including an array of regular expressions to be used in finding additional variables.
Copyright: Copyright (c) 2005
Company: Yobotics, Inc.
Field Summary | |
---|---|
static int |
DEFAULT_INITIAL_BUFFER_SIZE
The default size of the data buffer in record steps. |
static java.lang.String |
rootRegistryName
|
Constructor Summary | |
---|---|
SimulationConstructionSet()
Creates a SimulationConstructionSet with no Robot. |
|
SimulationConstructionSet(boolean showGUI,
int initialBufferSize)
Creates a SimulationConstructionSet with no Robot. |
|
SimulationConstructionSet(Robot robot)
Creates a SimulationConstructionSet with the specified Robot. |
|
SimulationConstructionSet(Robot[] robots)
|
|
SimulationConstructionSet(Robot[] robots,
boolean showGUI)
|
|
SimulationConstructionSet(Robot[] robotArray,
boolean showGUI,
int initialBufferSize)
|
|
SimulationConstructionSet(Robot[] robotArray,
Graphics3DAdapter graphicsAdapter,
int initialBufferSize)
|
|
SimulationConstructionSet(Robot[] robot,
int initialBufferSize)
|
|
SimulationConstructionSet(Robot[] robots,
javax.swing.JApplet jApplet)
Creates a SimulationConstructionSet with the specified Robot. |
|
SimulationConstructionSet(Robot[] robotArray,
SupportedGraphics3DAdapter supportedGraphicsAdapter,
int initialBufferSize)
|
|
SimulationConstructionSet(Robot robot,
boolean showGUI)
Creates a SimulationConstructionSet with the specified Robot and GUI flag. |
|
SimulationConstructionSet(Robot robot,
boolean showGUI,
int initialBufferSize)
Creates a SimulationConstructionSet with the specified Robot and DataBuffer size. |
|
SimulationConstructionSet(Robot robot,
Graphics3DAdapter graphicsAdapter,
int initialBufferSize)
|
|
SimulationConstructionSet(Robot rob,
int initialBufferSize)
Creates a SimulationConstructionSet with the specified Robot and DataBuffer size. |
|
SimulationConstructionSet(Robot robot,
javax.swing.JApplet jApplet)
|
|
SimulationConstructionSet(Simulation simulation,
boolean showGUI)
|
|
SimulationConstructionSet(Simulation simulation,
Graphics3DAdapter graphicsAdapter)
|
Method Summary | |
---|---|
void |
addButton(javax.swing.JButton button)
This function adds the specified button to the SCS GUI. |
void |
addCameraKey()
Makes the current data point a CameraKeyPoint. |
void |
addCheckBox(javax.swing.JCheckBox checkBox)
This function adds the specified button to the SCS GUI. |
GraphicsDynamicGraphicsObject |
addDynamicGraphicObject(DynamicGraphicObject dynamicGraphicObject)
|
GraphicsDynamicGraphicsObject |
addDynamicGraphicObject(DynamicGraphicObject dynamicGraphicObject,
boolean updateFromSimulationThread)
|
void |
addDynamicGraphicObjectListRegistries(DynamicGraphicObjectsListRegistry dynamicGraphicObjectsListRegistry)
|
void |
addExtraJpanel(java.awt.Component extraPanel,
java.lang.String name)
|
void |
addJLable(javax.swing.JLabel label)
|
void |
addKeyPoint()
Makes the current data point a KeyPoint. |
void |
addMenuBar(javax.swing.JMenuBar menuBar)
This function adds the specified button to the SCS GUI. |
void |
addRadioButton(javax.swing.JRadioButton button)
This function adds the specified button to the SCS GUI. |
void |
addScript(Script script)
Add the specified script to this simulation. |
void |
addSimulateDoneListener(SimulationDoneListener listener)
Add a simulate done listener to the simulation. |
void |
addStaticLink(Link staticLink)
Adds a static Link to the display environment. |
void |
addStaticLinkGraphics(java.util.ArrayList<Graphics3DObject> staticLinkGraphics)
|
Graphics3DNode |
addStaticLinkGraphics(Graphics3DObject staticLinkGraphics)
|
Graphics3DNode |
addStaticLinkGraphics(Graphics3DObject staticLinkGraphics,
Graphics3DNodeType nodeType)
Adds a static LinkGraphics to the display environment. |
void |
addVarList(VarList newVarList)
Adds all of the YoVariables contained in the specified VarList to the simulation. |
void |
addVarLists(java.util.ArrayList<VarList> newVarLists)
Adds all of the YoVariables contained in the provided ArrayList of VarLists to the simulation. |
void |
addVarLists(VarList[] newVarLists)
Adds all of the YoVariables contained in the provided list of VarLists to the simulation. |
void |
addYoVariableRegistry(YoVariableRegistry registry)
|
RobotSocketConnection |
allowTCPConnectionToHost(java.lang.String HOST)
|
RobotSocketConnection |
allowTCPConnectionToHost(java.lang.String HOST,
java.util.ArrayList<NewDataListener> newDataListeners)
Creates a SCSRobotGUICommandListener which communicates to a robot at the specified ethernet HOST address. |
RobotSocketConnection |
allowTCPConnectionToHost(java.lang.String HOST,
NewDataListener newDataListener)
|
void |
applyDataProcessingFunction(DataProcessingFunction dataProcessingFunction)
Applies a function to the recorded data starting from the in point to the out point. |
void |
attachExitActionListener(ExitActionListener listener)
Add another ExitActionListener to the set which is triggered by closing the simulation environment GUI. |
void |
attachPlaybackListener(PlaybackListener playbackListener)
Attaches the specified PlaybackListener to the simulation. |
void |
attachSelectedListener(SelectedListener selectedListener)
Adds the specified SelectedListener. |
void |
attachSimulationRewoundListener(SimulationRewoundListener simulationRewoundListener)
Adds the specified SimulationRewoundListener. |
void |
bringToFront()
|
void |
changeBufferSize(int bufferSize)
Either increase or decrease the data buffer's size in units of ticks. |
void |
closeAndDispose()
|
void |
createMovie(java.io.File movieFile)
|
java.io.File |
createMovie(java.lang.String movieFilename)
|
void |
createNewGraphWindow()
|
void |
createNewGraphWindow(java.lang.String graphGroupName)
Creates a new window containing the specified graph group. |
void |
createNewGraphWindow(java.lang.String graphGroupName,
int screenID,
boolean maximizeWindow)
Creates a new window containing the specified graph group. |
ViewportWindow |
createNewViewportWindow()
|
ViewportWindow |
createNewViewportWindow(java.lang.String viewportName)
Creates a new window containing the specified viewport configuration. |
ViewportWindow |
createNewViewportWindow(java.lang.String viewportName,
int screenID,
boolean maximizeWindow)
Creates a new window containing the specified viewport configuration. |
void |
cropBuffer()
Crops the data buffer to the current in and out points. |
void |
disableGUIComponents()
If the GUI exists, stop whatever it is doing and disable user actions. |
void |
doControl()
Calls the doControl() method of the robots contained in the underlying Simulator. |
void |
doDynamicsAndIntegrate()
Does the dynamics and integrates the state equations for all the robots contained in the underlying Simulator. |
void |
enableGUIComponents()
If the GUI exists, enable user actions. |
void |
exportRobotDefinition(Robot robot,
java.io.File chosenFile)
|
void |
exportSnapshot(java.io.File snapshotFile)
Exports a snapshot from the currently active view. |
void |
exportSnapshot(java.io.File snapshotFile,
CaptureDevice captureDevice)
|
void |
exportSnapshot(java.io.File snapshotFile,
ViewportWindow viewportSelector)
Exports a snapshot from the passed viewportSelector. |
java.awt.image.BufferedImage |
exportSnapshotAsBufferedImage()
|
java.awt.image.BufferedImage |
exportSnapshotAsBufferedImage(CaptureDevice captureDevice)
|
static SimulationConstructionSet |
generateSimulationFromDataFile(java.io.File chosenFile)
|
java.util.ArrayList<YoVariable> |
getAllVariables()
Returns all the YoVariables in this YoVariableHolder |
YoVariable[] |
getAllVariablesArray()
Returns all the YoVariables in this YoVariableHolder |
DataBuffer |
getDataBuffer()
Accessor method for the data buffer used by this simulation. |
double |
getDT()
Get the simulation step size in seconds. |
DynamicGraphicMenuManager |
getDynamicGraphicMenuManager()
|
Graphics3DAdapter |
getGraphics3dAdapter()
|
int |
getIndex()
Get the current simulation index (tick). |
int |
getInPoint()
|
javax.swing.JFrame |
getJFrame()
Retrieve the frame of this SimulationConstructionSet. |
int |
getOutPoint()
|
double |
getPlaybackFrameRate()
Retrive the playback frame rate in seconds per frame. |
double |
getPlaybackRealTimeRate()
Retrieve the current real time rate which is the percentage of real time the simulator is displaying. |
double |
getRecordFreq()
Gets the Record Frequency for the simulation. |
Robot[] |
getRobots()
Retrieves the Robots used in this simulation. |
YoVariableRegistry |
getRootRegistry()
|
java.lang.String |
getRunningName()
|
double |
getSimulateDuration()
|
StandardSimulationGUI |
getStandardSimulationGUI()
|
long |
getTicksPerPlayCycle()
|
double |
getTime()
|
YoVariable |
getVariable(java.lang.String varname)
Deprecated. |
YoVariable |
getVariable(java.lang.String nameSpace,
java.lang.String varname)
Gets a YoVariable with the given nameSpace and name if it is in this YoVariableHolder, otherwise returns null. |
java.util.ArrayList<YoVariable> |
getVariables(NameSpace nameSpace)
Returns all the YoVariables with the given nameSpace that are in this YoVariableHolder, empty if there are none. |
java.util.ArrayList<YoVariable> |
getVariables(java.lang.String varname)
Returns all the YoVariables with the given name that are in this YoVariableHolder, empty if there are none. |
java.util.ArrayList<YoVariable> |
getVariables(java.lang.String nameSpace,
java.lang.String varname)
Returns all the YoVariables with the given nameSpace and name that are in this YoVariableHolder, empty if there are none. |
java.util.ArrayList<YoVariable> |
getVariablesThatContain(java.lang.String searchString)
Retrieves an ArrayList containing the YoVariables with names that contain searchString. |
java.util.ArrayList<YoVariable> |
getVariablesThatContain(java.lang.String searchString,
boolean caseSensitive)
Retrieves an ArrayList containing the YoVariables whos names contain the search string. |
java.util.ArrayList<YoVariable> |
getVariablesThatStartWith(java.lang.String searchString)
Retrieves an ArrayList containing the YoVariables with names that start with the searchString. |
java.util.ArrayList<YoVariable> |
getVars(java.lang.String[] varNames,
java.lang.String[] regularExpressions)
Given an array of YoVariable names and an array of regular expressions this function returns an ArrayList of the YoVariables whos name's fit the regular expression. |
static java.lang.String |
getVersion()
|
void |
gotoInPoint()
Move the current data point to inPoint. |
void |
gotoInPointNow()
Causes execution to continue from the inPoint. |
void |
gotoOutPoint()
Moves the current data point to the outPoint. |
void |
gotoOutPointNow()
|
boolean |
hasUniqueVariable(java.lang.String varname)
Checks if this YoVariableHolder holds exactly one YoVariable with the given name. |
boolean |
hasUniqueVariable(java.lang.String nameSpace,
java.lang.String varname)
Checks if this YoVariableHolder holds exactly one YoVariable with the given nameSpace and name. |
void |
hideAllDynamicGraphicObjects()
|
void |
hideViewport()
Hides the main viewport integrated into the SCS GUI. |
boolean |
isGraphsUpdatedDuringPlayback()
Check to see if graph updates are enabled during playback. |
boolean |
isIndexBetweenInAndOutPoint(int indexToCheck)
|
boolean |
isKeyPointModeToggled()
Indicates whether or not KeyPoints are in use. |
boolean |
isSimulating()
|
boolean |
isSimulationThreadUpAndRunning()
|
java.lang.Boolean |
isViewportHidden()
|
static void |
main(java.lang.String[] args)
|
void |
maximizeMainWindow()
Maximizes the primary SCS window in both the x and y directions. |
void |
nextCameraKey()
Removes the CameraKeyPoint at the current data point. |
void |
notifyExitActionListeners()
|
void |
packBuffer()
Packs the data buffer based on the current inPoint. |
void |
play()
This method causes the GUI to enter play mode assuming it is not already in run (simulate) mode. |
void |
previousCameraKey()
Removes the CameraKeyPoint at the current data point. |
void |
readData(java.io.File chosenFile)
Import simulation data from the specified file. |
void |
readData(java.lang.String filename)
Import simulation data from the file at the specified path. |
void |
readData(java.net.URL url)
Import simulation data from the file at the specified URL. |
void |
readState(java.io.File chosenFile)
Read in the variable states specified in the provided file. |
void |
readState(java.lang.String filename)
Read in the variable states specified by the file at the provided path. |
void |
recomputeTiming()
This method recomputes the internal timing related parameters. |
void |
registerCollisionGroup(CollisionGroup group)
Registers the specified collision group with the simulation. |
void |
registerCollisionGroups(java.util.ArrayList<CollisionGroup> groups)
Registers each ccollision group contained in the provided ArrayList with the simulation. |
void |
registerToggleKeyPointModeCommandListener(ToggleKeyPointModeCommandListener listener)
|
void |
removeCameraKey()
Removes the CameraKeyPoint at the current data point. |
void |
removeGraphics3dNode(Graphics3DNode nodeToRemove)
|
void |
removeSimulateDoneListener(SimulationDoneListener listener)
Removes the specified SimulateDoneListener. |
void |
run()
Function to run both the simulation and playback of the data. |
java.util.Vector<java.io.File> |
saveSimulationAsSequenceOfImages(java.lang.String path,
java.lang.String NameNoExtension,
CaptureDevice captureDevice)
|
void |
selectCamera(java.lang.String cameraName)
Makes the specified camera active in the active view. |
void |
selectConfiguration(java.lang.String name)
Makes the specified configuration active. |
void |
selectViewport(java.lang.String viewportName)
Activate the specified viewport configuration in the primary viewport panel. |
void |
setBackgroundColor(java.awt.Color color)
Set the specified background color |
void |
setBackgroundColor(javax.vecmath.Color3f color)
Set the specified background color |
void |
setBackgroundImage(java.net.URL fileURL)
Set the specified background image |
void |
setBackgroundImage(java.net.URL fileURL,
Graphics3DBackgroundScaleMode backgroundScaleMode)
Set the specified background image |
void |
setCameraDolly(boolean dolly,
boolean dollyX,
boolean dollyY,
boolean dollyZ)
This function modifies the camera dolly state for the selected viewport. |
void |
setCameraDollyOffsets(double dx,
double dy,
double dz)
Configures the offset at which the active camera follows the target. |
void |
setCameraDollyVars(java.lang.String xName,
java.lang.String yName,
java.lang.String zName)
Sets the camera dolly variables for the active viewport. |
void |
setCameraFix(double fixX,
double fixY,
double fixZ)
Modify the active camera's fix. |
void |
setCameraPosition(double posX,
double posY,
double posZ)
Modifies the position at which the currently active camera is located. |
void |
setCameraTracking(boolean track,
boolean trackX,
boolean trackY,
boolean trackZ)
This function modifies the camera tracking state for the selected viewport. |
void |
setCameraTrackingOffsets(double dx,
double dy,
double dz)
Configures the offsets for tracking on the active camera. |
void |
setCameraTrackingVars(java.lang.String xName,
java.lang.String yName,
java.lang.String zName)
Sets the camera tracking variables for the active viewport. |
void |
setClipDistances(double near,
double far)
Configure the clip distances for the currently active view. |
void |
setDT(double simulateDT,
int recordFrequency)
Sets the simulation step size and the frequency to record data. |
void |
setDynamicGraphicMenuManager(DynamicGraphicMenuManager dynamicGraphicMenuManager)
|
void |
setDynamicGraphicObjectsListVisible(java.lang.String name,
boolean visible)
|
void |
setExportDataDirectory(java.lang.String directory)
Specifies the directory to which data will be exported. |
void |
setFastSimulate(boolean fastSimulate)
When enabled fastSimulate causes the graphs to update less frequently improving simulation performance. |
void |
setFieldOfView(double fieldOfView)
Specifies the horizontal field of view in radians for the currently active view. |
void |
setFrameAlwaysOnTop(boolean alwaysOnTop)
Specify if the frame should be "always on top" preventing it from being hidden behind other windows. |
void |
setFrameLocation(int x,
int y)
Move the upper left corner of the frame to the specified x & y coordinates. |
void |
setFrameMaximized()
Maximize the frame in both the horizontal and vertical directions. |
void |
setFrameSize(java.awt.Dimension dimension)
Set the frame's size to the specified dimension. |
void |
setGraphsUpdatedDuringPlayback(boolean updateGraphs)
Enables or disables graph updates during playback. |
void |
setGroundAppearance(AppearanceDefinition app)
Apply the specified appearance to the ground. |
void |
setGroundVisible(boolean isVisible)
Sets the ground visibility. |
void |
setImportDataDirectory(java.lang.String directory)
Specifies the directory from which data will be imported. |
void |
setIndex(int index)
|
void |
setIndexButDoNotNotifySimulationRewoundListeners(int index)
|
void |
setInPoint()
Makes the current data point the in point. |
void |
setMaxBufferSize(int maxBufferSize)
Sets the maximum size, in ticks, to which the buffer will expand. |
void |
setOutPoint()
Makes the current data point the out point. |
void |
setPlaybackDesiredFrameRate(double frameRate)
Sets the desired playback frame rate in seconds per frame. |
void |
setPlaybackRealTimeRate(double realTimeRate)
Sets the realTimeRate. |
void |
setRecordDT(double recordDT)
The time in seconds between each recorded data point. |
void |
setRobot(Robot robot)
Set the robot to be used by this simulation. |
void |
setRunName(java.lang.String name)
|
void |
setSimulateDoneCriterion(SimulationDoneCriterion criterion)
Sets the criterion for simulation completion. |
void |
setSimulateDuration(double simulateDurationInSeconds)
|
boolean |
setTick(int tick)
|
void |
setTime(double time)
|
void |
setupCamera(CameraConfiguration cameraConfiguration)
Adds the specified camera configuration to the simulation. |
void |
setupConfiguration(java.lang.String config,
java.lang.String varGroupName,
java.lang.String graphGroupName,
java.lang.String entryBoxGroupName)
Creates a configuration which associates a varGroup, graphGroup and entryBoxGroup so that they may be easily activated simultaniously. |
void |
setupEntryBox(java.lang.String varname)
Adds an entry box for the specified variable. |
void |
setupEntryBox(java.lang.String[] varnames)
Adds a set of entry boxes, one for each variable name provided, assuming the GUI is present. |
void |
setupEntryBoxGroup(java.lang.String name,
java.lang.String[] vars)
Creates a grouping of entry boxes using the provided YoVariable names. |
void |
setupEntryBoxGroup(java.lang.String name,
java.lang.String[] vars,
java.lang.String[] regularExpressions)
Creates a grouping of entry boxes using the provided YoVariable names and any YoVariables that match the specified regular expressions. |
void |
setupExtraPanel(ExtraPanelConfiguration panelConfiguration)
|
void |
setupGraph(java.lang.String varname)
Adds a graph for the specified variable, assuming the GUI and the variable exist. |
void |
setupGraph(java.lang.String[] varnames)
Adds a single graph displaying each variable named in the array, assuming the GUI and variable exist. |
void |
setupGraphConfigurations(GraphConfiguration[] configurations)
Store the specified array of GraphConfigurations. |
void |
setupGraphGroup(java.lang.String name,
java.lang.String[][] vars)
Creates a new group of graphs with the given name containing the given variables. |
void |
setupGraphGroup(java.lang.String name,
java.lang.String[][][] vars)
Creates a new group of graphs with the given name containing the given variables using the specified configuration. |
void |
setupGraphGroup(java.lang.String name,
java.lang.String[][][] vars,
int numColumns)
Creates a new group of graphs with the given name containing the given variables using the specified configuration and number of columns. |
void |
setupGraphGroup(java.lang.String name,
java.lang.String[][] vars,
int numColumns)
Creates a new group of graphs with the given name containing the given variables spread over the specified number of columns. |
void |
setupVarGroup(java.lang.String name,
java.lang.String[] vars)
Creates a new group with the given name contaning the variables specified in the array. |
void |
setupVarGroup(java.lang.String name,
java.lang.String[] vars,
java.lang.String[] regularExpressions)
Creates a new VarGroup with the specified name, containing the specified variables and regular expressions. |
void |
setupViewport(ViewportConfiguration viewportConfiguration)
Adds the specified ViewportConfiguration to the simulation. |
void |
setWrapBuffer(boolean wrap)
Specify whether or not the buffer should wrap once the end is reached. |
void |
showViewport()
Shows the main viewport integrated into the SCS GUI. |
void |
simulate()
Begin simulation mode, unless playback mode is currently enabled. |
void |
simulate(double simulationTime)
Simulates for the specified time duration in seconds. |
void |
simulate(int numTicks)
Simulates the specified number of steps. |
void |
simulateOneRecordStep()
This triggers the simulation of a single record step which is usually several simulation steps. |
void |
simulateOneRecordStepNow()
Immediately simulates a record step, records the data point, and updates the graphs. |
void |
simulateOneTimeStep()
Triggers a single simulation step. |
void |
startOnAThread()
|
void |
startStreamingVideoData(CameraConfiguration cameraConfiguration,
int width,
int height,
VideoDataServer videoDataServer,
TimestampProvider timestampProvider,
int framesPerSecond)
|
void |
stepBackward()
Step backward one tick. |
void |
stepBackward(int steps)
Step backward the specified number of ticks. |
void |
stepBackwardNow()
Immediately step backward one tick. |
void |
stepForward()
Step forward one tick. |
void |
stepForward(int steps)
Step forward the specified number of ticks. |
void |
stepForwardNow(int steps)
Immediately step forward the specified number of ticks. |
void |
stop()
This function halts playback and simulation along with any playbackListeners that are enabled. |
void |
stopSimulationThread()
Causes the simulation thread to break if it exists. |
boolean |
tick()
Triggers a tick to the next display cycle. |
boolean |
tick(int ticks)
|
void |
tickAndUpdate()
Increments the data buffer index and updates all of the entries min & max values. |
void |
tickAndUpdateLeisurely(int leisureRate)
Increments the data buffer index and updates all of the min and max values for each entry. |
boolean |
tickButDoNotNotifySimulationRewoundListeners(int ticks)
|
void |
toggleCameraKeyMode()
Toggle between enabling and disabling the use of CameraKeyPoints. |
void |
toggleKeyPointMode()
Toggle between enabling and disabling the use of KeyPoints. |
boolean |
unTick()
|
boolean |
updateAndTick()
This method updates the min and max values for each entry in the data buffer. |
void |
updateState()
Updates the state of the robots contained in the underlying Simulator. |
void |
writeData(java.util.ArrayList<YoVariable> vars,
boolean binary,
boolean compress,
java.io.File chosenFile)
Stores the data for the specified list of YoVariables. |
void |
writeData(java.io.File chosenFile)
Writes the data recorded by the simulation to the specified file. |
void |
writeData(java.lang.String filename)
Writes the data recorded by the simulation to a file with the provided path. |
void |
writeData(java.lang.String varGroupName,
boolean binary,
boolean compress,
java.io.File chosenFile)
Stores the data for the specified varGroup. |
void |
writeData(java.lang.String varGroup,
boolean binary,
boolean compress,
java.lang.String filename)
Stores the data for the specified varGroup. |
void |
writeSpreadsheetFormattedData(java.lang.String varGroupName,
java.io.File chosenFile)
Stores simulation data from the specified varGroup in the given File. |
void |
writeSpreadsheetFormattedState(java.lang.String varGroupName,
java.io.File chosenFile)
Stores the current state of all variables contained in the specified varGroup to the file given by the specified path. |
void |
writeState(java.io.File chosenFile)
Stores the current state of all variables to the chosen file. |
void |
writeState(java.lang.String filename)
Stores the current state of all variables to the file given by the specified path. |
void |
writeState(java.lang.String varGroupName,
boolean binary,
boolean compress,
java.io.File chosenFile)
Stores the current state of all variables contained in the specified varGroup to the file given by the specified path. |
void |
writeState(java.lang.String varGroup,
boolean binary,
boolean compress,
java.lang.String filename)
Stores the current state of all variables contained in the specified varGroup to the file given by the specified path. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_INITIAL_BUFFER_SIZE
public static final java.lang.String rootRegistryName
Constructor Detail |
---|
public SimulationConstructionSet(Robot robot)
rob
- Robot to simulate.public SimulationConstructionSet(Robot[] robots)
public SimulationConstructionSet(Robot rob, int initialBufferSize)
rob
- Robot to simulate.initialBufferSize
- Initial size of the DataBuffer.public SimulationConstructionSet(Robot[] robot, int initialBufferSize)
public SimulationConstructionSet(Robot robot, boolean showGUI)
rob
- Robot to simulate.showGUI
- boolean specifying whether or not to display the GUI.public SimulationConstructionSet(Robot[] robots, boolean showGUI)
public SimulationConstructionSet(boolean showGUI, int initialBufferSize)
showGUI
- boolean specifying whether or not to display the GUI.initialBufferSize
- Initial size of the DataBuffer.public SimulationConstructionSet()
public SimulationConstructionSet(Robot robot, boolean showGUI, int initialBufferSize)
rob
- Robot to simulate.showGUI
- boolean specifying whether or not to display the GUI.initialBufferSize
- Initial size of the DataBuffer.public SimulationConstructionSet(Robot[] robotArray, boolean showGUI, int initialBufferSize)
public SimulationConstructionSet(Robot robot, Graphics3DAdapter graphicsAdapter, int initialBufferSize)
public SimulationConstructionSet(Robot[] robotArray, Graphics3DAdapter graphicsAdapter, int initialBufferSize)
public SimulationConstructionSet(Robot[] robotArray, SupportedGraphics3DAdapter supportedGraphicsAdapter, int initialBufferSize)
public SimulationConstructionSet(Simulation simulation, boolean showGUI)
public SimulationConstructionSet(Simulation simulation, Graphics3DAdapter graphicsAdapter)
public SimulationConstructionSet(Robot robot, javax.swing.JApplet jApplet)
public SimulationConstructionSet(Robot[] robots, javax.swing.JApplet jApplet)
rob
- Robot to simulate.jApplet
- JApplet to display the GUI in.Method Detail |
---|
public static SimulationConstructionSet generateSimulationFromDataFile(java.io.File chosenFile)
public double getDT()
public int getIndex()
getIndex
in interface DataBufferCommandsExecutor
public boolean isIndexBetweenInAndOutPoint(int indexToCheck)
isIndexBetweenInAndOutPoint
in interface DataBufferCommandsExecutor
public void setDT(double simulateDT, int recordFrequency)
simulateDT
- Simulation step size in seconds.recordFrequency
- Rate to record data in simulation step per recordspublic Robot[] getRobots()
public StandardSimulationGUI getStandardSimulationGUI()
public void addScript(Script script)
script
- Script to be addedScript
public void setFrameSize(java.awt.Dimension dimension)
dimension
- Dimension to which the frame is resized.public void setFrameLocation(int x, int y)
x
- Coordinate on the x axisy
- Coordinate on the y axispublic void setFrameMaximized()
public javax.swing.JFrame getJFrame()
public void setFrameAlwaysOnTop(boolean alwaysOnTop)
alwaysOnTop
- boolean specifying if the frame is always on top.public YoVariableRegistry getRootRegistry()
public void addYoVariableRegistry(YoVariableRegistry registry)
public java.util.ArrayList<YoVariable> getAllVariables()
YoVariableHolder
getAllVariables
in interface YoVariableHolder
public YoVariable[] getAllVariablesArray()
YoVariableHolder
getAllVariablesArray
in interface YoVariableHolder
@Deprecated public YoVariable getVariable(java.lang.String varname)
YoVariableHolder
getVariable
in interface YoVariableHolder
varname
- String Name of YoVariable to get. If contains a ".", then YoVariable's nameSpace ending must match that of name.
public YoVariable getVariable(java.lang.String nameSpace, java.lang.String varname)
YoVariableHolder
getVariable
in interface YoVariableHolder
nameSpace
- String nameSpaceEnding ending of YoVariable to get. The YoVariable's nameSpace ending must match that of nameSpace.varname
- String Name of YoVariable to get. If contains a ".", then throws a RuntimeException.
public java.util.ArrayList<YoVariable> getVariables(java.lang.String nameSpace, java.lang.String varname)
YoVariableHolder
getVariables
in interface YoVariableHolder
nameSpace
- String NameSpace ending of YoVariables to get. The YoVariable's nameSpace ending must match that of nameSpace.varname
- String Name of YoVariable to get. If contains a ".", then throws a RuntimeException.
public java.util.ArrayList<YoVariable> getVariables(java.lang.String varname)
YoVariableHolder
getVariables
in interface YoVariableHolder
varname
- String Name of YoVariable to get. If name contains a ".", then the YoVariable's nameSpace ending must match that of name.
public java.util.ArrayList<YoVariable> getVariables(NameSpace nameSpace)
YoVariableHolder
getVariables
in interface YoVariableHolder
nameSpace
- NameSpace to match.
public boolean hasUniqueVariable(java.lang.String varname)
YoVariableHolder
hasUniqueVariable
in interface YoVariableHolder
varname
- String Name of YoVariable to check for. If contains a ".", then YoVariable's nameSpace ending must match that of name.
public boolean hasUniqueVariable(java.lang.String nameSpace, java.lang.String varname)
YoVariableHolder
hasUniqueVariable
in interface YoVariableHolder
nameSpace
- String NameSpace ending of YoVariable to check for. The YoVariable's nameSpace ending must match that of nameSpace.varname
- String Name of YoVariable to check for. If contains a ".", then throws a RuntimeException.
public java.util.ArrayList<YoVariable> getVariablesThatContain(java.lang.String searchString, boolean caseSensitive)
searchString
- String for which YoVariable names are checked.caseSensitive
- Indicates if the search is to be case sensitive.
public java.util.ArrayList<YoVariable> getVariablesThatContain(java.lang.String searchString)
searchString
- String for which YoVariable names are checked.
public java.util.ArrayList<YoVariable> getVariablesThatStartWith(java.lang.String searchString)
searchString
- String for which YoVariable names are checked.
public java.util.ArrayList<YoVariable> getVars(java.lang.String[] varNames, java.lang.String[] regularExpressions)
varNames
- String array of the name of YoVariables to be checked.regularExpressions
- String array of regular expressions to use.
public void setRecordDT(double recordDT)
recordDT
- The new period, in seconds, between recorded data points.public double getRecordFreq()
public void setPlaybackRealTimeRate(double realTimeRate)
setPlaybackRealTimeRate
in interface RunCommandsExecutor
realTimeRate
- The desired playback rate in percentage of real time where 100% is specified as 1.0.public void setPlaybackDesiredFrameRate(double frameRate)
frameRate
- The new frame rate in seconds per frame.public double getPlaybackRealTimeRate()
getPlaybackRealTimeRate
in interface RunCommandsExecutor
public double getPlaybackFrameRate()
public void recomputeTiming()
public long getTicksPerPlayCycle()
public void addStaticLink(Link staticLink)
staticLink
- The Link to be added staticly to the environment.public Graphics3DNode addStaticLinkGraphics(Graphics3DObject staticLinkGraphics)
public Graphics3DNode addStaticLinkGraphics(Graphics3DObject staticLinkGraphics, Graphics3DNodeType nodeType)
staticLinkGraphics
- The LinkGraphics to be added statically to the environment.public void removeGraphics3dNode(Graphics3DNode nodeToRemove)
public void addStaticLinkGraphics(java.util.ArrayList<Graphics3DObject> staticLinkGraphics)
public GraphicsDynamicGraphicsObject addDynamicGraphicObject(DynamicGraphicObject dynamicGraphicObject)
public GraphicsDynamicGraphicsObject addDynamicGraphicObject(DynamicGraphicObject dynamicGraphicObject, boolean updateFromSimulationThread)
public void setCameraTracking(boolean track, boolean trackX, boolean trackY, boolean trackZ)
track
- Enable or disable tracking for this camera.trackX
- Enable or disable tracking in the x direction.trackY
- Enable or disable tracking in the y direction.trackZ
- Enable or disable tracking in the z direction.Camera.setTracking
public void setCameraDolly(boolean dolly, boolean dollyX, boolean dollyY, boolean dollyZ)
dolly
- Enable or disable dolly for this camera.dollyX
- Enable or disable dolly in the x direction.dollyY
- Enable or disable dolly in the y direction.dollyZ
- Enable or disable dolly in the z direction.Camera.setDolly
public void setCameraTrackingVars(java.lang.String xName, java.lang.String yName, java.lang.String zName)
xName
- Name of the YoVariable to be referenced for x direction tracking.yName
- Name of the YoVariable to be referenced for y direction tracking.zName
- Name of the YoVariable to be referenced for z direction tracking.Camera.setTrackingVars
public void setCameraDollyVars(java.lang.String xName, java.lang.String yName, java.lang.String zName)
xName
- Name of the YoVariable to be referenced for x direction following.yName
- Name of the YoVariable to be referenced for y direction following.zName
- Name of the YoVariable to be referenced for z direction following.Camera.setDollyVars
public void setCameraTrackingOffsets(double dx, double dy, double dz)
dx
- Offset in the x direction from the target.dy
- Offset in the y direction from the target.dz
- Offset in the z direction from the target.Camera.setTrackingOffsets
,
setCameraTrackingVars
public void setCameraDollyOffsets(double dx, double dy, double dz)
dx
- Offset in the x direction from the target.dy
- Offset in the y direction from the target.dz
- Offset in the z direction from the target.Camera.setDollyOffsets
,
setCameraDollyVars
public void setCameraFix(double fixX, double fixY, double fixZ)
fixX
- X coordinate of the fix point.fixY
- Y coordinate of the fix point.fixZ
- Z coordinate of the fix point.Camera.setFixPosition
public void setCameraPosition(double posX, double posY, double posZ)
posX
- X coordinate of the camera.posY
- Y coordinate of the camera.posZ
- Z coordinate of the camera.public void attachExitActionListener(ExitActionListener listener)
listener
- The ExitActionListener to be added.public void notifyExitActionListeners()
public void startOnAThread()
public void closeAndDispose()
public void addButton(javax.swing.JButton button)
button
- JButton to be added.public void addJLable(javax.swing.JLabel label)
public void addRadioButton(javax.swing.JRadioButton button)
button
- JRadioButton to be added.public void addCheckBox(javax.swing.JCheckBox checkBox)
checkBox
- JCheckBox to be added.public void addMenuBar(javax.swing.JMenuBar menuBar)
menuBar
- JMenuBar to be added.public void tickAndUpdate()
public void tickAndUpdateLeisurely(int leisureRate)
leisureRate
- iNumber of calls before the graphs should be updated.public boolean updateAndTick()
public boolean tick()
public boolean unTick()
public boolean tickButDoNotNotifySimulationRewoundListeners(int ticks)
tickButDoNotNotifySimulationRewoundListeners
in interface DataBufferCommandsExecutor
public boolean tick(int ticks)
tick
in interface DataBufferCommandsExecutor
public boolean setTick(int tick)
public void setupEntryBox(java.lang.String varname)
varname
- The name of the desired variable.public void setupEntryBox(java.lang.String[] varnames)
varnames
- Array containing the names of variables for which to add entry boxes.public void setupGraph(java.lang.String varname)
varname
- Name of the variable for which to add a graph.public void setupGraph(java.lang.String[] varnames)
varnames
- Array of variable names for which to create graphs.public void setupVarGroup(java.lang.String name, java.lang.String[] vars)
name
- Name of the group.vars
- Names of the variables to include.public void setupVarGroup(java.lang.String name, java.lang.String[] vars, java.lang.String[] regularExpressions)
name
- Name of the groupvars
- Array containing the names of variables to add.regularExpressions
- Array of regular expressions to include.public void setupGraphGroup(java.lang.String name, java.lang.String[][] vars)
Creates a new group of graphs with the given name containing the given variables. Once a graph group has been created it can be selected from the configuration drop down menu. It may also be added to a configuration along with a varGroup and entryBoxGroup.
For example:setupGraphGroup("states", new String[][]{{"left_state", "right_state"}, {"t"}, {"q_x", "q_z"}});
name
- Name of the group.vars
- Array containing the names of variables for which graphs are to be created. Each row is treated as a separate graph and may contain multiple variables.public void setupGraphGroup(java.lang.String name, java.lang.String[][][] vars)
Creates a new group of graphs with the given name containing the given variables using the specified configuration. Once a graph group has been created it can be selected from the configuration drop down menu. It may also be added to a configuration along with a varGroup and entryBoxGroup.
For example:setupGraphGroup("states", new String[][]{{{"left_state", "right_state"}, {"config_1}}, {{"t"}, {"config_2"}}, {{"q_x", "q_z"}, {"config_3"}}});
name
- The name of the graph group.vars
- String array containing the YoVariable names to be added to each graph in the group as well as the configurations to use.public void setupGraphGroup(java.lang.String name, java.lang.String[][] vars, int numColumns)
Creates a new group of graphs with the given name containing the given variables spread over the specified number of columns. Once a graph group has been created it can be selected from the configuration drop down menu. It may also be added to a configuration along with a varGroup and entryBoxGroup.
setupGraphGroup("states", new String[][]{{"left_state", "right_state"}, {"t"}, {"q_x", "q_z"}}, 2);
name
- Name of the group.vars
- String array containing the YoVariable names to be added to each graph in the group.numColumns
- Number of columns over which to spread the graphs.public void setupGraphGroup(java.lang.String name, java.lang.String[][][] vars, int numColumns)
setupGraphGroup("states", new String[][]{{{"left_state", "right_state"}, {"config_1}}, {{"t"}, {"config_2"}}, {{"q_x", "q_z"}, {"config_3"}}});
This code creates the following three graphs separated into two columns:
1) left_state, right_state both using config_1
2) t using config_2
3) q_x, q_z both using config_3
name
- Name of the group.vars
- String array containing the YoVariable names to be added to each graph in the group as well as the configurations to use.numColumns
- Number of columns over which to spread the graphs.public void setupEntryBoxGroup(java.lang.String name, java.lang.String[] vars)
name
- Name of the group.vars
- Array containing the names of the YoVariables to include.public void setupEntryBoxGroup(java.lang.String name, java.lang.String[] vars, java.lang.String[] regularExpressions)
name
- Name of the group.vars
- Array containing the names of the YoVariables to include.regularExpressions
- Array containing regular expressions to use in searching for additonal YoVariables.public void setupConfiguration(java.lang.String config, java.lang.String varGroupName, java.lang.String graphGroupName, java.lang.String entryBoxGroupName)
config
- Name of the new configuration.varGroupName
- Name of the varGroup to associate with this configuration.graphGroupName
- Name of the graphGroup to associate with this configuration.entryBoxGroupName
- Name of the entryBoxGroup to associate with this configuration.public void selectConfiguration(java.lang.String name)
name
- Name of the configuration to activate.public void setupCamera(CameraConfiguration cameraConfiguration)
Adds the specified camera configuration to the simulation. Once added the camera configuration may be selected in the viewport menu. It may also be added to a predefined viewport.
The following code creates a camera configuration named "camera 1" in track mode with a camera position of (-9,3,0.8) and an initial fix of (0,0,0.6)
CameraConfiguration camera1 = new CameraConfiguration("camera 1");
camera1.setCameraFix(0.0, 0.0, 0.6);
camera1.setCameraPosition(-9.0, 3.0, 0.8);
camera1.setCameraTracking(true, true, true, false);
camera1.setCameraDolly(false, true, true, false);
sim.setupCamera(camera1);
cameraConfiguration
- CameraConfigurationCameraConfiguration
public void setupExtraPanel(ExtraPanelConfiguration panelConfiguration)
public void selectCamera(java.lang.String cameraName)
cameraName
- Name of the camera to select.public void setupViewport(ViewportConfiguration viewportConfiguration)
viewportConfiguration
- ViewportConfigurationViewportConfiguration
public void selectViewport(java.lang.String viewportName)
viewportName
- Name of the viewport to activate.public void setupGraphConfigurations(GraphConfiguration[] configurations)
configurations
- Array of GraphConfigurations to store.public void setRobot(Robot robot)
rob
- Robot to be used by the simulation.public void setClipDistances(double near, double far)
near
- Nearest point at which objects are drawn.far
- Furthest point at which objects are drawn.public void setFieldOfView(double fieldOfView)
fieldOfView
- Field of view in radians.public void disableGUIComponents()
disableGUIComponents
in interface GUIEnablerAndDisabler
public void enableGUIComponents()
enableGUIComponents
in interface GUIEnablerAndDisabler
public void setBackgroundColor(java.awt.Color color)
color
- ColorColor
public void setBackgroundColor(javax.vecmath.Color3f color)
color
- Color3fColor3f
public void setBackgroundImage(java.net.URL fileURL, Graphics3DBackgroundScaleMode backgroundScaleMode)
fileURL
- URLimageScaleMode
- intpublic void setBackgroundImage(java.net.URL fileURL)
fileURL
- URLURL
public void setGroundAppearance(AppearanceDefinition app)
app
- AppearanceYoAppearance
public void setGroundVisible(boolean isVisible)
isVisible
- Specifies the visibility of the ground.public void run()
run
in interface java.lang.Runnable
public void stopSimulationThread()
public void setGraphsUpdatedDuringPlayback(boolean updateGraphs)
updateGraphs
- Specify whether or not graphs should update during playback.public boolean isGraphsUpdatedDuringPlayback()
setGraphsUpdatedDuringPlayback
public java.util.Vector<java.io.File> saveSimulationAsSequenceOfImages(java.lang.String path, java.lang.String NameNoExtension, CaptureDevice captureDevice)
public void stop()
stop
in interface StopCommandExecutor
public boolean isSimulationThreadUpAndRunning()
public boolean isSimulating()
isSimulating
in interface SimulateCommandExecutor
public void play()
play
in interface PlayCommandExecutor
public void setFastSimulate(boolean fastSimulate)
fastSimulate
- Enables or disables fastSimulate.public void simulateOneTimeStep() throws UnreasonableAccelerationException
UnreasonableAccelerationException
- This exception indicates an unreasonable acceleration occured. Try reducing gains, ground stiffness and damping, or DT.public void simulateOneRecordStep() throws UnreasonableAccelerationException
UnreasonableAccelerationException
- This exception indicates an unreasonable acceleration occured. Try reducing gains, ground stiffness and damping, or DT.setRecordDT
public void simulateOneRecordStepNow() throws UnreasonableAccelerationException
UnreasonableAccelerationException
- This exception indicates an unreasonable acceleration occured. Try reducing gains, ground stiffness and damping, or DT.public void simulate(int numTicks)
numTicks
- Number of ticks or steps to simulate.public void simulate(double simulationTime)
simulationTime
- Simulation time in seconds.public void simulate()
simulate
in interface SimulateCommandExecutor
public void setSimulateDuration(double simulateDurationInSeconds)
public double getSimulateDuration()
public void updateState()
public void doControl()
public void doDynamicsAndIntegrate() throws UnreasonableAccelerationException
UnreasonableAccelerationException
public void addSimulateDoneListener(SimulationDoneListener listener)
listener
- SimulationDoneListenerSimulationDoneListener
public void setSimulateDoneCriterion(SimulationDoneCriterion criterion)
criterion
- Criterion for simulation completion.SimulationDoneCriterion
public void removeSimulateDoneListener(SimulationDoneListener listener)
listener
- Listener to be removed.public void gotoInPoint()
gotoInPoint
in interface GotoInPointCommandExecutor
public void gotoInPointNow()
public void gotoOutPoint()
gotoOutPoint
in interface GotoOutPointCommandExecutor
public void gotoOutPointNow()
public void setInPoint()
setInPoint
in interface SetInPointCommandExecutor
public void addKeyPoint()
addKeyPoint
in interface AddKeyPointCommandExecutor
public void addCameraKey()
addCameraKey
in interface AddCameraKeyCommandExecutor
public void removeCameraKey()
removeCameraKey
in interface RemoveCameraKeyCommandExecutor
public void nextCameraKey()
nextCameraKey
in interface NextCameraKeyCommandExecutor
public void previousCameraKey()
previousCameraKey
in interface PreviousCameraKeyCommandExecutor
public void setOutPoint()
setOutPoint
in interface SetOutPointCommandExecutor
public void stepBackward()
stepBackward
in interface StepBackwardCommandExecutor
public void stepBackward(int steps)
steps
- The number of steps, or ticks, to move backward through the data.public void stepBackwardNow()
public void stepForward()
stepForward
in interface StepForwardCommandExecutor
public void stepForward(int steps)
steps
- intpublic void stepForwardNow(int steps)
steps
- intpublic void cropBuffer()
cropBuffer
in interface CropBufferCommandExecutor
public void packBuffer()
packBuffer
in interface PackBufferCommandExecutor
public void setWrapBuffer(boolean wrap)
wrap
- Should the buffer wrap to the beginning instead of expanding?public void changeBufferSize(int bufferSize)
bufferSize
- New buffer size in ticks, the buffer size must be a positive integer.public void setMaxBufferSize(int maxBufferSize)
maxBufferSize
- New max buffer size.public void setExportDataDirectory(java.lang.String directory)
directory
- Path name of the desired directory.public void setImportDataDirectory(java.lang.String directory)
directory
- Stringpublic void exportSnapshot(java.io.File snapshotFile)
exportSnapshot
in interface ExportSnapshotCommandExecutor
snapshotFile
- File to which the image is saved.public void exportSnapshot(java.io.File snapshotFile, ViewportWindow viewportSelector)
snapshotFile
- File to which the image is saved.viewportSelector
- the viewport to take the snapshot frompublic void exportSnapshot(java.io.File snapshotFile, CaptureDevice captureDevice)
public java.awt.image.BufferedImage exportSnapshotAsBufferedImage()
public java.awt.image.BufferedImage exportSnapshotAsBufferedImage(CaptureDevice captureDevice)
public void writeData(java.io.File chosenFile)
chosenFile
- File to which the data is saved.public void writeData(java.lang.String filename)
filename
- Stringpublic void writeData(java.lang.String varGroup, boolean binary, boolean compress, java.lang.String filename)
varGroup
- Name of the desired varGroup.binary
- Specify the file format, binary or ASCII.compress
- Specify the presence of compression.filename
- Path to the desired file, depends on compress.public void writeSpreadsheetFormattedData(java.lang.String varGroupName, java.io.File chosenFile)
varGroupName
- Name of the varGroup to be storedchosenFile
- File in which to store the data.public void writeData(java.lang.String varGroupName, boolean binary, boolean compress, java.io.File chosenFile)
varGroup
- Name of the desired varGroup.binary
- Specify the file format, binary or ASCII.compress
- Specify the presence of compression.chosenFile
- File to which data will be savedpublic void writeData(java.util.ArrayList<YoVariable> vars, boolean binary, boolean compress, java.io.File chosenFile)
writeData
in interface WriteDataCommandExecutor
vars
- Variables to write to filebinary
- Specify the file format, binary or ASCII.compress
- Specify the presence of compression.chosenFile
- File to which data will be savedpublic java.io.File createMovie(java.lang.String movieFilename)
public void createMovie(java.io.File movieFile)
public DataBuffer getDataBuffer()
public void writeState(java.io.File chosenFile)
chosenFile
- File in which to store the current state.public void writeState(java.lang.String filename)
filename
- Path to which the file should be stored.public void writeState(java.lang.String varGroup, boolean binary, boolean compress, java.lang.String filename)
varGroup
- Name of the variable group to store.binary
- Specify binary data format as opposed to ASCII text.compress
- Indicates whether or not the data is to be compressed.filename
- The path to the desired file.public void writeState(java.lang.String varGroupName, boolean binary, boolean compress, java.io.File chosenFile)
varGroup
- Name of the variable group to store.binary
- Specify binary data format as opposed to ASCII text.compress
- Indicates whether or not the data is to be compressed.chosenFile
- File in which the states are to be stored.public void writeSpreadsheetFormattedState(java.lang.String varGroupName, java.io.File chosenFile)
varGroupName
- Name of the variable group to store.chosenFile
- File in which the states are to be stored.public void readData(java.lang.String filename)
filename
- Path name of the file to be importedpublic void readData(java.net.URL url)
url
- URL at which the source file is located.public void readData(java.io.File chosenFile)
chosenFile
- File to load.public void readState(java.lang.String filename)
filename
- Path to desired file.public void readState(java.io.File chosenFile)
chosenFile
- File from which to read the new variable states.public void maximizeMainWindow()
public void createNewGraphWindow()
createNewGraphWindow
in interface CreateNewGraphWindowCommandExecutor
public void createNewGraphWindow(java.lang.String graphGroupName)
createNewGraphWindow
in interface CreateNewGraphWindowCommandExecutor
graphGroupName
- Name of the desired graph group.public void createNewGraphWindow(java.lang.String graphGroupName, int screenID, boolean maximizeWindow)
createNewGraphWindow
in interface CreateNewGraphWindowCommandExecutor
graphGroupName
- Name of the desired graph group.screenID
- The desired screen IDmaximizeWindow
- Specify whether or not the window should be maximized.public ViewportWindow createNewViewportWindow()
createNewViewportWindow
in interface CreateNewViewportWindowCommandExecutor
public ViewportWindow createNewViewportWindow(java.lang.String viewportName)
createNewViewportWindow
in interface CreateNewViewportWindowCommandExecutor
viewportName
- Name of the desired viewport configuration.
ViewportConfiguration
public ViewportWindow createNewViewportWindow(java.lang.String viewportName, int screenID, boolean maximizeWindow)
createNewViewportWindow
in interface CreateNewViewportWindowCommandExecutor
viewportName
- Name of the desired viewport configuration.screenID
- The desired screen IDmaximizeWindow
- Specify whether or not the window should be maximized.
ViewportConfiguration
public RobotSocketConnection allowTCPConnectionToHost(java.lang.String HOST)
public RobotSocketConnection allowTCPConnectionToHost(java.lang.String HOST, NewDataListener newDataListener)
public RobotSocketConnection allowTCPConnectionToHost(java.lang.String HOST, java.util.ArrayList<NewDataListener> newDataListeners)
HOST
- IP address of robot.
SCSRobotGUICommandListener
public void addVarList(VarList newVarList)
newVarList
- VarList to be merged with the existing data.public void addVarLists(VarList[] newVarLists)
newVarLists
- List of VarLists to be added.public void addVarLists(java.util.ArrayList<VarList> newVarLists)
newVarLists
- ArrayListpublic void registerCollisionGroup(CollisionGroup group)
group
- CollisionGroupCollisionGroup
public void registerCollisionGroups(java.util.ArrayList<CollisionGroup> groups)
groups
- ArrayListCollisionGroup
public void hideViewport()
public java.lang.Boolean isViewportHidden()
public void showViewport()
public void attachPlaybackListener(PlaybackListener playbackListener)
playbackListener
- Listener to add.StateMachinesJPanel
public void applyDataProcessingFunction(DataProcessingFunction dataProcessingFunction)
dataProcessingFunction
- DataProcessingFunction to be applied to the data.DataProcessingFunction
public void attachSelectedListener(SelectedListener selectedListener)
SelectedListener
- SelectedListenerSelectedListener
public void attachSimulationRewoundListener(SimulationRewoundListener simulationRewoundListener)
simulationRewoundListener
- SimulationRewoundListenerpublic boolean isKeyPointModeToggled()
isKeyPointModeToggled
in interface ToggleKeyPointModeCommandExecutor
public void toggleKeyPointMode()
toggleKeyPointMode
in interface ToggleKeyPointModeCommandExecutor
public void registerToggleKeyPointModeCommandListener(ToggleKeyPointModeCommandListener listener)
registerToggleKeyPointModeCommandListener
in interface ToggleKeyPointModeCommandExecutor
public void toggleCameraKeyMode()
toggleCameraKeyMode
in interface ToggleCameraKeyModeCommandExecutor
public void addExtraJpanel(java.awt.Component extraPanel, java.lang.String name)
public void exportRobotDefinition(Robot robot, java.io.File chosenFile)
public static void main(java.lang.String[] args)
public java.lang.String getRunningName()
public void setRunName(java.lang.String name)
public double getTime()
getTime
in interface TimeHolder
public void setTime(double time)
public static java.lang.String getVersion()
public int getInPoint()
getInPoint
in interface DataBufferCommandsExecutor
public void setIndex(int index)
setIndex
in interface DataBufferCommandsExecutor
public void setIndexButDoNotNotifySimulationRewoundListeners(int index)
setIndexButDoNotNotifySimulationRewoundListeners
in interface DataBufferCommandsExecutor
public int getOutPoint()
getOutPoint
in interface DataBufferCommandsExecutor
public void addDynamicGraphicObjectListRegistries(DynamicGraphicObjectsListRegistry dynamicGraphicObjectsListRegistry)
public void hideAllDynamicGraphicObjects()
public void setDynamicGraphicObjectsListVisible(java.lang.String name, boolean visible)
public void bringToFront()
public DynamicGraphicMenuManager getDynamicGraphicMenuManager()
public void setDynamicGraphicMenuManager(DynamicGraphicMenuManager dynamicGraphicMenuManager)
public Graphics3DAdapter getGraphics3dAdapter()
public void startStreamingVideoData(CameraConfiguration cameraConfiguration, int width, int height, VideoDataServer videoDataServer, TimestampProvider timestampProvider, int framesPerSecond)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |