- Removes a child object if it exists.
Returns a reference to the object if it exists, otherwise,
it returns None.
- subObject(self, object_id)
- Returns the child object for that ID or None
- subObjectAtIndex(self, object_id, index=0)
- Returns the child object for that ID or None
- subObjects(self, object_id=None)
- Returns a VectorSerializable containg the subobjects
Methods inherited from Serializable:
- clone(self)
- Returns a new copy of the object
- extendedHeaderSize(data_size)
- Returns true if an extended header is required for data_size.
- extendedHeaderSizeMagicCookie()
- Returns the 'magic' size value used to indicate that the object's size is held in a uint32.
The old header consisted of:
objectid - uint8
object size - uint16
When the object's size matches the return value from this method then
the header consists of:
objectid - uint8
magic cookie - uint16
object size - uint32
- headerText(self)
- Returns a string containing the column headings for lineText() of the object in a fixed width format.
- lineText(self)
- Returns a string containing the data of the object in a fixed width format.
- minHeaderBytes()
- Returns the minimum number of header bytes that need to be read
to be able to determine if the header is an extended header or not.
This is the number of bytes for the object_id and 16 bit data size.
An extended header the data size field equal to the value returned
from extendedHeaderSizeMagicCookie().
- numDataBytes(self)
- Returns the number of bytes of data required to serialize class.
- numHeaderBytes(data_size)
- Returns the number of header bytes that are written to the buffer by the serialize function before the actual data is appended.
- numTotalBytes(self)
- Returns the total number of bytes required tp serialize the object,
This includes the header and the data bytes.
- objectID(self)
- Identifier for type of object
- readDataSizeHeader(buffer, read_pos_inout)
- Reads the size of the object header from the buffer.
The arguments are:
- buffer The buffer of data.
- read_pos_inout The position within the buffer to read from.
This method returns a tuple consisting of a boolean success indicator and the
size of the header. The success indicator can be false if there is
insufficient data in the buffer.
- serialize(self, buffer)
- Appends to the buffer the object's data.
- serializeEnabled(self)
- Returns whether this object, and its descendents, are to be serialized.
- unSerialize(self, buffer, read_pos_inout)
- Attempts to build the object from the buffer.
The arguments are:
- buffer The buffer of data to use to reconstruct the object
with.
- read_pos_inout The offset into the buffer to start reading data from.
This value must be >= 0.
Returns a tuple consisting of:
- boolean success indicator. The success indicator can be false
if the buffer contained insufficent data in which case the object will be left unmodified.
Otherwise, it returns true when the object was successfully deserialized.
- next read position, only valid if the success indicator is True.
This method may raise the following exceptions:
SerializableError The objectid in buffer does not match this object, or
the data_size in header didn't match amount of data read, or
duplicate sub-object ids were found.
The object may have been partially updated.
- writeHeader(buffer, object_id, data_size)
- Writes a header to the buffer.
The arguments are:
- buffer The buffer of data to append the header to.
- object_id The ID of the object that understands the data.
- data_size The size of the data associated with the header.
|
class GazeIntersectionOutputDataBase(IntersectionOutputBase) |
| |
A data class that represents intersections between gaze vector and world objects. |
| |
- Method resolution order:
- GazeIntersectionOutputDataBase
- IntersectionOutputBase
- EngineOutputBase
- SerializableComposite
- Serializable
Methods defined here:
- gazeObjectIntersection(self)
- Returns the 3D co-ordinates of the intersection point against the world model item in world co-ordinates.
The gaze used for intersections is the Unified Gaze Ray.
Intersection values are only logged if the GQL=3 for at least 1 eye.
Intersection coordinates are logged for both planes and spheres.
The co-ordinates are measured in meters relative to the world co-ordinate
origin and will be zero if no possible intersection could be computed.
- latestGazeIntersectionObjectID()
- Returns the object ID of the latest faceLAB GazeIntersectionOutputDataObject
that derives from GazeIntersectionOutputDataBase.
Note that GazeIntersectionOutputDataV3 is not a subclass of GazeIntersectionOutputDataBase.
- setGazeObjectIntersection(self, object_intersection)
- Set the world model object intersection point in world co-ordinates.
The arguments are:
- object_intersection 3D co-ordinates of the intersection in metres relative
to the world co-ordinate origin.
Methods inherited from IntersectionOutputBase:
- intersectionObjectIndex(self)
- Returns the index of the world-model object intersected by the direction vector.
The world model contains a number of indexed objects. The field
contains the index of the object that is intersected,
or -1 if no object is intersected or the tracking failed. The value
is only valid if >=1.
Note that this does not include the screen, which is a special
world model object.
- intersectionObjectName(self)
- Returns the name of the world-model object intersected by the direction vector.
The world model contains a number of indexed objects. The field
contains the name of the object that is intersected,
or "nothing" if no object is intersected or "notrack" if the
tracking failed.
Note: This name can be any length, but when this object is serialized,
the name will be truncated/padded to ensure it is exactly
MAX_OBJ_NAME_LENGTH characters.
- intersectsScreen(self)
- Returns a boolean indicating that the direction vector intersects with the screen.
The flag is true when the vector intersects the
special world object "screen". In this case, the intersection
coordinates presented in following data members are coordinates within
the region defined as the screen area.
- screenIntersectionPixelCoordinates(self)
- Returns the point as a 2-tuple of ints in pixel coordinates
where the vector intersects the screen plane.
The field contains the 2D point in pixels at which the
vector intersects the screen plane defined by the special
screen object in the world model. The values are valid even when the
vector does not intersect the screen. In this case the pixel coordinates
will be outside the region defined as the screen. If the head
tracking fails the values are 0.
- screenIntersectionScreenCoordinates(self)
- Returns the point as a 2-tuple of floats in screen coordinates
where the vector intersects the screen plane (in meters).
The field contains the 2D point in screen coordinates in meters at which the
vector intersects the screen plane defined by the special
screen object in the world model. The values are valid even when the
cyclops vector does not intersect the screen. In this case the 2D point will be
outside the region defined as the screen. If the head tracking
fails the values are 0.
- screenIntersectionWorldCoordinates(self)
- Returns the point as a 3-tuple of floats in world coordinates
where the vector intersects the screen plane (in meters).
The field contains the 3D point in world coordinates in meters at which the
vector intersects the screen plane defined by the special
screen object in the world model. The values are valid even when the
vector does not intersect the screen. In this case the 3D point will be
outside the region defined as the screen. If the head tracking
fails the values are 0.
- setIntersectionObjectIndex(self, index)
- Set the index of the currently intersected world-model object.
The arguments are:
- index The index.
- setIntersectionObjectName(self, name)
- Set the name of the currently intersected world-model object.
The arguments are:
- name The name of the world model object. This name can
be any length, but when this object is serialized,
the name will be truncated/padded to ensure it is
exactly MAX_OBJ_NAME_LENGTH
- setIntersectsScreen(self, intersects)
- Set the screen intersection flag
The arguments are:
- intersects True if the screen is intersected.
- setScreenIntersectionPixelCoordinates(self, screen_intersection)
- Set the the screen-intersection point in pixel co-ordinates.
The arguments are:
- screen_intersection A 2-tuple of ints in pixel co-ordinates.
- setScreenIntersectionScreenCoordinates(self, screen_intersection)
- Set the the screen-intersection point in screen co-ordinates.
The arguments are:
- screen_intersection A 2-tuple of floats in screen co-ordinates.
- setScreenIntersectionWorldCoordinates(self, screen_intersection)
- Set the the screen-intersection point in world co-ordinates.
The arguments are:
- screen_intersection A 3-tuple of floats in world co-ordinates.
Data and other attributes inherited from IntersectionOutputBase:
- MAX_OBJ_NAME_LENGTH = 7
Methods inherited from EngineOutputBase:
- eyeIdName(eye_id)
- Returns a string containing the name of the eye referred to by eye_id.
- setSerialableSubObjectsEnabled(self, valid_objects_ids, recursive=False)
- Set sub-object serialization enabled by object ID.
By default, sub-objects are serializeEnabled() and will be serialized.
Any attached sub-object with an id not in this vector will be
setSerializeEnabled(false) preventing it from being serialized.
The arguments are:
- valid_object_ids The list of object-ids to enable serialization for.
- recursive Whether to recurse into sub-object tree.
Note that only valid objects are recursed into. If
recursive is true then the only sub objects that will
be serialized will be the objects that can be traversed
with all object ids in valid_object_ids.
For example, given the following object graph.
1
|-2
| `4
`-3
|-5
`-6
If this method is called on object marked as 1 and the vector of
objects ids is [3, 4] and recursive is true. Then objects 2 will
be set false, object 4 will be untouched, object 3 will be set true
and obects 5 and 6 will be set false.
The only sub object serialized would be object 3.
- setSerializeEnabled(self, enabled)
- Sets the flag indicating that the object and its children should not be serialized.
Data and other attributes inherited from EngineOutputBase:
- ARRAY_SIZE_2D_DATA = 2
- ARRAY_SIZE_3D_DATA = 3
- ARRAY_SIZE_4D_DATA = 4
- ARRAY_SIZE_PAIR_DATA = 2
Methods inherited from SerializableComposite:
- addSubObject(self, sub_object)
- Adds a child object to this object.
The arguments are:
- sub_object Object to add or None.
This method may raise the following exceptions:
- SerializableError The object id already exists or the
object id is not valid for this object.
- hasSubObjectID(self, object_id)
- Returns true if a child object of that id has been added.
- numOwnDataBytes(self)
- Returns the number of bytes owned by this object excluding any child objects.
- numSubObjects(self)
- Returns the number of child objects added.
- numValidSubObjects(self)
- Returns the number of child objects that serializeEnabled() returns True.
- removeSubObject(self, object_id, index=None)
- Removes a child object if it exists.
Returns a reference to the object if it exists, otherwise,
it returns None.
- subObject(self, object_id)
- Returns the child object for that ID or None
- subObjectAtIndex(self, object_id, index=0)
- Returns the child object for that ID or None
- subObjects(self, object_id=None)
- Returns a VectorSerializable containg the subobjects
Methods inherited from Serializable:
- clone(self)
- Returns a new copy of the object
- extendedHeaderSize(data_size)
- Returns true if an extended header is required for data_size.
- extendedHeaderSizeMagicCookie()
- Returns the 'magic' size value used to indicate that the object's size is held in a uint32.
The old header consisted of:
objectid - uint8
object size - uint16
When the object's size matches the return value from this method then
the header consists of:
objectid - uint8
magic cookie - uint16
object size - uint32
- headerText(self)
- Returns a string containing the column headings for lineText() of the object in a fixed width format.
- lineText(self)
- Returns a string containing the data of the object in a fixed width format.
- minHeaderBytes()
- Returns the minimum number of header bytes that need to be read
to be able to determine if the header is an extended header or not.
This is the number of bytes for the object_id and 16 bit data size.
An extended header the data size field equal to the value returned
from extendedHeaderSizeMagicCookie().
- numDataBytes(self)
- Returns the number of bytes of data required to serialize class.
- numHeaderBytes(data_size)
- Returns the number of header bytes that are written to the buffer by the serialize function before the actual data is appended.
- numTotalBytes(self)
- Returns the total number of bytes required tp serialize the object,
This includes the header and the data bytes.
- objectID(self)
- Identifier for type of object
- readDataSizeHeader(buffer, read_pos_inout)
- Reads the size of the object header from the buffer.
The arguments are:
- buffer The buffer of data.
- read_pos_inout The position within the buffer to read from.
This method returns a tuple consisting of a boolean success indicator and the
size of the header. The success indicator can be false if there is
insufficient data in the buffer.
- serialize(self, buffer)
- Appends to the buffer the object's data.
- serializeEnabled(self)
- Returns whether this object, and its descendents, are to be serialized.
- unSerialize(self, buffer, read_pos_inout)
- Attempts to build the object from the buffer.
The arguments are:
- buffer The buffer of data to use to reconstruct the object
with.
- read_pos_inout The offset into the buffer to start reading data from.
This value must be >= 0.
Returns a tuple consisting of:
- boolean success indicator. The success indicator can be false
if the buffer contained insufficent data in which case the object will be left unmodified.
Otherwise, it returns true when the object was successfully deserialized.
- next read position, only valid if the success indicator is True.
This method may raise the following exceptions:
SerializableError The objectid in buffer does not match this object, or
the data_size in header didn't match amount of data read, or
duplicate sub-object ids were found.
The object may have been partially updated.
- writeHeader(buffer, object_id, data_size)
- Writes a header to the buffer.
The arguments are:
- buffer The buffer of data to append the header to.
- object_id The ID of the object that understands the data.
- data_size The size of the data associated with the header.
|
class GazeIntersectionOutputDataV1(GazeIntersectionOutputDataBase) |
| |
A data class that represents intersections between gaze vector and world objects.
Used from faceLab 4.0. |
| |
- Method resolution order:
- GazeIntersectionOutputDataV1
- GazeIntersectionOutputDataBase
- IntersectionOutputBase
- EngineOutputBase
- SerializableComposite
- Serializable
Methods defined here:
- __init__(self)
- All members zeroed.
Data and other attributes defined here:
- THIS_OBJECT_ID = 18
Methods inherited from GazeIntersectionOutputDataBase:
- gazeObjectIntersection(self)
- Returns the 3D co-ordinates of the intersection point against the world model item in world co-ordinates.
The gaze used for intersections is the Unified Gaze Ray.
Intersection values are only logged if the GQL=3 for at least 1 eye.
Intersection coordinates are logged for both planes and spheres.
The co-ordinates are measured in meters relative to the world co-ordinate
origin and will be zero if no possible intersection could be computed.
- latestGazeIntersectionObjectID()
- Returns the object ID of the latest faceLAB GazeIntersectionOutputDataObject
that derives from GazeIntersectionOutputDataBase.
Note that GazeIntersectionOutputDataV3 is not a subclass of GazeIntersectionOutputDataBase.
- setGazeObjectIntersection(self, object_intersection)
- Set the world model object intersection point in world co-ordinates.
The arguments are:
- object_intersection 3D co-ordinates of the intersection in metres relative
to the world co-ordinate origin.
Methods inherited from IntersectionOutputBase:
- intersectionObjectIndex(self)
- Returns the index of the world-model object intersected by the direction vector.
The world model contains a number of indexed objects. The field
contains the index of the object that is intersected,
or -1 if no object is intersected or the tracking failed. The value
is only valid if >=1.
Note that this does not include the screen, which is a special
world model object.
- intersectionObjectName(self)
- Returns the name of the world-model object intersected by the direction vector.
The world model contains a number of indexed objects. The field
contains the name of the object that is intersected,
or "nothing" if no object is intersected or "notrack" if the
tracking failed.
Note: This name can be any length, but when this object is serialized,
the name will be truncated/padded to ensure it is exactly
MAX_OBJ_NAME_LENGTH characters.
- intersectsScreen(self)
- Returns a boolean indicating that the direction vector intersects with the screen.
The flag is true when the vector intersects the
special world object "screen". In this case, the intersection
coordinates presented in following data members are coordinates within
the region defined as the screen area.
- screenIntersectionPixelCoordinates(self)
- Returns the point as a 2-tuple of ints in pixel coordinates
where the vector intersects the screen plane.
The field contains the 2D point in pixels at which the
vector intersects the screen plane defined by the special
screen object in the world model. The values are valid even when the
vector does not intersect the screen. In this case the pixel coordinates
will be outside the region defined as the screen. If the head
tracking fails the values are 0.
- screenIntersectionScreenCoordinates(self)
- Returns the point as a 2-tuple of floats in screen coordinates
where the vector intersects the screen plane (in meters).
The field contains the 2D point in screen coordinates in meters at which the
vector intersects the screen plane defined by the special
screen object in the world model. The values are valid even when the
cyclops vector does not intersect the screen. In this case the 2D point will be
outside the region defined as the screen. If the head tracking
fails the values are 0.
- screenIntersectionWorldCoordinates(self)
- Returns the point as a 3-tuple of floats in world coordinates
where the vector intersects the screen plane (in meters).
The field contains the 3D point in world coordinates in meters at which the
vector intersects the screen plane defined by the special
screen object in the world model. The values are valid even when the
vector does not intersect the screen. In this case the 3D point will be
outside the region defined as the screen. If the head tracking
fails the values are 0.
- setIntersectionObjectIndex(self, index)
- Set the index of the currently intersected world-model object.
The arguments are:
- index The index.
- setIntersectionObjectName(self, name)
- Set the name of the currently intersected world-model object.
The arguments are:
- name The name of the world model object. This name can
be any length, but when this object is serialized,
the name will be truncated/padded to ensure it is
exactly MAX_OBJ_NAME_LENGTH
- setIntersectsScreen(self, intersects)
- Set the screen intersection flag
The arguments are:
- intersects True if the screen is intersected.
- setScreenIntersectionPixelCoordinates(self, screen_intersection)
- Set the the screen-intersection point in pixel co-ordinates.
The arguments are:
- screen_intersection A 2-tuple of ints in pixel co-ordinates.
- setScreenIntersectionScreenCoordinates(self, screen_intersection)
- Set the the screen-intersection point in screen co-ordinates.
The arguments are:
- screen_intersection A 2-tuple of floats in screen co-ordinates.
- setScreenIntersectionWorldCoordinates(self, screen_intersection)
- Set the the screen-intersection point in world co-ordinates.
The arguments are:
- screen_intersection A 3-tuple of floats in world co-ordinates.
Data and other attributes inherited from IntersectionOutputBase:
- MAX_OBJ_NAME_LENGTH = 7
Methods inherited from EngineOutputBase:
- eyeIdName(eye_id)
- Returns a string containing the name of the eye referred to by eye_id.
- setSerialableSubObjectsEnabled(self, valid_objects_ids, recursive=False)
- Set sub-object serialization enabled by object ID.
By default, sub-objects are serializeEnabled() and will be serialized.
Any attached sub-object with an id not in this vector will be
setSerializeEnabled(false) preventing it from being serialized.
The arguments are:
- valid_object_ids The list of object-ids to enable serialization for.
- recursive Whether to recurse into sub-object tree.
Note that only valid objects are recursed into. If
recursive is true then the only sub objects that will
be serialized will be the objects that can be traversed
with all object ids in valid_object_ids.
For example, given the following object graph.
1
|-2
| `4
`-3
|-5
`-6
If this method is called on object marked as 1 and the vector of
objects ids is [3, 4] and recursive is true. Then objects 2 will
be set false, object 4 will be untouched, object 3 will be set true
and obects 5 and 6 will be set false.
The only sub object serialized would be object 3.
- setSerializeEnabled(self, enabled)
- Sets the flag indicating that the object and its children should not be serialized.
Data and other attributes inherited from EngineOutputBase:
- ARRAY_SIZE_2D_DATA = 2
- ARRAY_SIZE_3D_DATA = 3
- ARRAY_SIZE_4D_DATA = 4
- ARRAY_SIZE_PAIR_DATA = 2
Methods inherited from SerializableComposite:
- addSubObject(self, sub_object)
- Adds a child object to this object.
The arguments are:
- sub_object Object to add or None.
This method may raise the following exceptions:
- SerializableError The object id already exists or the
object id is not valid for this object.
- hasSubObjectID(self, object_id)
- Returns true if a child object of that id has been added.
- numOwnDataBytes(self)
- Returns the number of bytes owned by this object excluding any child objects.
- numSubObjects(self)
- Returns the number of child objects added.
- numValidSubObjects(self)
- Returns the number of child objects that serializeEnabled() returns True.
- removeSubObject(self, object_id, index=None)
- Removes a child object if it exists.
Returns a reference to the object if it exists, otherwise,
it returns None.
- subObject(self, object_id)
- Returns the child object for that ID or None
- subObjectAtIndex(self, object_id, index=0)
- Returns the child object for that ID or None
- subObjects(self, object_id=None)
- Returns a VectorSerializable containg the subobjects
Methods inherited from Serializable:
- clone(self)
- Returns a new copy of the object
- extendedHeaderSize(data_size)
- Returns true if an extended header is required for data_size.
- extendedHeaderSizeMagicCookie()
- Returns the 'magic' size value used to indicate that the object's size is held in a uint32.
The old header consisted of:
objectid - uint8
object size - uint16
When the object's size matches the return value from this method then
the header consists of:
objectid - uint8
magic cookie - uint16
object size - uint32
- headerText(self)
- Returns a string containing the column headings for lineText() of the object in a fixed width format.
- lineText(self)
- Returns a string containing the data of the object in a fixed width format.
- minHeaderBytes()
- Returns the minimum number of header bytes that need to be read
to be able to determine if the header is an extended header or not.
This is the number of bytes for the object_id and 16 bit data size.
An extended header the data size field equal to the value returned
from extendedHeaderSizeMagicCookie().
- numDataBytes(self)
- Returns the number of bytes of data required to serialize class.
- numHeaderBytes(data_size)
- Returns the number of header bytes that are written to the buffer by the serialize function before the actual data is appended.
- numTotalBytes(self)
- Returns the total number of bytes required tp serialize the object,
This includes the header and the data bytes.
- objectID(self)
- Identifier for type of object
- readDataSizeHeader(buffer, read_pos_inout)
- Reads the size of the object header from the buffer.
The arguments are:
- buffer The buffer of data.
- read_pos_inout The position within the buffer to read from.
This method returns a tuple consisting of a boolean success indicator and the
size of the header. The success indicator can be false if there is
insufficient data in the buffer.
- serialize(self, buffer)
- Appends to the buffer the object's data.
- serializeEnabled(self)
- Returns whether this object, and its descendents, are to be serialized.
- unSerialize(self, buffer, read_pos_inout)
- Attempts to build the object from the buffer.
The arguments are:
- buffer The buffer of data to use to reconstruct the object
with.
- read_pos_inout The offset into the buffer to start reading data from.
This value must be >= 0.
Returns a tuple consisting of:
- boolean success indicator. The success indicator can be false
if the buffer contained insufficent data in which case the object will be left unmodified.
Otherwise, it returns true when the object was successfully deserialized.
- next read position, only valid if the success indicator is True.
This method may raise the following exceptions:
SerializableError The objectid in buffer does not match this object, or
the data_size in header didn't match amount of data read, or
duplicate sub-object ids were found.
The object may have been partially updated.
- writeHeader(buffer, object_id, data_size)
- Writes a header to the buffer.
The arguments are:
- buffer The buffer of data to append the header to.
- object_id The ID of the object that understands the data.
- data_size The size of the data associated with the header.
|
class GazeIntersectionOutputDataV2(GazeIntersectionOutputDataBase) |
| |
A data class that represents intersections between gaze vector and world objects.
Used from faceLab 4.1. |
| |
- Method resolution order:
- GazeIntersectionOutputDataV2
- GazeIntersectionOutputDataBase
- IntersectionOutputBase
- EngineOutputBase
- SerializableComposite
- Serializable
Methods defined here:
- __init__(self)
- All members zeroed.
Data and other attributes defined here:
- THIS_OBJECT_ID = 29
Methods inherited from GazeIntersectionOutputDataBase:
- gazeObjectIntersection(self)
- Returns the 3D co-ordinates of the intersection point against the world model item in world co-ordinates.
The gaze used for intersections is the Unified Gaze Ray.
Intersection values are only logged if the GQL=3 for at least 1 eye.
Intersection coordinates are logged for both planes and spheres.
The co-ordinates are measured in meters relative to the world co-ordinate
origin and will be zero if no possible intersection could be computed.
- latestGazeIntersectionObjectID()
- Returns the object ID of the latest faceLAB GazeIntersectionOutputDataObject
that derives from GazeIntersectionOutputDataBase.
Note that GazeIntersectionOutputDataV3 is not a subclass of GazeIntersectionOutputDataBase.
- setGazeObjectIntersection(self, object_intersection)
- Set the world model object intersection point in world co-ordinates.
The arguments are:
- object_intersection 3D co-ordinates of the intersection in metres relative
to the world co-ordinate origin.
Methods inherited from IntersectionOutputBase:
- intersectionObjectIndex(self)
- Returns the index of the world-model object intersected by the direction vector.
The world model contains a number of indexed objects. The field
contains the index of the object that is intersected,
or -1 if no object is intersected or the tracking failed. The value
is only valid if >=1.
Note that this does not include the screen, which is a special
world model object.
- intersectionObjectName(self)
- Returns the name of the world-model object intersected by the direction vector.
The world model contains a number of indexed objects. The field
contains the name of the object that is intersected,
or "nothing" if no object is intersected or "notrack" if the
tracking failed.
Note: This name can be any length, but when this object is serialized,
the name will be truncated/padded to ensure it is exactly
MAX_OBJ_NAME_LENGTH characters.
- intersectsScreen(self)
- Returns a boolean indicating that the direction vector intersects with the screen.
The flag is true when the vector intersects the
special world object "screen". In this case, the intersection
coordinates presented in following data members are coordinates within
the region defined as the screen area.
- screenIntersectionPixelCoordinates(self)
- Returns the point as a 2-tuple of ints in pixel coordinates
where the vector intersects the screen plane.
The field contains the 2D point in pixels at which the
vector intersects the screen plane defined by the special
screen object in the world model. The values are valid even when the
vector does not intersect the screen. In this case the pixel coordinates
will be outside the region defined as the screen. If the head
tracking fails the values are 0.
- screenIntersectionScreenCoordinates(self)
- Returns the point as a 2-tuple of floats in screen coordinates
where the vector intersects the screen plane (in meters).
The field contains the 2D point in screen coordinates in meters at which the
vector intersects the screen plane defined by the special
screen object in the world model. The values are valid even when the
cyclops vector does not intersect the screen. In this case the 2D point will be
outside the region defined as the screen. If the head tracking
fails the values are 0.
- screenIntersectionWorldCoordinates(self)
- Returns the point as a 3-tuple of floats in world coordinates
where the vector intersects the screen plane (in meters).
The field contains the 3D point in world coordinates in meters at which the
vector intersects the screen plane defined by the special
screen object in the world model. The values are valid even when the
vector does not intersect the screen. In this case the 3D point will be
outside the region defined as the screen. If the head tracking
fails the values are 0.
- setIntersectionObjectIndex(self, index)
- Set the index of the currently intersected world-model object.
The arguments are:
- index The index.
- setIntersectionObjectName(self, name)
- Set the name of the currently intersected world-model object.
The arguments are:
- name The name of the world model object. This name can
be any length, but when this object is serialized,
the name will be truncated/padded to ensure it is
exactly MAX_OBJ_NAME_LENGTH
- setIntersectsScreen(self, intersects)
- Set the screen intersection flag
The arguments are:
- intersects True if the screen is intersected.
- setScreenIntersectionPixelCoordinates(self, screen_intersection)
- Set the the screen-intersection point in pixel co-ordinates.
The arguments are:
- screen_intersection A 2-tuple of ints in pixel co-ordinates.
- setScreenIntersectionScreenCoordinates(self, screen_intersection)
- Set the the screen-intersection point in screen co-ordinates.
The arguments are:
- screen_intersection A 2-tuple of floats in screen co-ordinates.
- setScreenIntersectionWorldCoordinates(self, screen_intersection)
- Set the the screen-intersection point in world co-ordinates.
The arguments are:
- screen_intersection A 3-tuple of floats in world co-ordinates.
Data and other attributes inherited from IntersectionOutputBase:
- MAX_OBJ_NAME_LENGTH = 7
Methods inherited from EngineOutputBase:
- eyeIdName(eye_id)
- Returns a string containing the name of the eye referred to by eye_id.
- setSerialableSubObjectsEnabled(self, valid_objects_ids, recursive=False)
- Set sub-object serialization enabled by object ID.
By default, sub-objects are serializeEnabled() and will be serialized.
Any attached sub-object with an id not in this vector will be
setSerializeEnabled(false) preventing it from being serialized.
The arguments are:
- valid_object_ids The list of object-ids to enable serialization for.
- recursive Whether to recurse into sub-object tree.
Note that only valid objects are recursed into. If
recursive is true then the only sub objects that will
be serialized will be the objects that can be traversed
with all object ids in valid_object_ids.
For example, given the following object graph.
1
|-2
| `4
`-3
|-5
`-6
If this method is called on object marked as 1 and the vector of
objects ids is [3, 4] and recursive is true. Then objects 2 will
be set false, object 4 will be untouched, object 3 will be set true
and obects 5 and 6 will be set false.
The only sub object serialized would be object 3.
- setSerializeEnabled(self, enabled)
- Sets the flag indicating that the object and its children should not be serialized.
Data and other attributes inherited from EngineOutputBase:
- ARRAY_SIZE_2D_DATA = 2
- ARRAY_SIZE_3D_DATA = 3
- ARRAY_SIZE_4D_DATA = 4
- ARRAY_SIZE_PAIR_DATA = 2
Methods inherited from SerializableComposite:
- addSubObject(self, sub_object)
- Adds a child object to this object.
The arguments are:
- sub_object Object to add or None.
This method may raise the following exceptions:
- SerializableError The object id already exists or the
object id is not valid for this object.
- hasSubObjectID(self, object_id)
- Returns true if a child object of that id has been added.
- numOwnDataBytes(self)
- Returns the number of bytes owned by this object excluding any child objects.
- numSubObjects(self)
- Returns the number of child objects added.
- numValidSubObjects(self)
- Returns the number of child objects that serializeEnabled() returns True.
- removeSubObject(self, object_id, index=None)
- Removes a child object if it exists.
Returns a reference to the object if it exists, otherwise,
it returns None.
- subObject(self, object_id)
- Returns the child object for that ID or None
- subObjectAtIndex(self, object_id, index=0)
- Returns the child object for that ID or None
- subObjects(self, object_id=None)
- Returns a VectorSerializable containg the subobjects
Methods inherited from Serializable:
- clone(self)
- Returns a new copy of the object
- extendedHeaderSize(data_size)
- Returns true if an extended header is required for data_size.
- extendedHeaderSizeMagicCookie()
- Returns the 'magic' size value used to indicate that the object's size is held in a uint32.
The old header consisted of:
objectid - uint8
object size - uint16
When the object's size matches the return value from this method then
the header consists of:
objectid - uint8
magic cookie - uint16
object size - uint32
- headerText(self)
- Returns a string containing the column headings for lineText() of the object in a fixed width format.
- lineText(self)
- Returns a string containing the data of the object in a fixed width format.
- minHeaderBytes()
- Returns the minimum number of header bytes that need to be read
to be able to determine if the header is an extended header or not.
This is the number of bytes for the object_id and 16 bit data size.
An extended header the data size field equal to the value returned
from extendedHeaderSizeMagicCookie().
- numDataBytes(self)
- Returns the number of bytes of data required to serialize class.
- numHeaderBytes(data_size)
- Returns the number of header bytes that are written to the buffer by the serialize function before the actual data is appended.
- numTotalBytes(self)
- Returns the total number of bytes required tp serialize the object,
This includes the header and the data bytes.
- objectID(self)
- Identifier for type of object
- readDataSizeHeader(buffer, read_pos_inout)
- Reads the size of the object header from the buffer.
The arguments are:
- buffer The buffer of data.
- read_pos_inout The position within the buffer to read from.
This method returns a tuple consisting of a boolean success indicator and the
size of the header. The success indicator can be false if there is
insufficient data in the buffer.
- serialize(self, buffer)
- Appends to the buffer the object's data.
- serializeEnabled(self)
- Returns whether this object, and its descendents, are to be serialized.
- unSerialize(self, buffer, read_pos_inout)
- Attempts to build the object from the buffer.
The arguments are:
- buffer The buffer of data to use to reconstruct the object
with.
- read_pos_inout The offset into the buffer to start reading data from.
This value must be >= 0.
Returns a tuple consisting of:
- boolean success indicator. The success indicator can be false
if the buffer contained insufficent data in which case the object will be left unmodified.
Otherwise, it returns true when the object was successfully deserialized.
- next read position, only valid if the success indicator is True.
This method may raise the following exceptions:
SerializableError The objectid in buffer does not match this object, or
the data_size in header didn't match amount of data read, or
duplicate sub-object ids were found.
The object may have been partially updated.
- writeHeader(buffer, object_id, data_size)
- Writes a header to the buffer.
The arguments are:
- buffer The buffer of data to append the header to.
- object_id The ID of the object that understands the data.
- data_size The size of the data associated with the header.
|
class GazeIntersectionOutputDataV3(IntersectionOutputBaseV2) |
| |
A data class which contains intersections between the gaze vector and world model items. |
| |
- Method resolution order:
- GazeIntersectionOutputDataV3
- IntersectionOutputBaseV2
- EngineOutputBase
- SerializableComposite
- Serializable
Methods defined here:
- __init__(self)
- Initializes object
Data and other attributes defined here:
- THIS_OBJECT_ID = 44
Methods inherited from IntersectionOutputBaseV2:
- addIntersection(self, label, world, plane=None, pixel=None)
- Add an intersection in world and plane coordinates.
The arguments are:
- label label of world item. Using an existing
label will replace the existing world intersection
and clear any pixel intersection.
- world 3D co-ordinates of the intersection in metres relative
to the world co-ordinate origin.
- plane 2D co-ordinates of the intersection measured in meters
relative to the centre of the plane.
- pixel 2D co-ordinates of the intersection measured in pixels
relative to the top left corner of the plane.
Any intersections not supplied will be cleared.
Example:
>>> s.addIntersection("mirror", (1, 2, 3))
Will clear any plane or pixel intersections that the mirror
world item had.
- clearAllData(self)
- Clear all intersection data.
- hasPixel(self, label)
- Returns true if there an intersection against the specified world model item in pixel co-ordinates.
The arguments are:
- label label of world item.
- hasPlane(self, label)
- Returns true if there an intersection against the specified world model item in plane co-ordinates.
The arguments are:
- label label of world item.
- hasWorld(self, label)
- Returns true if there an intersection against the specified world model item in world co-ordinates.
The arguments are:
- label label of world item.
- intersectedItems(self)
- Returns the list of labels for all world model items that have an intersection.
- pixel(self, label)
- Returns the 2D co-ordinates of the intersection point against the specified world model item in pixel co-ordinates.
The arguments are:
- label label of world item.
The co-ordinates are measured in pixels relative to the top left corner of the
plane, and will be (0,0) if the intersection doesn't exist.
- plane(self, label)
- Returns the 2D co-ordinates of the intersection point against the specified world model item in plane co-ordinates.
The arguments are:
- label label of world item.
The co-ordinates are measured in meters relative to the centre of the
plane, and will be (0,0) if the intersection doesn't exist.
- world(self, label)
- Returns the 3D co-ordinates of the intersection point against the specified world model item in world co-ordinates.
The arguments are:
- label label of world item.
The co-ordinates are measured in meters relative to the world co-ordinate
origin and will be zero if the intersection doesn't exist.
Methods inherited from EngineOutputBase:
- eyeIdName(eye_id)
- Returns a string containing the name of the eye referred to by eye_id.
- setSerialableSubObjectsEnabled(self, valid_objects_ids, recursive=False)
- Set sub-object serialization enabled by object ID.
By default, sub-objects are serializeEnabled() and will be serialized.
Any attached sub-object with an id not in this vector will be
setSerializeEnabled(false) preventing it from being serialized.
The arguments are:
- valid_object_ids The list of object-ids to enable serialization for.
- recursive Whether to recurse into sub-object tree.
Note that only valid objects are recursed into. If
recursive is true then the only sub objects that will
be serialized will be the objects that can be traversed
with all object ids in valid_object_ids.
For example, given the following object graph.
1
|-2
| `4
`-3
|-5
`-6
If this method is called on object marked as 1 and the vector of
objects ids is [3, 4] and recursive is true. Then objects 2 will
be set false, object 4 will be untouched, object 3 will be set true
and obects 5 and 6 will be set false.
The only sub object serialized would be object 3.
- setSerializeEnabled(self, enabled)
- Sets the flag indicating that the object and its children should not be serialized.
Data and other attributes inherited from EngineOutputBase:
- ARRAY_SIZE_2D_DATA = 2
- ARRAY_SIZE_3D_DATA = 3
- ARRAY_SIZE_4D_DATA = 4
- ARRAY_SIZE_PAIR_DATA = 2
Methods inherited from SerializableComposite:
- addSubObject(self, sub_object)
- Adds a child object to this object.
The arguments are:
- sub_object Object to add or None.
This method may raise the following exceptions:
- SerializableError The object id already exists or the
object id is not valid for this object.
- hasSubObjectID(self, object_id)
- Returns true if a child object of that id has been added.
- numOwnDataBytes(self)
- Returns the number of bytes owned by this object excluding any child objects.
- numSubObjects(self)
- Returns the number of child objects added.
- numValidSubObjects(self)
- Returns the number of child objects that serializeEnabled() returns True.
- removeSubObject(self, object_id, index=None)
- Removes a child object if it exists.
Returns a reference to the object if it exists, otherwise,
it returns None.
- subObject(self, object_id)
- Returns the child object for that ID or None
- subObjectAtIndex(self, object_id, index=0)
- Returns the child object for that ID or None
- subObjects(self, object_id=None)
- Returns a VectorSerializable containg the subobjects
Methods inherited from Serializable:
- clone(self)
- Returns a new copy of the object
- extendedHeaderSize(data_size)
- Returns true if an extended header is required for data_size.
- extendedHeaderSizeMagicCookie()
- Returns the 'magic' size value used to indicate that the object's size is held in a uint32.
The old header consisted of:
objectid - uint8
object size - uint16
When the object's size matches the return value from this method then
the header consists of:
objectid - uint8
magic cookie - uint16
object size - uint32
- headerText(self)
- Returns a string containing the column headings for lineText() of the object in a fixed width format.
- lineText(self)
- Returns a string containing the data of the object in a fixed width format.
- minHeaderBytes()
- Returns the minimum number of header bytes that need to be read
to be able to determine if the header is an extended header or not.
This is the number of bytes for the object_id and 16 bit data size.
An extended header the data size field equal to the value returned
from extendedHeaderSizeMagicCookie().
- numDataBytes(self)
- Returns the number of bytes of data required to serialize class.
- numHeaderBytes(data_size)
- Returns the number of header bytes that are written to the buffer by the serialize function before the actual data is appended.
- numTotalBytes(self)
- Returns the total number of bytes required tp serialize the object,
This includes the header and the data bytes.
- objectID(self)
- Identifier for type of object
- readDataSizeHeader(buffer, read_pos_inout)
- Reads the size of the object header from the buffer.
The arguments are:
- buffer The buffer of data.
- read_pos_inout The position within the buffer to read from.
This method returns a tuple consisting of a boolean success indicator and the
size of the header. The success indicator can be false if there is
insufficient data in the buffer.
- serialize(self, buffer)
- Appends to the buffer the object's data.
- serializeEnabled(self)
- Returns whether this object, and its descendents, are to be serialized.
- unSerialize(self, buffer, read_pos_inout)
- Attempts to build the object from the buffer.
The arguments are:
- buffer The buffer of data to use to reconstruct the object
with.
- read_pos_inout The offset into the buffer to start reading data from.
This value must be >= 0.
Returns a tuple consisting of:
- boolean success indicator. The success indicator can be false
if the buffer contained insufficent data in which case the object will be left unmodified.
Otherwise, it returns true when the object was successfully deserialized.
- next read position, only valid if the success indicator is True.
This method may raise the following exceptions:
SerializableError The objectid in buffer does not match this object, or
the data_size in header didn't match amount of data read, or
duplicate sub-object ids were found.
The object may have been partially updated.
- writeHeader(buffer, object_id, data_size)
- Writes a header to the buffer.
The arguments are:
- buffer The buffer of data to append the header to.
- object_id The ID of the object that understands the data.
- data_size The size of the data associated with the header.
|
class GazeIntersectionOutputDataV4(IntersectionOutputBaseV2) |
| |
A data class which contains intersections between the gaze vector and world model items. |
| |
- Method resolution order:
- GazeIntersectionOutputDataV4
- IntersectionOutputBaseV2
- EngineOutputBase
- SerializableComposite
- Serializable
Methods defined here:
- __init__(self)
- Initializes object
- eyeId(self, eye_id)
- Sets the intersection type.
The arguments are:
- eye_id One of the constants LEFT_EYE, RIGHT_EYE or
BOTH_EYES.
Data and other attributes defined here:
- THIS_OBJECT_ID = 39
Methods inherited from IntersectionOutputBaseV2:
- addIntersection(self, label, world, plane=None, pixel=None)
- Add an intersection in world and plane coordinates.
The arguments are:
- label label of world item. Using an existing
label will replace the existing world intersection
and clear any pixel intersection.
- world 3D co-ordinates of the intersection in metres relative
to the world co-ordinate origin.
- plane 2D co-ordinates of the intersection measured in meters
relative to the centre of the plane.
- pixel 2D co-ordinates of the intersection measured in pixels
relative to the top left corner of the plane.
Any intersections not supplied will be cleared.
Example:
>>> s.addIntersection("mirror", (1, 2, 3))
Will clear any plane or pixel intersections that the mirror
world item had.
- clearAllData(self)
- Clear all intersection data.
- hasPixel(self, label)
- Returns true if there an intersection against the specified world model item in pixel co-ordinates.
The arguments are:
- label label of world item.
- hasPlane(self, label)
- Returns true if there an intersection against the specified world model item in plane co-ordinates.
The arguments are:
- label label of world item.
- hasWorld(self, label)
- Returns true if there an intersection against the specified world model item in world co-ordinates.
The arguments are:
- label label of world item.
- intersectedItems(self)
- Returns the list of labels for all world model items that have an intersection.
- pixel(self, label)
- Returns the 2D co-ordinates of the intersection point against the specified world model item in pixel co-ordinates.
The arguments are:
- label label of world item.
The co-ordinates are measured in pixels relative to the top left corner of the
plane, and will be (0,0) if the intersection doesn't exist.
- plane(self, label)
- Returns the 2D co-ordinates of the intersection point against the specified world model item in plane co-ordinates.
The arguments are:
- label label of world item.
The co-ordinates are measured in meters relative to the centre of the
plane, and will be (0,0) if the intersection doesn't exist.
- world(self, label)
- Returns the 3D co-ordinates of the intersection point against the specified world model item in world co-ordinates.
The arguments are:
- label label of world item.
The co-ordinates are measured in meters relative to the world co-ordinate
origin and will be zero if the intersection doesn't exist.
Methods inherited from EngineOutputBase:
- eyeIdName(eye_id)
- Returns a string containing the name of the eye referred to by eye_id.
- setSerialableSubObjectsEnabled(self, valid_objects_ids, recursive=False)
- Set sub-object serialization enabled by object ID.
By default, sub-objects are serializeEnabled() and will be serialized.
Any attached sub-object with an id not in this vector will be
setSerializeEnabled(false) preventing it from being serialized.
The arguments are:
- valid_object_ids The list of object-ids to enable serialization for.
- recursive Whether to recurse into sub-object tree.
Note that only valid objects are recursed into. If
recursive is true then the only sub objects that will
be serialized will be the objects that can be traversed
with all object ids in valid_object_ids.
For example, given the following object graph.
1
|-2
| `4
`-3
|-5
`-6
If this method is called on object marked as 1 and the vector of
objects ids is [3, 4] and recursive is true. Then objects 2 will
be set false, object 4 will be untouched, object 3 will be set true
and obects 5 and 6 will be set false.
The only sub object serialized would be object 3.
- setSerializeEnabled(self, enabled)
- Sets the flag indicating that the object and its children should not be serialized.
Data and other attributes inherited from EngineOutputBase:
- ARRAY_SIZE_2D_DATA = 2
- ARRAY_SIZE_3D_DATA = 3
- ARRAY_SIZE_4D_DATA = 4
- ARRAY_SIZE_PAIR_DATA = 2
Methods inherited from SerializableComposite:
- addSubObject(self, sub_object)
- Adds a child object to this object.
The arguments are:
- sub_object Object to add or None.
This method may raise the following exceptions:
- SerializableError The object id already exists or the
object id is not valid for this object.
- hasSubObjectID(self, object_id)
- Returns true if a child object of that id has been added.
- numOwnDataBytes(self)
- Returns the number of bytes owned by this object excluding any child objects.
- numSubObjects(self)
- Returns the number of child objects added.
- numValidSubObjects(self)
- Returns the number of child objects that serializeEnabled() returns True.
- removeSubObject(self, object_id, index=None)
- Removes a child object if it exists.
Returns a reference to the object if it exists, otherwise,
it returns None.
- subObject(self, object_id)
- Returns the child object for that ID or None
- subObjectAtIndex(self, object_id, index=0)
- Returns the child object for that ID or None
- subObjects(self, object_id=None)
- Returns a VectorSerializable containg the subobjects
Methods inherited from Serializable:
- clone(self)
- Returns a new copy of the object
- extendedHeaderSize(data_size)
- Returns true if an extended header is required for data_size.
- extendedHeaderSizeMagicCookie()
- Returns the 'magic' size value used to indicate that the object's size is held in a uint32.
The old header consisted of:
objectid - uint8
object size - uint16
When the object's size matches the return value from this method then
the header consists of:
objectid - uint8
magic cookie - uint16
object size - uint32
- headerText(self)
- Returns a string containing the column headings for lineText() of the object in a fixed width format.
- lineText(self)
- Returns a string containing the data of the object in a fixed width format.
- minHeaderBytes()
- Returns the minimum number of header bytes that need to be read
to be able to determine if the header is an extended header or not.
This is the number of bytes for the object_id and 16 bit data size.
An extended header the data size field equal to the value returned
from extendedHeaderSizeMagicCookie().
- numDataBytes(self)
- Returns the number of bytes of data required to serialize class.
- numHeaderBytes(data_size)
- Returns the number of header bytes that are written to the buffer by the serialize function before the actual data is appended.
- numTotalBytes(self)
- Returns the total number of bytes required tp serialize the object,
This includes the header and the data bytes.
- objectID(self)
- Identifier for type of object
- readDataSizeHeader(buffer, read_pos_inout)
- Reads the size of the object header from the buffer.
The arguments are:
- buffer The buffer of data.
- read_pos_inout The position within the buffer to read from.
This method returns a tuple consisting of a boolean success indicator and the
size of the header. The success indicator can be false if there is
insufficient data in the buffer.
- serialize(self, buffer)
- Appends to the buffer the object's data.
- serializeEnabled(self)
- Returns whether this object, and its descendents, are to be serialized.
- unSerialize(self, buffer, read_pos_inout)
- Attempts to build the object from the buffer.
The arguments are:
- buffer The buffer of data to use to reconstruct the object
with.
- read_pos_inout The offset into the buffer to start reading data from.
This value must be >= 0.
Returns a tuple consisting of:
- boolean success indicator. The success indicator can be false
if the buffer contained insufficent data in which case the object will be left unmodified.
Otherwise, it returns true when the object was successfully deserialized.
- next read position, only valid if the success indicator is True.
This method may raise the following exceptions:
SerializableError The objectid in buffer does not match this object, or
the data_size in header didn't match amount of data read, or
duplicate sub-object ids were found.
The object may have been partially updated.
- writeHeader(buffer, object_id, data_size)
- Writes a header to the buffer.
The arguments are:
- buffer The buffer of data to append the header to.
- object_id The ID of the object that understands the data.
- data_size The size of the data associated with the header.
|
class GazeOutputData(EngineOutputBase) |
| |
A data class that represents gaze related data output by the Tracking Engine. |
| |
- Method resolution order:
- GazeOutputData
- EngineOutputBase
- SerializableComposite
- Serializable
Methods defined here:
- __init__(self)
- All members zeroed.
- eyeballCentre(self, eye_id)
- Returns the positions of the eye balls in world coordinates.
The arguments are:
- eye_id The ID for the eye, must be sm.eod.LEFT_EYE or sm.eod.RIGHT_EYE.
The positions of the centre of the eye balls in world coordinates. If the system is
not using IR-based gaze, these are derived from the calibrated, or if not available,
from the uncalibrated eye ball positions relative to the head model features. If the
system is able to track IR-gaze, a more accurate value is logged
If the system is in search mode, the value is 0.
- gazeCalibrated(self)
- Returns flag indicating whether or not gaze has been calibrated.
Calibrated gaze is more accurate than uncalibrated gaze.
- gazeQualityLevel(self, eye_id)
- Returns the quality of gaze output for a given eye.
The arguments are:
- eye_id The ID for the eye, must be sm.eod.LEFT_EYE or sm.eod.RIGHT_EYE.
The gaze quality levels is on of the constants: NO_TRACKING,
HEAD_DIRECTION, NON_IR_GAZE, IR_GAZE.
- gazeQualityLevelName(gql)
- Returns a string representation of the gaze quality level.
The arguments are:
- gql The gaze quality level. One of the constants NO_TRACKING,
HEAD_DIRECTION, NON_IR_GAZE, IR_GAZE.
- gazeRotation(self, eye_id)
- Gaze direction in world coordinate system around [x,y].
The arguments are:
- eye_id The ID for the eye, must be sm.eod.LEFT_EYE or sm.eod.RIGHT_EYE.
The orientation of the eye gaze with respect to the world coordinate
system is encoded in these fields. The values are the pitch and yaw angles in
radians for rotations around the x- and y-axis to align the z-axes
of the world coordinate system with the eye gaze direction.
The eye gaze direction defined in this way represents the direction
of a vector originating from the eyeball centre.
If the system is not in tracking mode, the values are 0.
- saccade(self)
- Returns a flag indicating a saccade.
The flag is set during saccades of the eye gaze as detected by
the internal faceLAB saccade filter. This signal is the basis
for the eye gaze filter.
- setEyeballCentre(self, eye_id, eyeball_centre)
- Set the gaze rotation for a given eye.
The arguments are:
- eye_id The ID for the eye, must be sm.eod.LEFT_EYE or sm.eod.RIGHT_EYE.
- gaze_rot The 2D position [Pitch,Yaw] in radians.
- setGazeCalibrated(self, calibrated)
- Set whether the gaze has been calibrated.
The arguments are:
- calibrated True if the gaze has been calibrated.
- setGazeQualityLevel(self, eye_id, gql)
- Returns true if there an intersection against the specified world model item in plane co-ordinates.
The arguments are:
- eye_id The ID for the eye, must be sm.eod.LEFT_EYE or sm.eod.RIGHT_EYE.
- gql The gaze quality level. One of the constants NO_TRACKING,
HEAD_DIRECTION, NON_IR_GAZE, IR_GAZE.
- setSaccade(self, saccade)
- Sets the saccade flag.
The arguments are:
- saccade boolean indicating a saccade is occuring.
Data and other attributes defined here:
- THIS_OBJECT_ID = 13
Methods inherited from EngineOutputBase:
- eyeIdName(eye_id)
- Returns a string containing the name of the eye referred to by eye_id.
- setSerialableSubObjectsEnabled(self, valid_objects_ids, recursive=False)
- Set sub-object serialization enabled by object ID.
By default, sub-objects are serializeEnabled() and will be serialized.
Any attached sub-object with an id not in this vector will be
setSerializeEnabled(false) preventing it from being serialized.
The arguments are:
- valid_object_ids The list of object-ids to enable serialization for.
- recursive Whether to recurse into sub-object tree.
Note that only valid objects are recursed into. If
recursive is true then the only sub objects that will
be serialized will be the objects that can be traversed
with all object ids in valid_object_ids.
For example, given the following object graph.
1
|-2
| `4
`-3
|-5
`-6
If this method is called on object marked as 1 and the vector of
objects ids is [3, 4] and recursive is true. Then objects 2 will
be set false, object 4 will be untouched, object 3 will be set true
and obects 5 and 6 will be set false.
The only sub object serialized would be object 3.
- setSerializeEnabled(self, enabled)
- Sets the flag indicating that the object and its children should not be serialized.
Data and other attributes inherited from EngineOutputBase:
- ARRAY_SIZE_2D_DATA = 2
- ARRAY_SIZE_3D_DATA = 3
- ARRAY_SIZE_4D_DATA = 4
- ARRAY_SIZE_PAIR_DATA = 2
Methods inherited from SerializableComposite:
- addSubObject(self, sub_object)
- Adds a child object to this object.
The arguments are:
- sub_object Object to add or None.
This method may raise the following exceptions:
- SerializableError The object id already exists or the
object id is not valid for this object.
- hasSubObjectID(self, object_id)
- Returns true if a child object of that id has been added.
- numOwnDataBytes(self)
- Returns the number of bytes owned by this object excluding any child objects.
- numSubObjects(self)
- Returns the number of child objects added.
- numValidSubObjects(self)
- Returns the number of child objects that serializeEnabled() returns True.
- removeSubObject(self, object_id, index=None)
- Removes a child object if it exists.
Returns a reference to the object if it exists, otherwise,
it returns None.
- subObject(self, object_id)
- Returns the child object for that ID or None
- subObjectAtIndex(self, object_id, index=0)
- Returns the child object for that ID or None
- subObjects(self, object_id=None)
- Returns a VectorSerializable containg the subobjects
Methods inherited from Serializable:
- clone(self)
- Returns a new copy of the object
- extendedHeaderSize(data_size)
- Returns true if an extended header is required for data_size.
- extendedHeaderSizeMagicCookie()
- Returns the 'magic' size value used to indicate that the object's size is held in a uint32.
The old header consisted of:
objectid - uint8
object size - uint16
When the object's size matches the return value from this method then
the header consists of:
objectid - uint8
magic cookie - uint16
object size - uint32
- headerText(self)
- Returns a string containing the column headings for lineText() of the object in a fixed width format.
- lineText(self)
- Returns a string containing the data of the object in a fixed width format.
- minHeaderBytes()
- Returns the minimum number of header bytes that need to be read
to be able to determine if the header is an extended header or not.
This is the number of bytes for the object_id and 16 bit data size.
An extended header the data size field equal to the value returned
from extendedHeaderSizeMagicCookie().
- numDataBytes(self)
- Returns the number of bytes of data required to serialize class.
- numHeaderBytes(data_size)
- Returns the number of header bytes that are written to the buffer by the serialize function before the actual data is appended.
- numTotalBytes(self)
- Returns the total number of bytes required tp serialize the object,
This includes the header and the data bytes.
- objectID(self)
- Identifier for type of object
- readDataSizeHeader(buffer, read_pos_inout)
- Reads the size of the object header from the buffer.
The arguments are:
- buffer The buffer of data.
- read_pos_inout The position within the buffer to read from.
This method returns a tuple consisting of a boolean success indicator and the
size of the header. The success indicator can be false if there is
insufficient data in the buffer.
- serialize(self, buffer)
- Appends to the buffer the object's data.
- serializeEnabled(self)
- Returns whether this object, and its descendents, are to be serialized.
- unSerialize(self, buffer, read_pos_inout)
- Attempts to build the object from the buffer.
The arguments are:
- buffer The buffer of data to use to reconstruct the object
with.
- read_pos_inout The offset into the buffer to start reading data from.
This value must be >= 0.
Returns a tuple consisting of:
- boolean success indicator. The success indicator can be false
if the buffer contained insufficent data in which case the object will be left unmodified.
Otherwise, it returns true when the object was successfully deserialized.
- next read position, only valid if the success indicator is True.
This method may raise the following exceptions:
SerializableError The objectid in buffer does not match this object, or
the data_size in header didn't match amount of data read, or
duplicate sub-object ids were found.
The object may have been partially updated.
- writeHeader(buffer, object_id, data_size)
- Writes a header to the buffer.
The arguments are:
- buffer The buffer of data to append the header to.
- object_id The ID of the object that understands the data.
- data_size The size of the data associated with the header.
|
class HeadIntersectionOutputDataV1(IntersectionOutputBase) |
| |
A data class that represents intersections between head vector and world objects. |
| |
- Method resolution order:
- HeadIntersectionOutputDataV1
- IntersectionOutputBase
- EngineOutputBase
- SerializableComposite
- Serializable
Methods defined here:
- __init__(self)
- All members zeroed.
Data and other attributes defined here:
- THIS_OBJECT_ID = 17
Methods inherited from IntersectionOutputBase:
- intersectionObjectIndex(self)
- Returns the index of the world-model object intersected by the direction vector.
The world model contains a number of indexed objects. The field
contains the index of the object that is intersected,
or -1 if no object is intersected or the tracking failed. The value
is only valid if >=1.
Note that this does not include the screen, which is a special
world model object.
- intersectionObjectName(self)
- Returns the name of the world-model object intersected by the direction vector.
The world model contains a number of indexed objects. The field
contains the name of the object that is intersected,
or "nothing" if no object is intersected or "notrack" if the
tracking failed.
Note: This name can be any length, but when this object is serialized,
the name will be truncated/padded to ensure it is exactly
MAX_OBJ_NAME_LENGTH characters.
- intersectsScreen(self)
- Returns a boolean indicating that the direction vector intersects with the screen.
The flag is true when the vector intersects the
special world object "screen". In this case, the intersection
coordinates presented in following data members are coordinates within
the region defined as the screen area.
- screenIntersectionPixelCoordinates(self)
- Returns the point as a 2-tuple of ints in pixel coordinates
where the vector intersects the screen plane.
The field contains the 2D point in pixels at which the
vector intersects the screen plane defined by the special
screen object in the world model. The values are valid even when the
vector does not intersect the screen. In this case the pixel coordinates
will be outside the region defined as the screen. If the head
tracking fails the values are 0.
- screenIntersectionScreenCoordinates(self)
- Returns the point as a 2-tuple of floats in screen coordinates
where the vector intersects the screen plane (in meters).
The field contains the 2D point in screen coordinates in meters at which the
vector intersects the screen plane defined by the special
screen object in the world model. The values are valid even when the
cyclops vector does not intersect the screen. In this case the 2D point will be
outside the region defined as the screen. If the head tracking
fails the values are 0.
- screenIntersectionWorldCoordinates(self)
- Returns the point as a 3-tuple of floats in world coordinates
where the vector intersects the screen plane (in meters).
The field contains the 3D point in world coordinates in meters at which the
vector intersects the screen plane defined by the special
screen object in the world model. The values are valid even when the
vector does not intersect the screen. In this case the 3D point will be
outside the region defined as the screen. If the head tracking
fails the values are 0.
- setIntersectionObjectIndex(self, index)
- Set the index of the currently intersected world-model object.
The arguments are:
- index The index.
- setIntersectionObjectName(self, name)
- Set the name of the currently intersected world-model object.
The arguments are:
- name The name of the world model object. This name can
be any length, but when this object is serialized,
the name will be truncated/padded to ensure it is
exactly MAX_OBJ_NAME_LENGTH
- setIntersectsScreen(self, intersects)
- Set the screen intersection flag
The arguments are:
- intersects True if the screen is intersected.
- setScreenIntersectionPixelCoordinates(self, screen_intersection)
- Set the the screen-intersection point in pixel co-ordinates.
The arguments are:
- screen_intersection A 2-tuple of ints in pixel co-ordinates.
- setScreenIntersectionScreenCoordinates(self, screen_intersection)
- Set the the screen-intersection point in screen co-ordinates.
The arguments are:
- screen_intersection A 2-tuple of floats in screen co-ordinates.
- setScreenIntersectionWorldCoordinates(self, screen_intersection)
- Set the the screen-intersection point in world co-ordinates.
The arguments are:
- screen_intersection A 3-tuple of floats in world co-ordinates.
Data and other attributes inherited from IntersectionOutputBase:
- MAX_OBJ_NAME_LENGTH = 7
Methods inherited from EngineOutputBase:
- eyeIdName(eye_id)
- Returns a string containing the name of the eye referred to by eye_id.
- setSerialableSubObjectsEnabled(self, valid_objects_ids, recursive=False)
- Set sub-object serialization enabled by object ID.
By default, sub-objects are serializeEnabled() and will be serialized.
Any attached sub-object with an id not in this vector will be
setSerializeEnabled(false) preventing it from being serialized.
The arguments are:
- valid_object_ids The list of object-ids to enable serialization for.
- recursive Whether to recurse into sub-object tree.
Note that only valid objects are recursed into. If
recursive is true then the only sub objects that will
be serialized will be the objects that can be traversed
with all object ids in valid_object_ids.
For example, given the following object graph.
1
|-2
| `4
`-3
|-5
`-6
If this method is called on object marked as 1 and the vector of
objects ids is [3, 4] and recursive is true. Then objects 2 will
be set false, object 4 will be untouched, object 3 will be set true
and obects 5 and 6 will be set false.
The only sub object serialized would be object 3.
- setSerializeEnabled(self, enabled)
- Sets the flag indicating that the object and its children should not be serialized.
Data and other attributes inherited from EngineOutputBase:
- ARRAY_SIZE_2D_DATA = 2
- ARRAY_SIZE_3D_DATA = 3
- ARRAY_SIZE_4D_DATA = 4
- ARRAY_SIZE_PAIR_DATA = 2
Methods inherited from SerializableComposite:
- addSubObject(self, sub_object)
- Adds a child object to this object.
The arguments are:
- sub_object Object to add or None.
This method may raise the following exceptions:
- SerializableError The object id already exists or the
object id is not valid for this object.
- hasSubObjectID(self, object_id)
- Returns true if a child object of that id has been added.
- numOwnDataBytes(self)
- Returns the number of bytes owned by this object excluding any child objects.
- numSubObjects(self)
- Returns the number of child objects added.
- numValidSubObjects(self)
- Returns the number of child objects that serializeEnabled() returns True.
- removeSubObject(self, object_id, index=None)
- Removes a child object if it exists.
Returns a reference to the object if it exists, otherwise,
it returns None.
- subObject(self, object_id)
- Returns the child object for that ID or None
- subObjectAtIndex(self, object_id, index=0)
- Returns the child object for that ID or None
- subObjects(self, object_id=None)
- Returns a VectorSerializable containg the subobjects
Methods inherited from Serializable:
- clone(self)
- Returns a new copy of the object
- extendedHeaderSize(data_size)
- Returns true if an extended header is required for data_size.
- extendedHeaderSizeMagicCookie()
- Returns the 'magic' size value used to indicate that the object's size is held in a uint32.
The old header consisted of:
objectid - uint8
object size - uint16
When the object's size matches the return value from this method then
the header consists of:
objectid - uint8
magic cookie - uint16
object size - uint32
- headerText(self)
- Returns a string containing the column headings for lineText() of the object in a fixed width format.
- lineText(self)
- Returns a string containing the data of the object in a fixed width format.
- minHeaderBytes()
- Returns the minimum number of header bytes that need to be read
to be able to determine if the header is an extended header or not.
This is the number of bytes for the object_id and 16 bit data size.
An extended header the data size field equal to the value returned
from extendedHeaderSizeMagicCookie().
- numDataBytes(self)
- Returns the number of bytes of data required to serialize class.
- numHeaderBytes(data_size)
- Returns the number of header bytes that are written to the buffer by the serialize function before the actual data is appended.
- numTotalBytes(self)
- Returns the total number of bytes required tp serialize the object,
This includes the header and the data bytes.
- objectID(self)
- Identifier for type of object
- readDataSizeHeader(buffer, read_pos_inout)
- Reads the size of the object header from the buffer.
The arguments are:
- buffer The buffer of data.
- read_pos_inout The position within the buffer to read from.
This method returns a tuple consisting of a boolean success indicator and the
size of the header. The success indicator can be false if there is
insufficient data in the buffer.
- serialize(self, buffer)
- Appends to the buffer the object's data.
- serializeEnabled(self)
- Returns whether this object, and its descendents, are to be serialized.
- unSerialize(self, buffer, read_pos_inout)
- Attempts to build the object from the buffer.
The arguments are:
- buffer The buffer of data to use to reconstruct the object
with.
- read_pos_inout The offset into the buffer to start reading data from.
This value must be >= 0.
Returns a tuple consisting of:
- boolean success indicator. The success indicator can be false
if the buffer contained insufficent data in which case the object will be left unmodified.
Otherwise, it returns true when the object was successfully deserialized.
- next read position, only valid if the success indicator is True.
This method may raise the following exceptions:
SerializableError The objectid in buffer does not match this object, or
the data_size in header didn't match amount of data read, or
duplicate sub-object ids were found.
The object may have been partially updated.
- writeHeader(buffer, object_id, data_size)
- Writes a header to the buffer.
The arguments are:
- buffer The buffer of data to append the header to.
- object_id The ID of the object that understands the data.
- data_size The size of the data associated with the header.
|
class HeadIntersectionOutputDataV2(IntersectionOutputBaseV2) |
| |
A data class that represents intersections between head vector and world objects. |
| |
- Method resolution order:
- HeadIntersectionOutputDataV2
- IntersectionOutputBaseV2
- EngineOutputBase
- SerializableComposite
- Serializable
Methods defined here:
- __init__(self)
- All members zeroed.
Data and other attributes defined here:
- THIS_OBJECT_ID = 45
Methods inherited from IntersectionOutputBaseV2:
- addIntersection(self, label, world, plane=None, pixel=None)
- Add an intersection in world and plane coordinates.
The arguments are:
- label label of world item. Using an existing
label will replace the existing world intersection
and clear any pixel intersection.
- world 3D co-ordinates of the intersection in metres relative
to the world co-ordinate origin.
- plane 2D co-ordinates of the intersection measured in meters
relative to the centre of the plane.
- pixel 2D co-ordinates of the intersection measured in pixels
relative to the top left corner of the plane.
Any intersections not supplied will be cleared.
Example:
>>> s.addIntersection("mirror", (1, 2, 3))
Will clear any plane or pixel intersections that the mirror
world item had.
- clearAllData(self)
- Clear all intersection data.
- hasPixel(self, label)
- Returns true if there an intersection against the specified world model item in pixel co-ordinates.
The arguments are:
- label label of world item.
- hasPlane(self, label)
- Returns true if there an intersection against the specified world model item in plane co-ordinates.
The arguments are:
- label label of world item.
- hasWorld(self, label)
- Returns true if there an intersection against the specified world model item in world co-ordinates.
The arguments are:
- label label of world item.
- intersectedItems(self)
- Returns the list of labels for all world model items that have an intersection.
- pixel(self, label)
- Returns the 2D co-ordinates of the intersection point against the specified world model item in pixel co-ordinates.
The arguments are:
- label label of world item.
The co-ordinates are measured in pixels relative to the top left corner of the
plane, and will be (0,0) if the intersection doesn't exist.
- plane(self, label)
- Returns the 2D co-ordinates of the intersection point against the specified world model item in plane co-ordinates.
The arguments are:
- label label of world item.
The co-ordinates are measured in meters relative to the centre of the
plane, and will be (0,0) if the intersection doesn't exist.
- world(self, label)
- Returns the 3D co-ordinates of the intersection point against the specified world model item in world co-ordinates.
The arguments are:
- label label of world item.
The co-ordinates are measured in meters relative to the world co-ordinate
origin and will be zero if the intersection doesn't exist.
Methods inherited from EngineOutputBase:
- eyeIdName(eye_id)
- Returns a string containing the name of the eye referred to by eye_id.
- setSerialableSubObjectsEnabled(self, valid_objects_ids, recursive=False)
- Set sub-object serialization enabled by object ID.
By default, sub-objects are serializeEnabled() and will be serialized.
Any attached sub-object with an id not in this vector will be
setSerializeEnabled(false) preventing it from being serialized.
The arguments are:
- valid_object_ids The list of object-ids to enable serialization for.
- recursive Whether to recurse into sub-object tree.
Note that only valid objects are recursed into. If
recursive is true then the only sub objects that will
be serialized will be the objects that can be traversed
with all object ids in valid_object_ids.
For example, given the following object graph.
1
|-2
| `4
`-3
|-5
`-6
If this method is called on object marked as 1 and the vector of
objects ids is [3, 4] and recursive is true. Then objects 2 will
be set false, object 4 will be untouched, object 3 will be set true
and obects 5 and 6 will be set false.
The only sub object serialized would be object 3.
- setSerializeEnabled(self, enabled)
- Sets the flag indicating that the object and its children should not be serialized.
Data and other attributes inherited from EngineOutputBase:
- ARRAY_SIZE_2D_DATA = 2
- ARRAY_SIZE_3D_DATA = 3
- ARRAY_SIZE_4D_DATA = 4
- ARRAY_SIZE_PAIR_DATA = 2
Methods inherited from SerializableComposite:
- addSubObject(self, sub_object)
- Adds a child object to this object.
The arguments are:
- sub_object Object to add or None.
This method may raise the following exceptions:
- SerializableError The object id already exists or the
object id is not valid for this object.
- hasSubObjectID(self, object_id)
- Returns true if a child object of that id has been added.
- numOwnDataBytes(self)
- Returns the number of bytes owned by this object excluding any child objects.
- numSubObjects(self)
- Returns the number of child objects added.
- numValidSubObjects(self)
- Returns the number of child objects that serializeEnabled() returns True.
- removeSubObject(self, object_id, index=None)
- Removes a child object if it exists.
Returns a reference to the object if it exists, otherwise,
it returns None.
- subObject(self, object_id)
- Returns the child object for that ID or None
- subObjectAtIndex(self, object_id, index=0)
- Returns the child object for that ID or None
- subObjects(self, object_id=None)
- Returns a VectorSerializable containg the subobjects
Methods inherited from Serializable:
- clone(self)
- Returns a new copy of the object
- extendedHeaderSize(data_size)
- Returns true if an extended header is required for data_size.
- extendedHeaderSizeMagicCookie()
- Returns the 'magic' size value used to indicate that the object's size is held in a uint32.
The old header consisted of:
objectid - uint8
object size - uint16
When the object's size matches the return value from this method then
the header consists of:
objectid - uint8
magic cookie - uint16
object size - uint32
- headerText(self)
- Returns a string containing the column headings for lineText() of the object in a fixed width format.
- lineText(self)
- Returns a string containing the data of the object in a fixed width format.
- minHeaderBytes()
- Returns the minimum number of header bytes that need to be read
to be able to determine if the header is an extended header or not.
This is the number of bytes for the object_id and 16 bit data size.
An extended header the data size field equal to the value returned
from extendedHeaderSizeMagicCookie().
- numDataBytes(self)
- Returns the number of bytes of data required to serialize class.
- numHeaderBytes(data_size)
- Returns the number of header bytes that are written to the buffer by the serialize function before the actual data is appended.
- numTotalBytes(self)
- Returns the total number of bytes required tp serialize the object,
This includes the header and the data bytes.
- objectID(self)
- Identifier for type of object
- readDataSizeHeader(buffer, read_pos_inout)
- Reads the size of the object header from the buffer.
The arguments are:
- buffer The buffer of data.
- read_pos_inout The position within the buffer to read from.
This method returns a tuple consisting of a boolean success indicator and the
size of the header. The success indicator can be false if there is
insufficient data in the buffer.
- serialize(self, buffer)
- Appends to the buffer the object's data.
- serializeEnabled(self)
- Returns whether this object, and its descendents, are to be serialized.
- unSerialize(self, buffer, read_pos_inout)
- Attempts to build the object from the buffer.
The arguments are:
- buffer The buffer of data to use to reconstruct the object
with.
- read_pos_inout The offset into the buffer to start reading data from.
This value must be >= 0.
Returns a tuple consisting of:
- boolean success indicator. The success indicator can be false
if the buffer contained insufficent data in which case the object will be left unmodified.
Otherwise, it returns true when the object was successfully deserialized.
- next read position, only valid if the success indicator is True.
This method may raise the following exceptions:
SerializableError The objectid in buffer does not match this object, or
the data_size in header didn't match amount of data read, or
duplicate sub-object ids were found.
The object may have been partially updated.
- writeHeader(buffer, object_id, data_size)
- Writes a header to the buffer.
The arguments are:
- buffer The buffer of data to append the header to.
- object_id The ID of the object that understands the data.
- data_size The size of the data associated with the header.
|
class HeadOutputData(EngineOutputBase) |
| |
A data class that represents public head-pose related engine data. |
| |
- Method resolution order:
- HeadOutputData
- EngineOutputBase
- SerializableComposite
- Serializable
Methods defined here:
- headEyeBallPos(self, eye_id)
- Returns the positions of the eye balls in world coordinates, calculated
from the head-pose.
The arguments are:
- eye_id The ID for the eye, must be sm.eod.LEFT_EYE or sm.eod.RIGHT_EYE.
The positions of the centre of the eye balls in world coordinates
is derived from the calibrated, or if not available, from the
uncalibrated eye ball positions relative to the head model features.
The values are "filtered" in the same way the head pose is filtered,
that is with the Kalman filter which determines the head pose.
If the system is in search mode, the value is 0.
- headPosition(self)
- Returns the head position as a 3D vector.
The head position vector in the world coordinate system in meters is
stored in these fields. The vector points from the origin of the world
coordinate system to the point in the middle between the centres of the
eye balls. If the system is in search mode, the values are 0.
- headPositionConfidence(self)
- Confidence of head measurement [0..1].
The confidence value produced by the Kalman filter used to calculate
the head pose is stored in this field. A value of 1.0 denotes a high
confidence, a value of 0.0 denotes that the system could not track
the location of the head at all.
If the system is in search mode, the value is 0.
- headRotation(self)
- Returns the head rotation as a 3D vector.
The Euler angles in radians which describe the rotation of the head
coordinate system with respect to the world coordinate system are
stored in these fields.
If the system is in search mode, the values are 0.
- modelQualityLevel(self)
- Returns the current value of the head-model quality as an int. A higher
model quality means that it will track more accurately.
- setHeadEyeballPos(self, eye_id, eyeball_pos)
- Set the position of the eyeball centre for a given eye.
The arguments are:
- eye_id The ID for the eye, must be sm.eod.LEFT_EYE or sm.eod.RIGHT_EYE.
- eyeball_pos The 3D position [X,Y,Z] in metres in the world co-ordinate frame.
- setHeadPosition(self, pos)
- Set the 3D head position.
The arguments are:
- pos The 3D head position [X,Y,Z] in metres in the world co-ordinate frame.
- setHeadPositionConfidence(self, confidence)
- Sets the tracking flag.
The arguments are:
- confidence float value in the range 0..1
- setHeadRotation(self, rotation)
- Sets the 3D head rotation.
The arguments are:
- rotation the 3D head rotation euler angles [X,Y,Z]
in radians in the world co-ordinate frame
- setModelQualityLevel(self, model_quality)
- Set the model quality level.
The arguments are:
- model_quality The current model quality as an int.
- setTrackingState(self, tracking_state)
- Sets the tracking flag.
The arguments are:
- tracking_state 0 if not tracking, otherwise 1.
- trackingState(self)
- Returns the head tracking state.
The state of the head tracker is encoded in this enum.
If the system is in tracking mode, ie. the head is tracked
successfully, the value is TRACKING, and if the system is in
search mode the value is SEARCHING.
NOTE: In search mode, when this field is set to SEARCHINBG, most data
fields that contain information on the tracking do not contain
valid data and are set to 0.
Data and other attributes defined here:
- SEARCHING = 0
- THIS_OBJECT_ID = 11
- TRACKING = 1
Methods inherited from EngineOutputBase:
- eyeIdName(eye_id)
- Returns a string containing the name of the eye referred to by eye_id.
- setSerialableSubObjectsEnabled(self, valid_objects_ids, recursive=False)
- Set sub-object serialization enabled by object ID.
By default, sub-objects are serializeEnabled() and will be serialized.
Any attached sub-object with an id not in this vector will be
setSerializeEnabled(false) preventing it from being serialized.
The arguments are:
- valid_object_ids The list of object-ids to enable serialization for.
- recursive Whether to recurse into sub-object tree.
Note that only valid objects are recursed into. If
recursive is true then the only sub objects that will
be serialized will be the objects that can be traversed
with all object ids in valid_object_ids.
For example, given the following object graph.
1
|-2
| `4
`-3
|-5
`-6
If this method is called on object marked as 1 and the vector of
objects ids is [3, 4] and recursive is true. Then objects 2 will
be set false, object 4 will be untouched, object 3 will be set true
and obects 5 and 6 will be set false.
The only sub object serialized would be object 3.
- setSerializeEnabled(self, enabled)
- Sets the flag indicating that the object and its children should not be serialized.
Data and other attributes inherited from EngineOutputBase:
- ARRAY_SIZE_2D_DATA = 2
- ARRAY_SIZE_3D_DATA = 3
- ARRAY_SIZE_4D_DATA = 4
- ARRAY_SIZE_PAIR_DATA = 2
Methods inherited from SerializableComposite:
- addSubObject(self, sub_object)
- Adds a child object to this object.
The arguments are:
- sub_object Object to add or None.
This method may raise the following exceptions:
- SerializableError The object id already exists or the
object id is not valid for this object.
- hasSubObjectID(self, object_id)
- Returns true if a child object of that id has been added.
- numOwnDataBytes(self)
- Returns the number of bytes owned by this object excluding any child objects.
- numSubObjects(self)
- Returns the number of child objects added.
- numValidSubObjects(self)
- Returns the number of child objects that serializeEnabled() returns True.
- removeSubObject(self, object_id, index=None)
- Removes a child object if it exists.
Returns a reference to the object if it exists, otherwise,
it returns None.
- subObject(self, object_id)
- Returns the child object for that ID or None
- subObjectAtIndex(self, object_id, index=0)
- Returns the child object for that ID or None
- subObjects(self, object_id=None)
- Returns a VectorSerializable containg the subobjects
Methods inherited from Serializable:
- clone(self)
- Returns a new copy of the object
- extendedHeaderSize(data_size)
- Returns true if an extended header is required for data_size.
- extendedHeaderSizeMagicCookie()
- Returns the 'magic' size value used to indicate that the object's size is held in a uint32.
The old header consisted of:
objectid - uint8
object size - uint16
When the object's size matches the return value from this method then
the header consists of:
objectid - uint8
magic cookie - uint16
object size - uint32
- headerText(self)
- Returns a string containing the column headings for lineText() of the object in a fixed width format.
- lineText(self)
- Returns a string containing the data of the object in a fixed width format.
- minHeaderBytes()
- Returns the minimum number of header bytes that need to be read
to be able to determine if the header is an extended header or not.
This is the number of bytes for the object_id and 16 bit data size.
An extended header the data size field equal to the value returned
from extendedHeaderSizeMagicCookie().
- numDataBytes(self)
- Returns the number of bytes of data required to serialize class.
- numHeaderBytes(data_size)
- Returns the number of header bytes that are written to the buffer by the serialize function before the actual data is appended.
- numTotalBytes(self)
- Returns the total number of bytes required tp serialize the object,
This includes the header and the data bytes.
- objectID(self)
- Identifier for type of object
- readDataSizeHeader(buffer, read_pos_inout)
- Reads the size of the object header from the buffer.
The arguments are:
- buffer The buffer of data.
- read_pos_inout The position within the buffer to read from.
This method returns a tuple consisting of a boolean success indicator and the
size of the header. The success indicator can be false if there is
insufficient data in the buffer.
- serialize(self, buffer)
- Appends to the buffer the object's data.
- serializeEnabled(self)
- Returns whether this object, and its descendents, are to be serialized.
- unSerialize(self, buffer, read_pos_inout)
- Attempts to build the object from the buffer.
The arguments are:
- buffer The buffer of data to use to reconstruct the object
with.
- read_pos_inout The offset into the buffer to start reading data from.
This value must be >= 0.
Returns a tuple consisting of:
- boolean success indicator. The success indicator can be false
if the buffer contained insufficent data in which case the object will be left unmodified.
Otherwise, it returns true when the object was successfully deserialized.
- next read position, only valid if the success indicator is True.
This method may raise the following exceptions:
SerializableError The objectid in buffer does not match this object, or
the data_size in header didn't match amount of data read, or
duplicate sub-object ids were found.
The object may have been partially updated.
- writeHeader(buffer, object_id, data_size)
- Writes a header to the buffer.
The arguments are:
- buffer The buffer of data to append the header to.
- object_id The ID of the object that understands the data.
- data_size The size of the data associated with the header.
|
class HeadOutputDataV2(EngineOutputBase) |
| |
A data class that represents public head-pose related engine data. |
| |
- Method resolution order:
- HeadOutputDataV2
- EngineOutputBase
- SerializableComposite
- Serializable
Methods defined here:
- __init__(self)
- All members zeroed.
- headEyeBallPos(self, eye_id)
- Returns the positions of the eye balls in world coordinates, calculated
from the head-pose.
The arguments are:
- eye_id The ID for the eye, must be sm.eod.LEFT_EYE or sm.eod.RIGHT_EYE.
The positions of the centre of the eye balls in world coordinates
is derived from the calibrated, or if not available, from the
uncalibrated eye ball positions relative to the head model features.
The values are "filtered" in the same way the head pose is filtered,
that is with the Kalman filter which determines the head pose.
If the system is in search mode, the value is 0.
- headPosition(self)
- Returns the head position as a 3D vector.
The head position vector in the world coordinate system in meters is
stored in these fields. The vector points from the origin of the world
coordinate system to the point in the middle between the centres of the
eye balls. If the system is in search mode, the values are 0.
- headPositionConfidence(self)
- Confidence of head measurement [0..1].
The confidence value used to calculate
the head pose is stored in this field. A value of 1.0 denotes a high
confidence, a value of 0.0 denotes that the system could not track
the location of the head at all.
If the system is in search mode, the value is 0.
- headRotation(self)
- Returns the head rotation as a 3D vector.
The Euler angles in radians which describe the rotation of the head
coordinate system with respect to the world coordinate system are
stored in these fields.
The head rotation value is stored internally using a Quaternion. It
is converted to Euler angles by this method before being returned.
If the system is in search mode, the values are 0.
For information on converting Quaternions to Euler angles refer to
http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles
- isTracking(self)
- Returns true if the head is tracking.
If the system is tracking the head this returns true. For
more detailed engine state information refer to EngineStateOutputData.
NOTE: If not tracking, most data fields do not contain
valid data and are set to 0.
- modelQualityLevel(self)
- Returns the current value of the head-model quality as an int. A higher
model quality means that it will track more accurately.
- setHeadEyeballPos(self, eye_id, eyeball_pos)
- Set the position of the eyeball centre for a given eye.
The arguments are:
- eye_id The ID for the eye, must be sm.eod.LEFT_EYE or sm.eod.RIGHT_EYE.
- eyeball_pos The 3D position [X,Y,Z] in metres in the world co-ordinate frame.
- setHeadPosition(self, pos)
- Set the 3D head position.
The arguments are:
- pos the 3D head position [X,Y,Z] in metres in the world co-ordinate frame.
- setHeadPositionConfidence(self, confidence)
- Sets the tracking flag.
The arguments are:
- confidence float value in the range 0..1
- setHeadRotation(self, rotation)
- Sets the 3D head rotation.
The arguments are:
- rotation the 3D head rotation euler angles [X,Y,Z]
in radians in the world co-ordinate frame
- setHeadRotationQuaternion(self, rotation)
- Sets the 3D head rotation with a quaternion [q0, q1, q2, q3].
The arguments are:
- rotation the 4D head rotation unit quaternion [q0, q1, q2, q3]
- setModelQualityLevel(self, model_quality)
- Set the model quality level.
The arguments are:
- model_quality The current model quality as an int.
- setTrackingState(self, tracking_state)
- Sets the tracking flag.
The arguments are:
- tracking_state False if not tracking, otherwise True.
Data and other attributes defined here:
- THIS_OBJECT_ID = 16
Methods inherited from EngineOutputBase:
- eyeIdName(eye_id)
- Returns a string containing the name of the eye referred to by eye_id.
- setSerialableSubObjectsEnabled(self, valid_objects_ids, recursive=False)
- Set sub-object serialization enabled by object ID.
By default, sub-objects are serializeEnabled() and will be serialized.
Any attached sub-object with an id not in this vector will be
setSerializeEnabled(false) preventing it from being serialized.
The arguments are:
- valid_object_ids The list of object-ids to enable serialization for.
- recursive Whether to recurse into sub-object tree.
Note that only valid objects are recursed into. If
recursive is true then the only sub objects that will
be serialized will be the objects that can be traversed
with all object ids in valid_object_ids.
For example, given the following object graph.
1
|-2
| `4
`-3
|-5
`-6
If this method is called on object marked as 1 and the vector of
objects ids is [3, 4] and recursive is true. Then objects 2 will
be set false, object 4 will be untouched, object 3 will be set true
and obects 5 and 6 will be set false.
The only sub object serialized would be object 3.
- setSerializeEnabled(self, enabled)
- Sets the flag indicating that the object and its children should not be serialized.
Data and other attributes inherited from EngineOutputBase:
- ARRAY_SIZE_2D_DATA = 2
- ARRAY_SIZE_3D_DATA = 3
- ARRAY_SIZE_4D_DATA = 4
- ARRAY_SIZE_PAIR_DATA = 2
Methods inherited from SerializableComposite:
- addSubObject(self, sub_object)
- Adds a child object to this object.
The arguments are:
- sub_object Object to add or None.
This method may raise the following exceptions:
- SerializableError The object id already exists or the
object id is not valid for this object.
- hasSubObjectID(self, object_id)
- Returns true if a child object of that id has been added.
- numOwnDataBytes(self)
- Returns the number of bytes owned by this object excluding any child objects.
- numSubObjects(self)
- Returns the number of child objects added.
- numValidSubObjects(self)
- Returns the number of child objects that serializeEnabled() returns True.
- removeSubObject(self, object_id, index=None)
- Removes a child object if it exists.
Returns a reference to the object if it exists, otherwise,
it returns None.
- subObject(self, object_id)
- Returns the child object for that ID or None
- subObjectAtIndex(self, object_id, index=0)
- Returns the child object for that ID or None
- subObjects(self, object_id=None)
- Returns a VectorSerializable containg the subobjects
Methods inherited from Serializable:
- clone(self)
- Returns a new copy of the object
- extendedHeaderSize(data_size)
- Returns true if an extended header is required for data_size.
- extendedHeaderSizeMagicCookie()
- Returns the 'magic' size value used to indicate that the object's size is held in a uint32.
The old header consisted of:
objectid - uint8
object size - uint16
When the object's size matches the return value from this method then
the header consists of:
objectid - uint8
magic cookie - uint16
object size - uint32
- headerText(self)
- Returns a string containing the column headings for lineText() of the object in a fixed width format.
- lineText(self)
- Returns a string containing the data of the object in a fixed width format.
- minHeaderBytes()
- Returns the minimum number of header bytes that need to be read
to be able to determine if the header is an extended header or not.
This is the number of bytes for the object_id and 16 bit data size.
An extended header the data size field equal to the value returned
from extendedHeaderSizeMagicCookie().
- numDataBytes(self)
- Returns the number of bytes of data required to serialize class.
- numHeaderBytes(data_size)
- Returns the number of header bytes that are written to the buffer by the serialize function before the actual data is appended.
- numTotalBytes(self)
- Returns the total number of bytes required tp serialize the object,
This includes the header and the data bytes.
- objectID(self)
- Identifier for type of object
- readDataSizeHeader(buffer, read_pos_inout)
- Reads the size of the object header from the buffer.
The arguments are:
- buffer The buffer of data.
- read_pos_inout The position within the buffer to read from.
This method returns a tuple consisting of a boolean success indicator and the
size of the header. The success indicator can be false if there is
insufficient data in the buffer.
- serialize(self, buffer)
- Appends to the buffer the object's data.
- serializeEnabled(self)
- Returns whether this object, and its descendents, are to be serialized.
- unSerialize(self, buffer, read_pos_inout)
- Attempts to build the object from the buffer.
The arguments are:
- buffer The buffer of data to use to reconstruct the object
with.
- read_pos_inout The offset into the buffer to start reading data from.
This value must be >= 0.
Returns a tuple consisting of:
- boolean success indicator. The success indicator can be false
if the buffer contained insufficent data in which case the object will be left unmodified.
Otherwise, it returns true when the object was successfully deserialized.
- next read position, only valid if the success indicator is True.
This method may raise the following exceptions:
SerializableError The objectid in buffer does not match this object, or
the data_size in header didn't match amount of data read, or
duplicate sub-object ids were found.
The object may have been partially updated.
- writeHeader(buffer, object_id, data_size)
- Writes a header to the buffer.
The arguments are:
- buffer The buffer of data to append the header to.
- object_id The ID of the object that understands the data.
- data_size The size of the data associated with the header.
|
class HeadTrackerStateOutputData(EngineOutputBase) |
| |
Contains status information produced by all types of head-trackers. |
| |
- Method resolution order:
- HeadTrackerStateOutputData
- EngineOutputBase
- SerializableComposite
- Serializable
Methods defined here:
- __init__(self, state=-1)
- Initializes instance.
- setState(self, state)
- Sets the current state.
The arguments are:
- state One of the constants INVALID,
IDLE, BRIGHTNESS_CONTROL, AUTO_INIT,
SEARCH, TRACK.
- state(self)
- Returns the state. One of the constants INVALID,
IDLE, BRIGHTNESS_CONTROL, AUTO_INIT, SEARCH, TRACK.
Data and other attributes defined here:
- AUTO_INIT = 2
- BRIGHTNESS_CONTROL = 1
- IDLE = 0
- INVALID = -1
- SEARCH = 3
- THIS_OBJECT_ID = 41
- TRACK = 4
Methods inherited from EngineOutputBase:
- eyeIdName(eye_id)
- Returns a string containing the name of the eye referred to by eye_id.
- setSerialableSubObjectsEnabled(self, valid_objects_ids, recursive=False)
- Set sub-object serialization enabled by object ID.
By default, sub-objects are serializeEnabled() and will be serialized.
Any attached sub-object with an id not in this vector will be
setSerializeEnabled(false) preventing it from being serialized.
The arguments are:
- valid_object_ids The list of object-ids to enable serialization for.
- recursive Whether to recurse into sub-object tree.
Note that only valid objects are recursed into. If
recursive is true then the only sub objects that will
be serialized will be the objects that can be traversed
with all object ids in valid_object_ids.
For example, given the following object graph.
1
|-2
| `4
`-3
|-5
`-6
If this method is called on object marked as 1 and the vector of
objects ids is [3, 4] and recursive is true. Then objects 2 will
be set false, object 4 will be untouched, object 3 will be set true
and obects 5 and 6 will be set false.
The only sub object serialized would be object 3.
- setSerializeEnabled(self, enabled)
- Sets the flag indicating that the object and its children should not be serialized.
Data and other attributes inherited from EngineOutputBase:
- ARRAY_SIZE_2D_DATA = 2
- ARRAY_SIZE_3D_DATA = 3
- ARRAY_SIZE_4D_DATA = 4
- ARRAY_SIZE_PAIR_DATA = 2
Methods inherited from SerializableComposite:
- addSubObject(self, sub_object)
- Adds a child object to this object.
The arguments are:
- sub_object Object to add or None.
This method may raise the following exceptions:
- SerializableError The object id already exists or the
object id is not valid for this object.
- hasSubObjectID(self, object_id)
- Returns true if a child object of that id has been added.
- numOwnDataBytes(self)
- Returns the number of bytes owned by this object excluding any child objects.
- numSubObjects(self)
- Returns the number of child objects added.
- numValidSubObjects(self)
- Returns the number of child objects that serializeEnabled() returns True.
- removeSubObject(self, object_id, index=None)
- Removes a child object if it exists.
Returns a reference to the object if it exists, otherwise,
it returns None.
- subObject(self, object_id)
- Returns the child object for that ID or None
- subObjectAtIndex(self, object_id, index=0)
- Returns the child object for that ID or None
- subObjects(self, object_id=None)
- Returns a VectorSerializable containg the subobjects
Methods inherited from Serializable:
- clone(self)
- Returns a new copy of the object
- extendedHeaderSize(data_size)
- Returns true if an extended header is required for data_size.
- extendedHeaderSizeMagicCookie()
- Returns the 'magic' size value used to indicate that the object's size is held in a uint32.
The old header consisted of:
objectid - uint8
object size - uint16
When the object's size matches the return value from this method then
the header consists of:
objectid - uint8
magic cookie - uint16
object size - uint32
- headerText(self)
- Returns a string containing the column headings for lineText() of the object in a fixed width format.
- lineText(self)
- Returns a string containing the data of the object in a fixed width format.
- minHeaderBytes()
- Returns the minimum number of header bytes that need to be read
to be able to determine if the header is an extended header or not.
This is the number of bytes for the object_id and 16 bit data size.
An extended header the data size field equal to the value returned
from extendedHeaderSizeMagicCookie().
- numDataBytes(self)
- Returns the number of bytes of data required to serialize class.
- numHeaderBytes(data_size)
- Returns the number of header bytes that are written to the buffer by the serialize function before the actual data is appended.
- numTotalBytes(self)
- Returns the total number of bytes required tp serialize the object,
This includes the header and the data bytes.
- objectID(self)
- Identifier for type of object
- readDataSizeHeader(buffer, read_pos_inout)
- Reads the size of the object header from the buffer.
The arguments are:
- buffer The buffer of data.
- read_pos_inout The position within the buffer to read from.
This method returns a tuple consisting of a boolean success indicator and the
size of the header. The success indicator can be false if there is
insufficient data in the buffer.
- serialize(self, buffer)
- Appends to the buffer the object's data.
- serializeEnabled(self)
- Returns whether this object, and its descendents, are to be serialized.
- unSerialize(self, buffer, read_pos_inout)
- Attempts to build the object from the buffer.
The arguments are:
- buffer The buffer of data to use to reconstruct the object
with.
- read_pos_inout The offset into the buffer to start reading data from.
This value must be >= 0.
Returns a tuple consisting of:
- boolean success indicator. The success indicator can be false
if the buffer contained insufficent data in which case the object will be left unmodified.
Otherwise, it returns true when the object was successfully deserialized.
- next read position, only valid if the success indicator is True.
This method may raise the following exceptions:
SerializableError The objectid in buffer does not match this object, or
the data_size in header didn't match amount of data read, or
duplicate sub-object ids were found.
The object may have been partially updated.
- writeHeader(buffer, object_id, data_size)
- Writes a header to the buffer.
The arguments are:
- buffer The buffer of data to append the header to.
- object_id The ID of the object that understands the data.
- data_size The size of the data associated with the header.
|
class IRPodStateOutputData(EngineOutputBase) |
| |
Contains status information produced by a software controlled IR pod.
This class appears as a potential sub-object attached to EngineStateOutputData. |
| |
- Method resolution order:
- IRPodStateOutputData
- EngineOutputBase
- SerializableComposite
- Serializable
Methods defined here:
- __init__(self, state=0, position=None)
- Initializes instance.
The arguments are:
- state The state of the IR pod.
- position The position of the IR pod [X,Y,Z] in metres in the world co-ordinate frame.
- position(self)
- Returns the 3D position of the IR pod in metres in the world co-ordinate frame.
- setPosition(self, pos)
- Set the 3D position of the IR pod.
The arguments are:
- position The 3D position [X,Y,Z] in metres in the world co-ordinate frame.
- setState(self, label)
- Sets the IR pod state.
The arguments are:
- state One of the constants ON or OFF.
- state(self)
- Returns the IR Pod state. ON or OFF.
Data and other attributes defined here:
- OFF = 0
- ON = 1
- THIS_OBJECT_ID = 42
Methods inherited from EngineOutputBase:
- eyeIdName(eye_id)
- Returns a string containing the name of the eye referred to by eye_id.
- setSerialableSubObjectsEnabled(self, valid_objects_ids, recursive=False)
- Set sub-object serialization enabled by object ID.
By default, sub-objects are serializeEnabled() and will be serialized.
Any attached sub-object with an id not in this vector will be
setSerializeEnabled(false) preventing it from being serialized.
The arguments are:
- valid_object_ids The list of object-ids to enable serialization for.
- recursive Whether to recurse into sub-object tree.
Note that only valid objects are recursed into. If
recursive is true then the only sub objects that will
be serialized will be the objects that can be traversed
with all object ids in valid_object_ids.
For example, given the following object graph.
1
|-2
| `4
`-3
|-5
`-6
If this method is called on object marked as 1 and the vector of
objects ids is [3, 4] and recursive is true. Then objects 2 will
be set false, object 4 will be untouched, object 3 will be set true
and obects 5 and 6 will be set false.
The only sub object serialized would be object 3.
- setSerializeEnabled(self, enabled)
- Sets the flag indicating that the object and its children should not be serialized.
Data and other attributes inherited from EngineOutputBase:
- ARRAY_SIZE_2D_DATA = 2
- ARRAY_SIZE_3D_DATA = 3
- ARRAY_SIZE_4D_DATA = 4
- ARRAY_SIZE_PAIR_DATA = 2
Methods inherited from SerializableComposite:
- addSubObject(self, sub_object)
- Adds a child object to this object.
The arguments are:
- sub_object Object to add or None.
This method may raise the following exceptions:
- SerializableError The object id already exists or the
object id is not valid for this object.
- hasSubObjectID(self, object_id)
- Returns true if a child object of that id has been added.
- numOwnDataBytes(self)
- Returns the number of bytes owned by this object excluding any child objects.
- numSubObjects(self)
- Returns the number of child objects added.
- numValidSubObjects(self)
- Returns the number of child objects that serializeEnabled() returns True.
- removeSubObject(self, object_id, index=None)
- Removes a child object if it exists.
Returns a reference to the object if it exists, otherwise,
it returns None.
- subObject(self, object_id)
- Returns the child object for that ID or None
- subObjectAtIndex(self, object_id, index=0)
- Returns the child object for that ID or None
- subObjects(self, object_id=None)
- Returns a VectorSerializable containg the subobjects
Methods inherited from Serializable:
- clone(self)
- Returns a new copy of the object
- extendedHeaderSize(data_size)
- Returns true if an extended header is required for data_size.
- extendedHeaderSizeMagicCookie()
- Returns the 'magic' size value used to indicate that the object's size is held in a uint32.
The old header consisted of:
objectid - uint8
object size - uint16
When the object's size matches the return value from this method then
the header consists of:
objectid - uint8
magic cookie - uint16
object size - uint32
- headerText(self)
- Returns a string containing the column headings for lineText() of the object in a fixed width format.
- lineText(self)
- Returns a string containing the data of the object in a fixed width format.
- minHeaderBytes()
- Returns the minimum number of header bytes that need to be read
to be able to determine if the header is an extended header or not.
This is the number of bytes for the object_id and 16 bit data size.
An extended header the data size field equal to the value returned
from extendedHeaderSizeMagicCookie().
- numDataBytes(self)
- Returns the number of bytes of data required to serialize class.
- numHeaderBytes(data_size)
- Returns the number of header bytes that are written to the buffer by the serialize function before the actual data is appended.
- numTotalBytes(self)
- Returns the total number of bytes required tp serialize the object,
This includes the header and the data bytes.
- objectID(self)
- Identifier for type of object
- readDataSizeHeader(buffer, read_pos_inout)
- Reads the size of the object header from the buffer.
The arguments are:
- buffer The buffer of data.
- read_pos_inout The position within the buffer to read from.
This method returns a tuple consisting of a boolean success indicator and the
size of the header. The success indicator can be false if there is
insufficient data in the buffer.
- serialize(self, buffer)
- Appends to the buffer the object's data.
- serializeEnabled(self)
- Returns whether this object, and its descendents, are to be serialized.
- unSerialize(self, buffer, read_pos_inout)
- Attempts to build the object from the buffer.
The arguments are:
- buffer The buffer of data to use to reconstruct the object
with.
- read_pos_inout The offset into the buffer to start reading data from.
This value must be >= 0.
Returns a tuple consisting of:
- boolean success indicator. The success indicator can be false
if the buffer contained insufficent data in which case the object will be left unmodified.
Otherwise, it returns true when the object was successfully deserialized.
- next read position, only valid if the success indicator is True.
This method may raise the following exceptions:
SerializableError The objectid in buffer does not match this object, or
the data_size in header didn't match amount of data read, or
duplicate sub-object ids were found.
The object may have been partially updated.
- writeHeader(buffer, object_id, data_size)
- Writes a header to the buffer.
The arguments are:
- buffer The buffer of data to append the header to.
- object_id The ID of the object that understands the data.
- data_size The size of the data associated with the header.
|
class ImageCollectionOutputData(EngineOutputBase) |
| |
A data class that represents a collection of images output by the Tracking Engine. |
| |
- Method resolution order:
- ImageCollectionOutputData
- EngineOutputBase
- SerializableComposite
- Serializable
Methods defined here:
- __init__(self)
- All members zeroed.
- addImage(self, image)
- Adds an image to the collection.
The arguments are:
- image The not None ImageOutputData instance to add
to the collection. It must not already have
been added to this collection.
- clear(self)
- Removes all images from the collection.
- findImageIndex(self, image_identifier)
- Returns the index of the image with the identifier or -1 if not found.
The arguments are:
- image_identifier The identifier for an image.
- image(self, index)
- Returns the ImageOutputData instance at index.
The arguments are:
- index Zero based index as an int. Must be smaller than
numImages().
- numImages(self)
- Returns the the number of images.
- removeImage(self, image)
- Removes an image from the collection.
The arguments are:
- image The not None ImageOutputData, or image identifier to remove.
Returns True if the image was in the collection.
Data and other attributes defined here:
- THIS_OBJECT_ID = 30
Methods inherited from EngineOutputBase:
- eyeIdName(eye_id)
- Returns a string containing the name of the eye referred to by eye_id.
- setSerialableSubObjectsEnabled(self, valid_objects_ids, recursive=False)
- Set sub-object serialization enabled by object ID.
By default, sub-objects are serializeEnabled() and will be serialized.
Any attached sub-object with an id not in this vector will be
setSerializeEnabled(false) preventing it from being serialized.
The arguments are:
- valid_object_ids The list of object-ids to enable serialization for.
- recursive Whether to recurse into sub-object tree.
Note that only valid objects are recursed into. If
recursive is true then the only sub objects that will
be serialized will be the objects that can be traversed
with all object ids in valid_object_ids.
For example, given the following object graph.
1
|-2
| `4
`-3
|-5
`-6
If this method is called on object marked as 1 and the vector of
objects ids is [3, 4] and recursive is true. Then objects 2 will
be set false, object 4 will be untouched, object 3 will be set true
and obects 5 and 6 will be set false.
The only sub object serialized would be object 3.
- setSerializeEnabled(self, enabled)
- Sets the flag indicating that the object and its children should not be serialized.
Data and other attributes inherited from EngineOutputBase:
- ARRAY_SIZE_2D_DATA = 2
- ARRAY_SIZE_3D_DATA = 3
- ARRAY_SIZE_4D_DATA = 4
- ARRAY_SIZE_PAIR_DATA = 2
Methods inherited from SerializableComposite:
- addSubObject(self, sub_object)
- Adds a child object to this object.
The arguments are:
- sub_object Object to add or None.
This method may raise the following exceptions:
- SerializableError The object id already exists or the
object id is not valid for this object.
- hasSubObjectID(self, object_id)
- Returns true if a child object of that id has been added.
- numOwnDataBytes(self)
- Returns the number of bytes owned by this object excluding any child objects.
- numSubObjects(self)
- Returns the number of child objects added.
- numValidSubObjects(self)
- Returns the number of child objects that serializeEnabled() returns True.
- removeSubObject(self, object_id, index=None)
- Removes a child object if it exists.
Returns a reference to the object if it exists, otherwise,
it returns None.
- subObject(self, object_id)
- Returns the child object for that ID or None
- subObjectAtIndex(self, object_id, index=0)
- Returns the child object for that ID or None
- subObjects(self, object_id=None)
- Returns a VectorSerializable containg the subobjects
Methods inherited from Serializable:
- clone(self)
- Returns a new copy of the object
- extendedHeaderSize(data_size)
- Returns true if an extended header is required for data_size.
- extendedHeaderSizeMagicCookie()
- Returns the 'magic' size value used to indicate that the object's size is held in a uint32.
The old header consisted of:
objectid - uint8
object size - uint16
When the object's size matches the return value from this method then
the header consists of:
objectid - uint8
magic cookie - uint16
object size - uint32
- headerText(self)
- Returns a string containing the column headings for lineText() of the object in a fixed width format.
- lineText(self)
- Returns a string containing the data of the object in a fixed width format.
- minHeaderBytes()
- Returns the minimum number of header bytes that need to be read
to be able to determine if the header is an extended header or not.
This is the number of bytes for the object_id and 16 bit data size.
An extended header the data size field equal to the value returned
from extendedHeaderSizeMagicCookie().
- numDataBytes(self)
- Returns the number of bytes of data required to serialize class.
- numHeaderBytes(data_size)
- Returns the number of header bytes that are written to the buffer by the serialize function before the actual data is appended.
- numTotalBytes(self)
- Returns the total number of bytes required tp serialize the object,
This includes the header and the data bytes.
- objectID(self)
- Identifier for type of object
- readDataSizeHeader(buffer, read_pos_inout)
- Reads the size of the object header from the buffer.
The arguments are:
- buffer The buffer of data.
- read_pos_inout The position within the buffer to read from.
This method returns a tuple consisting of a boolean success indicator and the
size of the header. The success indicator can be false if there is
insufficient data in the buffer.
- serialize(self, buffer)
- Appends to the buffer the object's data.
- serializeEnabled(self)
- Returns whether this object, and its descendents, are to be serialized.
- unSerialize(self, buffer, read_pos_inout)
- Attempts to build the object from the buffer.
The arguments are:
- buffer The buffer of data to use to reconstruct the object
with.
- read_pos_inout The offset into the buffer to start reading data from.
This value must be >= 0.
Returns a tuple consisting of:
- boolean success indicator. The success indicator can be false
if the buffer contained insufficent data in which case the object will be left unmodified.
Otherwise, it returns true when the object was successfully deserialized.
- next read position, only valid if the success indicator is True.
This method may raise the following exceptions:
SerializableError The objectid in buffer does not match this object, or
the data_size in header didn't match amount of data read, or
duplicate sub-object ids were found.
The object may have been partially updated.
- writeHeader(buffer, object_id, data_size)
- Writes a header to the buffer.
The arguments are:
- buffer The buffer of data to append the header to.
- object_id The ID of the object that understands the data.
- data_size The size of the data associated with the header.
|
class ImageOutputData(Serializable) |
| |
A data class that represents an image output by the Tracking Engine. |
| |
Methods defined here:
- __init__(self)
- All members zeroed.
- bytesPerLine(self)
- Returns the positive stride in bytes between two lines.
- height(self)
- Returns the height of the image in pixels.
- imageFormat(self)
- Returns the format of the image.
- imageIdentifier(self)
- Returns a string used to identify an image.
Images can be associated with an identifier. This can
be used to identify images such as raw image or a data image.
- rawData(self)
- Returns the raw data as a string.
- setImageIdentifier(self, label)
- Sets a string used to identify an image.
The arguments are:
- image_identifier A string used to identify the image
see imageIdentifier().
- setNewImage(self, width, height, bytes_per_line, raw_data, image_format)
- Allocates a new block of aligned memory copying the raw data.
The arguments are:
- width Width of the image in pixels.
- height Height of the image in pixels.
- bytes_per_line The number of bytes between to rows of the image.
- raw_data String holding the raw data.
- image_format The format of the image. See GRAY_8U, RGB_24U.
- width(self)
- Returns the width of the image in pixels.
Data and other attributes defined here:
- GRAY_8U = 808466521
- RGB_24U = 21
- THIS_OBJECT_ID = 31
Methods inherited from Serializable:
- clone(self)
- Returns a new copy of the object
- extendedHeaderSize(data_size)
- Returns true if an extended header is required for data_size.
- extendedHeaderSizeMagicCookie()
- Returns the 'magic' size value used to indicate that the object's size is held in a uint32.
The old header consisted of:
objectid - uint8
object size - uint16
When the object's size matches the return value from this method then
the header consists of:
objectid - uint8
magic cookie - uint16
object size - uint32
- headerText(self)
- Returns a string containing the column headings for lineText() of the object in a fixed width format.
- lineText(self)
- Returns a string containing the data of the object in a fixed width format.
- minHeaderBytes()
- Returns the minimum number of header bytes that need to be read
to be able to determine if the header is an extended header or not.
This is the number of bytes for the object_id and 16 bit data size.
An extended header the data size field equal to the value returned
from extendedHeaderSizeMagicCookie().
- numDataBytes(self)
- Returns the number of bytes of data required to serialize class.
- numHeaderBytes(data_size)
- Returns the number of header bytes that are written to the buffer by the serialize function before the actual data is appended.
- numTotalBytes(self)
- Returns the total number of bytes required tp serialize the object,
This includes the header and the data bytes.
- objectID(self)
- Identifier for type of object
- readDataSizeHeader(buffer, read_pos_inout)
- Reads the size of the object header from the buffer.
The arguments are:
- buffer The buffer of data.
- read_pos_inout The position within the buffer to read from.
This method returns a tuple consisting of a boolean success indicator and the
size of the header. The success indicator can be false if there is
insufficient data in the buffer.
- serialize(self, buffer)
- Appends to the buffer the object's data.
- serializeEnabled(self)
- Returns whether this object, and its descendents, are to be serialized.
- unSerialize(self, buffer, read_pos_inout)
- Attempts to build the object from the buffer.
The arguments are:
- buffer The buffer of data to use to reconstruct the object
with.
- read_pos_inout The offset into the buffer to start reading data from.
This value must be >= 0.
Returns a tuple consisting of:
- boolean success indicator. The success indicator can be false
if the buffer contained insufficent data in which case the object will be left unmodified.
Otherwise, it returns true when the object was successfully deserialized.
- next read position, only valid if the success indicator is True.
This method may raise the following exceptions:
SerializableError The objectid in buffer does not match this object, or
the data_size in header didn't match amount of data read, or
duplicate sub-object ids were found.
The object may have been partially updated.
- writeHeader(buffer, object_id, data_size)
- Writes a header to the buffer.
The arguments are:
- buffer The buffer of data to append the header to.
- object_id The ID of the object that understands the data.
- data_size The size of the data associated with the header.
|
class InertiaOutputData(EngineOutputBase) |
| |
Data class that represents intertia data. |
| |
- Method resolution order:
- InertiaOutputData
- EngineOutputBase
- SerializableComposite
- Serializable
Methods defined here:
- __init__(self)
- All members zeroed.
- accelX(self)
- Returns the acceleration along X-axis in Gs as a float.
- accelY(self)
- Returns the acceleration along Y-axis in Gs as a float.
- accelZ(self)
- Returns the acceleration along Z-axis in Gs as a float.
- angularRateX(self)
- Returns the angular rate along X-axis in radians per second.
- angularRateY(self)
- Returns the angular rate along Y-axis in radians per second.
- angularRateZ(self)
- Returns the angular rate along Z-axis in radians per second.
- setAccelX(self, value)
- Sets the acceleration along X-axis in Gs as a float.
The arguments are:
- value The acceleration as a float in Gs.
- setAccelY(self, value)
- Sets the acceleration along Y-axis in Gs as a float.
The arguments are:
- value The acceleration as a float in Gs.
- setAccelZ(self, value)
- Sets the acceleration along Z-axis in Gs as a float.
The arguments are:
- value The acceleration as a float in Gs.
- setAngularRateX(self, rate)
- Sets the angular rate along X-axis in radians per second.
The arguments are:
- rate The rate as a float in radians per second.
- setAngularRateY(self, rate)
- Sets the angular rate along Y-axis in radians per second.
The arguments are:
- rate The rate as a float in radians per second.