Class CaptureData.ReadableSensorFile
java.lang.Object
|
+--java.io.Writer
|
+--java.io.OutputStreamWriter
|
+--java.io.FileWriter
|
+--CaptureData.ReadableSensorFile
- All Implemented Interfaces:
- java.lang.Runnable
- Enclosing class:
- CaptureData
- class CaptureData.ReadableSensorFile
- extends java.io.FileWriter
- implements java.lang.Runnable
An Inner class for writing out the raw sensor data in a human readable format.
The file format is described below.
- See Also:
writeCapture()
Field Summary |
(package private) java.text.DecimalFormat |
df
The format used for writing out floats. |
(package private) java.lang.String |
pattern
Specifies a pattern for the decimal format such that
the floats always have 4 places after the decimal. |
Fields inherited from class java.io.OutputStreamWriter |
bb, ctb, defaultByteBufferSize, nBytes, nextByte, out |
Fields inherited from class java.io.Writer |
lock, writeBuffer, writeBufferSize |
Method Summary |
(package private) java.lang.String |
addressToJointName(int a)
Given a bird address, return the string representing
the joint transformation associated with it. |
void |
run()
|
(package private) void |
writeAddress(short addr)
Write out a bird address as a two byte short value |
(package private) void |
writeCapture()
Write out the joint transforms for this capture. |
(package private) void |
writeHeader()
A header for the file that giives the numberr of sensor, the
measurement rate, the number of measurements and the duration of
the capture. |
(package private) void |
writeOrientations()
Write out just the orientations. |
(package private) void |
writeOrientationsAndTransforms()
Write out both the orientations from the sensors and the calculated
transforms. |
Methods inherited from class java.io.OutputStreamWriter |
close, ensureOpen, flush, flushBuffer, getEncoding, write, write, write |
Methods inherited from class java.io.Writer |
write, write |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
df
java.text.DecimalFormat df
- The format used for writing out floats.
pattern
java.lang.String pattern
- Specifies a pattern for the decimal format such that
the floats always have 4 places after the decimal.
CaptureData.ReadableSensorFile
CaptureData.ReadableSensorFile(java.io.File f)
throws java.io.IOException
- Constructor is the same as for a RandomAccessFile.
- Parameters:
f
- a file descriptor- Throws:
java.io.IOException
- - See Also:
FileWriter
run
public void run()
- Specified by:
run
in interface java.lang.Runnable
writeHeader
void writeHeader()
- A header for the file that giives the numberr of sensor, the
measurement rate, the number of measurements and the duration of
the capture. Looks like this:
nsensors [integer]
rate [integer]
measurements [integer]
duration [integer]
writeCapture
void writeCapture()
- Write out the joint transforms for this capture.
Each line of transform data in the file looks like the following:
joint_name w x y z
for example, one point from three sensors looks like:
*
l_shoulder 0.9601 -0.1851 0.1952 -0.0765
l_elbow 0.9341 0.1087 0.0008 -0.3401
l_wrist 0.9063 -0.0778 0.0672 -0.4099
addressToJointName
java.lang.String addressToJointName(int a)
- Given a bird address, return the string representing
the joint transformation associated with it.
- Parameters:
a
- The address of the bird
writeOrientations
void writeOrientations()
- Write out just the orientations.
The format is the sensor number (starting at 0)
writeOrientationsAndTransforms
void writeOrientationsAndTransforms()
- Write out both the orientations from the sensors and the calculated
transforms.
writeAddress
void writeAddress(short addr)
- Write out a bird address as a two byte short value