ozon

ozon

factory ozon

Specifies the ozon ozobot high-level functions.

  • These functions are accessible via the tabletop:: prefix.

Methods

(static) ozonForward(distance)

Moves the ozon a given distance foward.

Parameters:
Name Type Description
distance uint

The approximate distance in mm; 1 mm corresponds to about 2 pixels.

(static) ozonTurn(angle)

Turns the ozon a given angle in degree.

Parameters:
Name Type Description
angle int

The angle in degree, positive in the trigonometric direction.

(static) ozonLight(index, blue, green, red)

Lights one ozon led.

Parameters:
Name Type Description
index uint

The led mask, any combination of the following.

  • 0x01: top
  • 0x02: left
  • 0x04: center-left
  • 0x08: center
  • 0x10: center-right
  • 0x20: right
  • 0x80: rear
blue uchar

The blue color.

green uchar

The green color.

red uchar

The red color.

  • The color is given as a [w0rgbycm] char for ([w]hite, [0]black, [r]ed, [g]reen, [b]lue, [y]ellow, [c]yan, [m]agenta) color.

(static) ozonStop()

Stops all ozon commands.

(static) ozonWhere() → {JSON}

Returns the ozon absolute position and orientation in the camera frame of reference.

Returns:

The estimated position.

  • x The Ozon horizontal final position, in pixel, -1 if undefined.
  • `y The Ozon vertical final position, in pixel, -1 if undefined.
  • a The Ozon rotation, in degree, 0 if undefined.
  • r The Ozon apparent radius, in pixel, 0 in undefined.
  • d The local displacement in pixel to measure the orientation.
Type
JSON

(static) ozonMove(x, y, a, loopopt)

Moves ozon to an absolute position and orientation.

Parameters:
Name Type Attributes Default Description
x uint

The Ozon horizontal final position, in pixel.

y uint

The Ozon vertical final position, in pixel.

a int

The Ozon rotation, in degree;

  • 0 if aligned with the horizontal line in the rightward direction,
  • 0 if oriented towards the top direction in the image.

loop uint <optional>
1

The maximal number of iteration.

(static) ozonCommand(command)

Sends a command to the ozon interface.

Parameters:
Name Type Description
command string

The command as defined by the ozon-lib python interface, i.e.:

  • ozon._send_led_control_command(index, red, green, blue)
  • ozon.drive(left_velocity_0_from_999, right_velocity_0_from_999, delay_milli_second, wait_true_or_false)
  • ozon.spin(velocity_0_from_999, delay_milli_second, wait_true_or_false)