#include <AliceCommunication.h>
Inheritance diagram for Enki::AliceCommunication:
In the real alice, the communication is done via the infrared sensors. Here it is a different interaction
Public Member Functions | |
AliceCommunication (double r, Robot *owner) | |
Constructor; r is the robot's bounding circle radius. | |
void | init () |
Init routine run before the interaction. | |
void | objectStep (double dt, PhysicalObject *po, World *w) |
The actual interaction. | |
void | addSensor (An::Vector pos, double ray) |
Add a new sensor at position pos of radius ray. | |
void | setTransmitValue (unsigned val) |
The value to transmit. | |
void | setTransmit (bool enabled) |
Turn transmission on or off. | |
bool | wasCommunication (void) |
Returns true if a communication signal was received. | |
bool | wasCommunicationSent (void) |
Returns true if a communication signal was sent. | |
unsigned | getSensorId (void) |
Returns the Id. | |
unsigned char | getSensorValue (void) |
Returns the received SensorValue. | |
Protected Member Functions | |
void | computeRealSensors (void) |
Compute the real position of sensors, update realSensors. | |
Protected Attributes | |
std::vector< std::pair< An::Vector, double > > | sensors |
The position of sensors through which the Alices communicate. | |
std::vector< An::Vector > | realSensors |
The actual position of sensors, transformed by robot position and orientation. | |
bool | updatedRealSensors |
True if the realSensors reflect the actual real position of the robot. | |
bool | enabled |
Is communication active. | |
unsigned | transmitValue |
Value to transmit through communication. | |
bool | wasReceived |
Was communication active last step. | |
unsigned | receivedSensor |
Sensor through which we received value. | |
unsigned | receivedValue |
Value received through communication. | |
double | smallestDistance2 |
the smallest squared distance between two robots |