Enki  1.9
Public Types | Public Member Functions | Public Attributes | List of all members
Enki::EPuck Class Reference

A simple model of the E-puck robot. More...

#include <EPuck.h>

Inheritance diagram for Enki::EPuck:
Enki::DifferentialWheeled Enki::Robot Enki::PhysicalObject

Public Types

enum  Capabilities {
  CAPABILITY_NONE = 0, CAPABILITY_BASIC_SENSORS = 0x1, CAPABILITY_CAMERA = 0x2, CAPABILITY_SCANNER_TURRET = 0x3,
  CAPABILITY_BLUETOOTH = 0x4
}
 The bot's capabilities. You can simply select a predefined set of sensors. These correspond to the different extension modules that exist for the E-Puck. More...
 
- Public Types inherited from Enki::PhysicalObject
enum  ButtonCode { LEFT_MOUSE_BUTTON = 1<<0, RIGHT_MOUSE_BUTTON = 1<<1, MIDDLE_MOUSE_BUTTON = 1<<3 }
 

Public Member Functions

 EPuck (unsigned capabilities=CAPABILITY_BASIC_SENSORS)
 Create a E-Puck with certain modules aka capabilities (basic)
 
 ~EPuck ()
 Destructor.
 
void setLedRing (bool status)
 Set ring color (true = red, false = black)
 
- Public Member Functions inherited from Enki::DifferentialWheeled
 DifferentialWheeled (double distBetweenWheels, double maxSpeed, double noiseAmount)
 Constructor.
 
void resetEncoders ()
 Reset the encoder. Should be called when robot is moved manually. Odometry is cleared too.
 
virtual void controlStep (double dt)
 Set the real speed of the robot given leftSpeed and rightSpeed. Add noise. Update encoders.
 
virtual void applyForces (double dt)
 Consider that robot wheels have immobile contact points with ground, and override speeds. This kills three objects dynamics, but is good enough for the type of simulation Enki covers (and the correct solution is immensely more complex)
 
- Public Member Functions inherited from Enki::Robot
void addLocalInteraction (LocalInteraction *li)
 Add a new local interaction, re-sort interaction vector from long ranged to short ranged.
 
void addGlobalInteraction (GlobalInteraction *gi)
 Add a global interaction, just add it at the end of the vector.
 
virtual void initLocalInteractions (double dt, World *w)
 Initialize the local interactions, call init on each one.
 
virtual void doLocalInteractions (double dt, World *w, PhysicalObject *po)
 Do the local interactions with other objects, call objectStep on each one.
 
virtual void doLocalWallsInteraction (double dt, World *w)
 Do the local interactions with walls, call wallsStep on each one.
 
virtual void finalizeLocalInteractions (double dt, World *w)
 All the local interactions are finished, call finalize on each one.
 
virtual void doGlobalInteractions (double dt, World *w)
 Do the global interactions, call step on each one.
 
void sortLocalInteractions (void)
 Sort local interactions. Called by addLocalInteraction ; can be called by subclasses in case of interaction radius change.
 
- Public Member Functions inherited from Enki::PhysicalObject
 PhysicalObject ()
 Constructor.
 
virtual ~PhysicalObject ()
 Destructor.
 
double getRadius () const
 
double getHeight () const
 
bool isCylindric () const
 
const HullgetHull () const
 
const ColorgetColor () const
 
double getMass () const
 
double getMomentOfInertia () const
 
double getInterlacedDistance () const
 
void setCylindric (double radius, double height, double mass)
 Make the object cylindric with a given mass.
 
void setRectangular (double l1, double l2, double height, double mass)
 Make the object rectangular of size l1 x l2 with a given mass.
 
void setCustomHull (const Hull &hull, double mass)
 Set a custom shape and mass to the object.
 
void setColor (const Color &color)
 Set the overall color of this object, if hull is empty or if it does not contain any texture.
 
virtual void clickedInteraction (bool pressed, unsigned int buttonCode, double pointX, double pointY, double pointZ)
 called for robot if a click is performed on it
 

Public Attributes

IRSensor infraredSensor0
 The infrared sensor 0 (front-front-right)
 
IRSensor infraredSensor1
 The infrared sensor 1 (front-right)
 
IRSensor infraredSensor2
 The infrared sensor 2 (right)
 
IRSensor infraredSensor3
 The infrared sensor 3 (back-right)
 
IRSensor infraredSensor4
 The infrared sensor 4 (back-left)
 
IRSensor infraredSensor5
 The infrared sensor 5 (left)
 
IRSensor infraredSensor6
 The infrared sensor 6 (front-left)
 
IRSensor infraredSensor7
 The infrared sensor 7 (front-front-left)
 
CircularCam camera
 Linear camera.
 
EPuckScannerTurret scannerTurret
 The rotating, long range distance sensor turret.
 
Bluetoothbluetooth
 Bluetooth module.
 
- Public Attributes inherited from Enki::DifferentialWheeled
double leftSpeed
 Left speed of the robot.
 
double rightSpeed
 Reft speed of the robot.
 
double leftEncoder
 The encoder for left wheel; this is not a real encoder, but rather the physical leftSpeed.
 
double rightEncoder
 The encoder for right wheel; this is not a real encoder, but rather the physical rightSpeed.
 
double leftOdometry
 The odometry (accumulation of encoders) for left wheel.
 
double rightOdometry
 The odometry (accumulation of encoders) for right wheel.
 
- Public Attributes inherited from Enki::PhysicalObject
UserDatauserData
 Data attached by the user to this physical object. If non-null, will be destroyed with the object.
 
double collisionElasticity
 Elasticity of collisions of this object. If 0, soft collision, 100% energy dissipation; if 1, elastic collision, 0% energy dissipation. Actual elasticity is the product of the elasticity of the two colliding objects. Walls are fully elastics.
 
double dryFrictionCoefficient
 The dry friction coefficient mu.
 
double viscousFrictionCoefficient
 The viscous friction coefficient. Premultiplied by mass. A value of k applies a force of -k * speed * mass.
 
double viscousMomentFrictionCoefficient
 The viscous friction moment coefficient. Premultiplied by momentOfInertia. A value of k applies a force of -k * speed * momentOfInertia.
 
Point pos
 The position of the object.
 
double angle
 The orientation of the object in the world, standard trigonometric orientation.
 
Vector speed
 The speed of the object.
 
double angSpeed
 The rotation speed of the object, standard trigonometric orientation.
 

Additional Inherited Members

- Static Public Attributes inherited from Enki::PhysicalObject
static const double g = 9.81
 
- Protected Member Functions inherited from Enki::PhysicalObject
virtual void collisionEvent (PhysicalObject *o)
 The object collided with o during the current physical step, if o is null, it collided with walls. Called just before the object is de-interlaced.
 
virtual void initGlobalInteractions (double dt, World *w)
 Initialize the global interactions, do nothing for PhysicalObject.
 
virtual void finalizeGlobalInteractions (double dt, World *w)
 All global interactions are finished, do nothing for PhysicalObject.
 
- Protected Attributes inherited from Enki::DifferentialWheeled
double distBetweenWheels
 Distance between the left and right driving wheels.
 
double maxSpeed
 Maximum speed wheels can provide.
 
double noiseAmount
 Relative amount of motor noise.
 
- Protected Attributes inherited from Enki::Robot
std::vector< LocalInteraction * > localInteractions
 Vector of local interactions.
 
std::vector< GlobalInteraction * > globalInteractions
 Vector of global interactions.
 

Detailed Description

A simple model of the E-puck robot.

Member Enumeration Documentation

The bot's capabilities. You can simply select a predefined set of sensors. These correspond to the different extension modules that exist for the E-Puck.

Enumerator
CAPABILITY_NONE 

No sensor: not very useful.

CAPABILITY_BASIC_SENSORS 

Basic_Sensors: Just the 8 IRSensors of the base module.

CAPABILITY_CAMERA 

Camera: add a linear camera.

CAPABILITY_SCANNER_TURRET 

The rotating, long range distance sensor turret.

CAPABILITY_BLUETOOTH 

Bluetooth: activate the bluetooth module (Requires the use of Bluetooth master)


The documentation for this class was generated from the following files: