E-puck#

class pyenki.EPuck#

Bases: DifferentialWheeled, PhysicalObject

Parameters:
  • proximity (bool) – enable the proximity sensors

  • camera (bool) – enable the camera

  • scanner (bool) – enable the scanner

A DifferentialWheeled e-Puck robot.

The robots has a 60 pixels frontal looking camera placed at a height of 2.2 cm and with a fov of 60 degrees, and 8 infrared proximity sensors (maximal range 12 cm) placed at a height of 2.5 cm and at angles: -18, -45, -90, -142, 142, 90, 45, 18 degrees.

Example:

>>> import pyenki
>>> world = pyenki.World()
>>> epuck = pyenki.EPuck()
>>> world.add_object(epuck)
>>> epuck.position = (-10, 0)
>>> epuck.set_led_ring(True)
>>> obj = pyenki.PhysicalObject(radius=2.0, height=5.0, mass=-1,
                                pyenki.Color(0.3, 0.7, 0))
>>> world.add_object(obj)
>>> world.step(0.1)
>>> epuck.prox_values
array([98.52232283,  3.30197324, ...
>>> epuck.camera_image
array([[0.5, 0.5, 0.5, 1. ] ...
prox_values#

An array of 8 proximity sensor readings, one for each sensors (readonly).

Type:

Array1D

prox_distances#

An array of 8 distances between proximity sensor and nearest obstacles, one for each sensors (readonly). please note that this value would not directly be accessible by a real robot (readonly).

Type:

Array1D

scan#

An array of 64 radial distances, ordered from -180 degrees to 180 degrees, in centimeters.

Type:

Array1D

camera_image#

An rgba array between 0 and 1 of shape (60, 4) (readonly).

Type:

Array2D

__init__(proximity: bool = True, camera: bool = False, scanner: bool = False) None#
set_led_ring(value: bool) None#

Set all the red LEDs on or off.

Parameters:

value (bool) – the desired LED state.