|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.kuka.roboticsAPI.sensorModel.DataRecorder
public class DataRecorder
Class to record data in a file.
After generating the DataRecorder it can be parameterized, in order to define which data sources should be recorded.
Parameterization is possible as long as the DataRecorder is not enabled. After having enabled the recorder the
attempt to parameterize it will cause an exception.
If no values for timeout, sample interval and fileName are defined, default values are used (timeout = -1 which means
no timeout, sample interval = 1ms, filename = "DataRecorder"+generated-ID+".log". Without a timeout the recording
will stop as soon as the buffer size of 16MB is reached, or 30000 datasets are gathered.
After parameterization 2 options exist to use the DataRecorder:
1. In combination with a RobotMotion
sa Here, the recording will be started by a trigger ( StartRecordingAction), e.g.
".triggerWhen(ICondition, new StartRecordingAction(recorder))". Accordingly, it can be stopped by a trigger or after
timeout ( StopRecordingAction ), e.g. ".triggerWhen(ICondition, new StopRecordingAction(recorder))".
2. As stand-alone recording
Here, the DataRecorder must be enabled before the recording can be started by startRecording(). The recording can be stopped by timeout or by stopRecoding().
The recorded file is text based (csv-file) and is formated as a table with rows and columns. The first row contains a
header which describes the values in each column. For each sample of the defined sample interval a row will be
written which contains the recorded values of the added data sources. In the first and the second column the time
stamp in nanoseconds is stored. Each additional column contains the parameterized data to record as described in the
header. For example " addCartesianForce(AbstractFrame, AbstractFrame)", the file contains eight columns, the
first and the second column for the time stamps and six columns for each value of the Cartesian force vector.
The location of the file is defined in the getURL() method.
enable(),
startRecording(),
stopRecording()| Nested Class Summary | |
|---|---|
static class |
DataRecorder.AngleUnit
Enumeration to select the unit of an angle. |
| Constructor Summary | |
|---|---|
DataRecorder()
Creates a default DataRecorder with default values. |
|
DataRecorder(String fileName,
long timeout,
TimeUnit timeUnit,
int sampleInterval)
Creates a new DataRecorder. |
|
| Method Summary | |
|---|---|
DataRecorder |
addCartesianForce(AbstractFrame measureFrame,
AbstractFrame orientationFrame)
Adds Cartesian forces (along axis x, y, z) in [N]. |
DataRecorder |
addCartesianTorque(AbstractFrame measureFrame,
AbstractFrame orientationFrame)
Adds Cartesian torques (about axis x, y, z) in [Nm]. |
DataRecorder |
addCommandedCartesianPositionXYZ(AbstractFrame measureFrame,
AbstractFrame referenceFrame)
Adds the the commanded Cartesian position of the specified frame. |
DataRecorder |
addCommandedJointPosition(Robot robot,
DataRecorder.AngleUnit angleUnit)
Adds the commanded positions of all joints of the robot. |
DataRecorder |
addCurrentCartesianPositionXYZ(AbstractFrame measureFrame,
AbstractFrame referenceFrame)
Adds the the current Cartesian position of the specified frame. |
DataRecorder |
addCurrentJointPosition(Robot robot,
DataRecorder.AngleUnit angleUnit)
Adds the current positions of all joints of the robot. |
DataRecorder |
addExternalJointTorque(Robot robot)
Adds the external torques of all joints of the robot. |
DataRecorder |
addInternalJointTorque(Robot robot)
Adds the internal torques of all joints of the robot. |
boolean |
awaitFileAvailable(long timeout,
TimeUnit timeUnit)
Blocks the calling thread until the recorded file is available or the timeout has elapsed. |
void |
enable()
Enables the DataRecorder. |
Controller |
getController()
Gets the controller where a DataRecorder was added. |
String |
getFileName()
Gets the name of the data file. |
RecorderConfiguration |
getRecorderConfiguration()
Gets the configuration of the data recorder. |
int |
getSampleInterval()
Gets the sample interval of the recorded data in milliseconds. |
long |
getTimeoutMillisecs()
Gets the timeout of the recorded data file in milliseconds. |
URL |
getURL()
Gets the URL of the file where the data were recorded. |
boolean |
isEnabled()
Gets the state of the DataRecorder. |
boolean |
isFileAvailable()
Gets the status of the file where the data has been saved. |
boolean |
isRecording()
Gets the state of the recording process. |
void |
run()
|
void |
setFileName(String fileName)
Sets the fileName where the recorded data will be saved. |
void |
setSampleInterval(int sampleInterval)
Sets the sample interval. |
void |
setTimeout(long timeout,
TimeUnit timeUnit)
Sets the timeout of a given DataRecorder object. |
void |
startRecording()
Starts recording data. |
void |
stopRecording()
Stops recording data. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DataRecorder(String fileName,
long timeout,
TimeUnit timeUnit,
int sampleInterval)
fileName - The name of the file to save the recording data. It only must
contain the file name and not the path.timeout - The time to record data. A negative value means that no
timeout will be used and the recording process will be stopped
when the file size reaches 16MB or 30000 datasets are
gathered. A zero value is not possible.timeUnit - The time unit of the timeoutsampleInterval - The sample interval in milliseconds to record data. The
minimum value is 1 millisecond. Other values must be multiple
of the minimum value. It must be non-negative.public DataRecorder()
The default values are:
fileName: DataRecorder[ID].log The ID will be generated at runtime.
timeout: -1 (No timeout. The recording will stop as soon as the buffer size of 16MB is reached or 30000 datasets
are gathered.)
timeUnit: Milliseconds
SampleInterval: 1 millisecond
| Method Detail |
|---|
public DataRecorder addCartesianForce(AbstractFrame measureFrame,
AbstractFrame orientationFrame)
measureFrame - The frame where the force measurement will take place. This
frame must be statically attached to a device which can
measure forces (such as a LBR). null is
not allowed.orientationFrame - Optional frame that specifies the orientation where the force
measurement will take place. As orientationFrame any frame for
which a path from measureFrame can be calculated at runtime
can be used; for example a frame connected to World. If
orientationFrame is set to null, the orientation of
measureFrame is used.
public DataRecorder addCartesianTorque(AbstractFrame measureFrame,
AbstractFrame orientationFrame)
measureFrame - The frame where the torque measurement will take place. This
frame must be statically attached to a device which can
measure forces (such as a LBR). null is
not allowed.orientationFrame - Optional frame that specifies the orientation where the force
measurement will take place. As orientationFrame any frame for
which a path from measureFrame can be calculated at runtime
can be used; for example a frame connected to World. If
orientationFrame is set to null, the orientation of
measureFrame is used.
public DataRecorder addInternalJointTorque(Robot robot)
robot - the robot whose internal joint torques are going to be added. null is not allowed.
public DataRecorder addExternalJointTorque(Robot robot)
robot - the robot whose external joint torques are going to be added. null is not allowed.
public DataRecorder addCurrentJointPosition(Robot robot,
DataRecorder.AngleUnit angleUnit)
robot - The robot whose current joint positions are going to be added. null is not allowed.angleUnit - The angle unit of the recorded output (degree or radiant)
public DataRecorder addCommandedJointPosition(Robot robot,
DataRecorder.AngleUnit angleUnit)
robot - The robot whose commanded joint positions are going to be
added. null is not allowedangleUnit - The angle unit of the recorded output (degree or radiant)
public DataRecorder addCurrentCartesianPositionXYZ(AbstractFrame measureFrame,
AbstractFrame referenceFrame)
measureFrame - The frame below or equal to the flange of the robot where the
measurement takes place. null is not allowedreferenceFrame - The positions are recorded in the coordinate system of this
reference frame. null is not allowed.
public DataRecorder addCommandedCartesianPositionXYZ(AbstractFrame measureFrame,
AbstractFrame referenceFrame)
measureFrame - The frame below or equal to the flange of the robot where the
measurement takes place. null is not allowedreferenceFrame - The positions are recorded in the coordinate system of this
reference frame. null is not allowed.
public void startRecording()
The DataRecorder must be enabled in order to start the recording process. Enabled means that the data recorder is ready to start recording. A disable process occurs automatically when the data recorder stops. This means that the same DataRecorder must be enabled again in order to record data a second time.
enable()public void stopRecording()
A disable process occurs automatically when the DataRecorder stops. This means that the same DataRecorder must be enabled again in order to record data.
enable(),
startRecording()public boolean isRecording()
public String getFileName()
public int getSampleInterval()
public long getTimeoutMillisecs()
public void setTimeout(long timeout,
TimeUnit timeUnit)
timeout - The time to record data. A negative value means that no
timeout will be used and the recording process will be stopped
when the file size reaches 16MB or 30000 datasets are
gathered. A zero value is not possible.timeUnit - The time unit of the timeoutpublic void setSampleInterval(int sampleInterval)
sampleInterval - The sample interval in milliseconds to record data. The
minimum value is 1 millisecond. It must be non-negative.public void setFileName(String fileName)
fileName - The name of the file to save the recording data. It only must
contain the file name and not the path.public Controller getController()
public URL getURL()
If the data recording is invoked twice with the same file name the recording process overwrites the last file.
isFileAvailable(),
awaitFileAvailable(long, TimeUnit)public void enable()
It does not start the recording process. Enabled means that the DataRecorder is ready to start recording. A disable process occurs automatically when the DataRecorder stops. This means that the same DataRecorder must be enabled again in order to record data.
Note: Only one DataRecorder instance can be enabled at the same time.
startRecording(),
stopRecording()public boolean isEnabled()
Enabled means that the DataRecorder is ready to start recording. A disable process occurs automatically when the data recorder stops. This means that the same DataRecorder must be enabled again in order to record data.
enable()public boolean isFileAvailable()
If the file is being written it is not available. If the data recording process is invoked twice with the same file name, the last file will be erased in the beginning of the recording process and therefore it will not be available.
public boolean awaitFileAvailable(long timeout,
TimeUnit timeUnit)
If the file is already available when called, this method returns immediately.
timeout - The maximum time the calling thread is blocked. The execution
of this method takes some milliseconds independently from the
given timeout.timeUnit - The unit of the timeout.
public void run()
run in interface Runnablepublic RecorderConfiguration getRecorderConfiguration()
RecorderConfiguration.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||