Utils

Classes

class utils.Acceleration.Acceleration(x, y, z)[source]

Bases: object

Represents the current acceleration of the SmartPhone (x, y, z)

class utils.Blob.Blob(color, posx, posy, size)[source]

Bases: object

Represents a blob detected:
  • color: (string) The color of the blob

  • posx: (int) The x coordinate of the center of the blob area

  • posy: (int) The y coordinate of the center of the blob area

  • size: (int) The area of the blob measured in pixels.

class utils.DetectedObject.DetectedObject(x, y, width, height, confidence, label)[source]

Bases: object

Represents a detected object

Attributes:
  • x: x coordinate of the bounding box.

  • y: x coordinate of the bounding box.

  • width: width of the bounding box.

  • height: height of the bounding box.

  • label: class of the identified object.

  • confidence: confidence or score of the class of the object.

class utils.Face.Face(posx, posy, distance)[source]

Bases: object

Represents the last face detected by Robobo (front camera):

  • posX: (int) Returns the x position in which a face is detected.

  • posY: (int) Returns the y position in which a face is detected.

  • distance: (int) the distance at which the SmartPhone front camera detects a face.

class utils.Lanes.LaneBasic(l1, l2, r1, r2, id)[source]

Bases: object

Represents a detected lane Attributes:

  • coeffs1: Dictionary with ‘a’ and ‘b’ (ax + b) coefficients of the left line.

  • coeffs2: Dictionary with ‘a’ and ‘b’ (ax + b) coefficients of the right line.

  • id: Frame number

class utils.Lanes.LanePro(l1, l2, l3, r1, r2, r3, minv, id)[source]

Bases: object

Represents a detected lane Attributes:

  • coeffs1: Dictionary with ‘a’,’b’ and ‘c’ (ax^2 + bx +c) coefficients of the left line.

  • coeffs2: Dictionary with ‘a’,’b’ and ‘c’ (ax^2 + bx +c) coefficients of the right line.

  • minv: Transformation matrix to get to the original perspective.

  • id: Frame number

class utils.Lines.Lines(lines, id)[source]

Bases: object

Represents a detected straight line Attributes:

  • lines: array of shape (n, 4) where each row its a line with the values (x1, y1, x2, y2)

  • id: frame number

class utils.Note.Note(name, duration)[source]

Bases: object

Represents a note detected:
  • Name: (string) The musical note in text format, according to the English nomenclature, that is:

    DO

    DO#

    RE

    RE#

    MI

    FA

    FA#

    SOL

    SOL#

    LA

    LA#

    SI

    C

    Cs

    D

    Ds

    E

    F

    Fs

    G

    Gs

    A

    As

    B

  • Duration: (int) The note’s duration in milliseconds

class utils.Orientation.Orientation(yaw, pitch, roll)[source]

Bases: object

Represents the current orientation of the Smartphone. Attributes: yaw, pitch and roll.

_images/orientation.jpg
class utils.QRCode.QRCode(x, y, dist, p1x, p1y, p2x, p2y, p3x, p3y, id)[source]

Bases: object

Represents a QRCode detected Attributes:

  • x: x coordinate.

  • y: x coordinate.

  • distance: Approximated distance of the QRCode.

  • p1: Dictionary with ‘x’ and ‘y’ coordinates of the first point of interest (Result point).

  • p2: Dictionary with ‘x’ and ‘y’ coordinates of the second point of interest (Result point).

  • p3: Dictionary with ‘x’ and ‘y’ coordinates of the third point of interest (Result point).

  • id: QRCode identifier.

class utils.Tag.Tag(cor1x, cor1y, cor2x, cor2y, cor3x, cor3y, cor4x, cor4y, rvec_0, rvec_1, rvec_2, tvec_0, tvec_1, tvec_2, id)[source]

Bases: object

Represents a detected Aruco Tag Attributes:

  • cor1: Dictionary with ‘x’ and ‘y’ coordinates of the first corner.

  • cor2: Dictionary with ‘x’ and ‘y’ coordinates of the second corner.

  • cor3: Dictionary with ‘x’ and ‘y’ coordinates of the third corner.

  • cor4: Dictionary with ‘x’ and ‘y’ coordinates of the fourth corner.

  • tvecs: Dictionary with the ‘x’, ‘y’ and ‘z’ components of the translation vector.

  • tvecs: Dictionary with the ‘x’, ‘y’ and ‘z’ components of the rotation vector.

  • id: ArUco identifier.

class utils.Tap.Tap(x, y)[source]

Bases: object

Represents a tap on smartphone screen. Attributes:

  • x: Returns the position x of the tap

  • y: Returns the position y of the tap.

    _images/tap_position.jpg
  • zone: Returns the area of the smartphone screen: forehead, eye, right, left, mouth or chin.

    _images/tap_areas.jpg

Enumerations

class utils.BlobColor.BlobColor[source]

Bases: enum.Enum

This enumeration represents the list of colors Robobo can detect

BLUE = 'blue'
CUSTOM = 'custom'
GREEN = 'green'
RED = 'red'
class utils.Color.Color[source]

Bases: enum.Enum

This enumeration represents the list of colors Robobo’s LEDs can show.

BLUE = 'blue'
CYAN = 'cyan'
GREEN = 'green'
MAGENTA = 'magenta'
OFF = 'off'
ORANGE = 'orange'
RED = 'red'
WHITE = 'white'
YELLOW = 'yellow'
class utils.Emotions.Emotions[source]

Bases: enum.Enum

Represents the list of emotions Robobo’s face can show.

_images/emotions.jpg
AFRAID = 'afraid'
ANGRY = 'angry'
HAPPY = 'happy'
LAUGHING = 'laughing'
NORMAL = 'normal'
SAD = 'sad'
SLEEPING = 'sleeping'
SURPRISED = 'surprised'
TIRED = 'tired'
class utils.IR.IR[source]

Bases: enum.Enum

This enumeration represents the list of Robobo base’s IR

_images/irs.jpg
BackC = 'Back-C'
BackL = 'Back-L'
BackR = 'Back-R'
FrontC = 'Front-C'
FrontL = 'Front-L'
FrontLL = 'Front-LL'
FrontR = 'Front-R'
FrontRR = 'Front-RR'
class utils.LED.LED[source]

Bases: enum.Enum

This enumeration represents the list of Robobo base’s LEDs

_images/leds.jpg
All = 'all'
BackL = 'Back-L'
BackR = 'Back-R'
FrontC = 'Front-C'
FrontL = 'Front-L'
FrontLL = 'Front-LL'
FrontR = 'Front-R'
FrontRE = 'Front-RR'
class utils.Sounds.Sounds[source]

Bases: enum.Enum

This enumeration lists the emotion sound Robobo can play.

ANGRY = 'angry'
APPROVE = 'approve'
DISAPPROVE = 'disapprove'
DISCOMFORT = 'discomfort'
DOUBTFUL = 'doubtful'
LAUGH = 'laugh'
LIKES = 'likes'
MOAN = 'moan'
MUMBLE = 'mumble'
OUCH = 'ouch'
PURR = 'purr'
THINKING = 'thinking'
VARIOUS = 'various'
class utils.StatusFrequency.StatusFrequency[source]

Bases: enum.Enum

This enumeration lists the possible values for setting the frequency of the status messages coming from the robot.

High = 'HIGH'
Low = 'LOW'
Max = 'MAX'
Normal = 'NORMAL'
class utils.Wheels.Wheels[source]

Bases: enum.Enum

This enumeration represents the list of possible values for the wheels of Robobo

BOTH = 'both'
L = 'left'
R = 'right'