The aseba-enabled version of the marXbot robot. More...
#include <AsebaMarxbot.h>
Classes | |
struct | BaseVariables |
struct | DistanceSensorVariables |
struct | Event |
struct | Module |
struct | MotorVariables |
struct | ProximitySensorVariables |
Public Member Functions | |
AsebaMarxbot () | |
Constructor, connect to a host and register VMs. | |
virtual void | connectionClosed (Dashel::Stream *stream, bool abnormal) |
virtual void | connectionCreated (Dashel::Stream *stream) |
virtual void | controlStep (double dt) |
In addition to DifferentialWheeled::step(), update aseba variables and initiate periodic events. | |
virtual void | incomingData (Dashel::Stream *stream) |
virtual | ~AsebaMarxbot () |
Destructor, unregister VMs. | |
Public Attributes | |
std::vector< Module * > | modules |
Dashel::Stream * | stream |
Static Public Attributes | |
static int | marxbotNumber = 0 |
Private Attributes | |
Module | distanceSensors |
DistanceSensorVariables | distanceSensorVariables |
Module | leftMotor |
MotorVariables | leftMotorVariables |
Module | proximitySensors |
ProximitySensorVariables | proximitySensorVariables |
Module | rightMotor |
MotorVariables | rightMotorVariables |
The aseba-enabled version of the marXbot robot.
This robot provides a full simulation of event-based architecture as present on the real marXbot, using aseba. This robot provides a tcp server connection on port ASEBA_DEFAULT_PORT (currently 33333), or higher if other AsebaMarxbot already use it. This allows the connection of Aseba Studio to this robot. The feature is provided by inheriting from a Network server
Definition at line 53 of file AsebaMarxbot.h.
Enki::AsebaMarxbot::AsebaMarxbot | ( | ) |
Constructor, connect to a host and register VMs.
Definition at line 208 of file AsebaMarxbot.cpp.
Enki::AsebaMarxbot::~AsebaMarxbot | ( | ) | [virtual] |
Destructor, unregister VMs.
Definition at line 262 of file AsebaMarxbot.cpp.
void Enki::AsebaMarxbot::connectionClosed | ( | Dashel::Stream * | , | |
bool | ||||
) | [virtual] |
Called when target closes connection. The only valid method to call on the stream is getTargetName(), input/output operations are forbidden. You must not call closeStream(stream) from within this method for the same stream as the one passed as parameter. Subclass can implement this method. Called with the stream lock held.
stream | stream to the target. | |
abnormal | whether the connection was closed during step (abnormal == false) or when an operation was performed (abnormal == true) |
Reimplemented from Dashel::Hub.
Definition at line 365 of file AsebaMarxbot.cpp.
void Enki::AsebaMarxbot::connectionCreated | ( | Dashel::Stream * | ) | [virtual] |
Called when any data connection is created. It is not called when a listening connection (eg tcpin:) is created. If the stream is closed during this method, an exception occurs: the caller is responsible to handle it. The stream is already inserted in the stream list when this function is called. Subclass can implement this method. Called with the stream lock held.
stream | stream to the target |
Reimplemented from Dashel::Hub.
Definition at line 337 of file AsebaMarxbot.cpp.
void Enki::AsebaMarxbot::controlStep | ( | double | dt | ) | [virtual] |
In addition to DifferentialWheeled::step(), update aseba variables and initiate periodic events.
Definition at line 271 of file AsebaMarxbot.cpp.
void Enki::AsebaMarxbot::incomingData | ( | Dashel::Stream * | ) | [virtual] |
Called when data is available for reading on the stream. If the stream is closed during this method, an exception occurs: Hub stops the execution of this method and calls connectionClosed(); objects dynamically allocated must thus be handled with auto_ptr. If step() is used, subclass must implement this method and call read at least once. Called with the stream lock held.
stream | stream to the target |
Reimplemented from Dashel::Hub.
Definition at line 352 of file AsebaMarxbot.cpp.
Module Enki::AsebaMarxbot::distanceSensors [private] |
Definition at line 135 of file AsebaMarxbot.h.
Definition at line 130 of file AsebaMarxbot.h.
Module Enki::AsebaMarxbot::leftMotor [private] |
Definition at line 132 of file AsebaMarxbot.h.
Definition at line 127 of file AsebaMarxbot.h.
int Enki::AsebaMarxbot::marxbotNumber = 0 [static] |
Definition at line 140 of file AsebaMarxbot.h.
std::vector<Module *> Enki::AsebaMarxbot::modules |
Definition at line 139 of file AsebaMarxbot.h.
Module Enki::AsebaMarxbot::proximitySensors [private] |
Definition at line 134 of file AsebaMarxbot.h.
Definition at line 129 of file AsebaMarxbot.h.
Module Enki::AsebaMarxbot::rightMotor [private] |
Definition at line 133 of file AsebaMarxbot.h.
Definition at line 128 of file AsebaMarxbot.h.
Definition at line 156 of file AsebaMarxbot.h.