data_structs submodule

This module contains definitions of data objects and enumerations sent to and received from the robot.

class navel.data_structs.Bbox2d(x1, y1, x2, y2)

Bases: object

Describes a bounding box with two 2D points.

Sets the limits of a bounding Box located in an image. The bounding box limits are described in pixels in XY plane.

Parameters
  • x1 (int) – Point 1 X coordinate in pixels.

  • y1 (int) – Point 1 Y coordinate in pixels.

  • x2 (int) – Point 2 X coordinate in pixels.

  • y2 (int) – Point 2 Y coordinate in pixels.

class navel.data_structs.Bryan(x, y, z)

Bases: object

Describes a Tait-Bryan angle rotations.

Parameters
  • x (float) – Rotation around X axis.

  • y (float) – Rotation around Y axis.

  • z (float) – Rotation around Z axis.

class navel.data_structs.CartSys3d(sys, x, y, z)

Bases: object

Describes a 3D point in cartesian space.

Parameters
  • sys (CoordSystem) – Coordinate system used.

  • x (float) – X coordinate in mm.

  • y (float) – Y coordinate in mm.

  • z (float) – Z coordinate in mm.

class navel.data_structs.CartVec3d(x, y, z)

Bases: object

Describes a cartesian 3D vector.

Parameters
  • x (float) – X vector.

  • y (float) – Y vector.

  • z (float) – Z vector.

class navel.data_structs.CoordSystem(value)

Bases: enum.IntEnum

Enum class describing available coordinate frames.

CAM_BREAST = 1

Origin located in center of breast cam

CAM_HEAD = 5

Origin located in center of head cam.

COORD_LEN = 8

Max Value of enum, used only in calculations

EYE_LEFT = 6

Origin is located in center of left eye.

EYE_RIGHT = 7

Origin is located in center of right eye.

HEAD_REAL = 4

Fixed to head, x axis pointing in facing direction.

HEAD_REF = 2

Origin located in head center, head is facing slightly downwards.

HEAD_STRAIGHT = 3

Origin located in head center, head is facing straight.

class navel.data_structs.DataType(value)

Bases: enum.IntEnum

Enum class describing what data type is used.

F32 = 5

32 bit float

F64 = 6

64 bit double

I32 = 1

32 bit integer

I64 = 3

64 bit integer

U32 = 2

32 bit unsigned integer

U64 = 4

64 bit unsigned integer

class navel.data_structs.PerceptionData(time, persons)

Bases: object

Class containing all infomation sent via vision socket.

Parameters
  • time (int) – Timestap of image.

  • persons (Person) – List of detected persons.

class navel.data_structs.Person(id_score=None, uuid=None, face=None, landmarks=None, head_position=None, gaze=None, facial_expression=None, dist_mm=None, g_overlap=None, g_eye_left=None, g_eye_right=None, g_nose=None, g_head_position=None, g_gaze=None)

Bases: object

Defines attributes of a detected person.

Parameters
  • id_score (float) – TODO sort out use case. Defaults to None.

  • user_id (float) – Unique user id. Defaults to None.

  • face (Bbox2d) – Bounding box of face. Defaults to None.

  • landmarks (PersonLandmarks) – Position of left end of mouth. Defaults to None.

  • head_position (Bryan) – Position of head in Tait-Bryan angles (radians). Defaults to None.

  • gaze (CartVec3d) – Vector describing persons direction of gaze. Defaults to None.

  • facial_expression (PersonFacialExpression) – Person’s facial expression. Defaults to None.

  • dist_mm (float) – Distance from robot to person (mm). Defaults to None.

  • g_overlap (float) – How much person is staring at robot, 0 = not looking at robot, 1 = looking directly at robot. Defaults to None.

  • g_eye_left (CartSys3d) – A list of the position of left eye in all coord frames. This might be out of frame, then sys is CoordSystem.UNDEFINED. Defaults to None.

  • g_eye_right (CartSys3d) – A list of the position of right eye in all coord frames. This might be out of frame, then sys is CoordSystem.UNDEFINED. Defaults to None.

  • g_nose (CartSys3d) – A list of the position of nose in all coord frames. This might be out of frame, then sys is CoordSystem.UNDEFINED. Defaults to None.

  • g_head_position (CartSys3d) – A list of the position of head in all coord frames. Defaults to None.

  • g_gaze (CartSys3d) – A list of the target of persons gaze in all coord frames. Defaults to None.

class navel.data_structs.PersonFacialExpression(neutral, happy, sad, surprise, anger)

Bases: object

Class describing the facial expression of the detected person

Each emotion in this class is described by a magnitude where 1 describes maximum expression and 0 describes minimum expression.

Parameters
  • neutral (float) – magnitude of neutral.

  • happy (float) – magnitude of happyness.

  • sad (float) – magnitude of sadness.

  • surprise (float) – magnitude of surprise.

  • anger (float) – magnitude of anger.

class navel.data_structs.PersonLandmarks(eye_left, eye_right, nose, mouth_left, mouth_right)

Bases: object

Class describing position of a person’s facial landmarks.

Each landmark is described by its 2D position within the host image.

Parameters
  • eye_left (Point2d) – Position of left eye.

  • eye_right (Point2d) – Position of right eye.

  • nose (Point2d) – Position of nose.

  • mouth_left (Point2d) – Position of left end of mouth.

  • mouth_right (Point2d) – Position of right end of mouth.

class navel.data_structs.Point2d(x, y)

Bases: object

Describes a 2D point using pixel coordinates.

Parameters
  • x (int) – X coordinate in pixels.

  • y (int) – Y coordinate in pixels.