#include <robomon.h>
Public Slots | |
void | moveServo (int value) |
void | frontDoor (int value) |
void | innerDoor (int value) |
void | backDoor (int value) |
void | launchFront (int value) |
void | stopDopravnikFront () |
void | stopDopravnikBack () |
void | setDO (int x) |
void | setIR (unsigned short int) |
void | setMotor (int) |
void | setSimul (int) |
void | setSharpVal (int) |
void | stopMotors (void) |
void | changeObstacle (QPointF pos) |
void | showMap (void) |
This function sets-up the application to load map from shared memory and display it. | |
void | paintMap (void) |
Public Member Functions | |
robomon (QWidget *parent=0, Qt::WFlags fl=0) | |
Robomon class constructor. | |
~robomon () | |
Robomon class destructor. | |
bool | event (QEvent *evet) |
QT event processing. | |
void | setDI (stateDigIn) |
Digital inputs visualization. | |
void | setSharp () |
Sharp IR sensors data visualization. | |
Public Attributes | |
int | shared_segment_size |
Size of the shared memory segment. | |
int | segment_id |
ID of the shared memory segment. | |
PlaygroundScene * | scene |
Graphics scene used to paint the graphic objects. | |
robot * | rob |
Robot graphical object. | |
sharpShorts | sharpyLahve |
Structure for saving sensor values during sensor simulation. | |
sharpLongs | sharpySouper |
Structure for saving sensor values during sensor simulation. | |
QTimer * | timer |
Timer for automatic map display refresh. | |
_Map * | map |
Pointer to map representation in shared memory. | |
int | size |
Size of a map cell in px. | |
Protected Slots | |
void | obstackleSimulation (int state) |
void | simulateObstackles () |
Protected Attributes | |
QTimer * | obstSimTimer |
Point | simulatedObstacle |
This class serves to set up GUI.
Definition at line 84 of file robomon.h.
robomon::robomon | ( | QWidget * | parent = 0 , |
|
Qt::WFlags | fl = 0 | |||
) |
Robomon class constructor.
This is the robomon class constructor. First signals from all the controls on the main panel are connected to appropriate slots. Then the GraphicsScene object is created (scene). When the scene is set up, the playgroung graphics are added to it. After the playground is painted, new instance of robot class is created and the pointer to it is saved to rob. ORTE initialization function is also called from the constructor and pointer to this instance of robomon is passed to it. In the end, all servos are set to initial position.
Definition at line 86 of file robomon.cpp.
References stateServa::backDoor, backDoor(), changeObstacle(), stateServa::frontDoor, frontDoor(), Ui_Form::gvPlayground, stateServa::innerDoor, innerDoor(), launchFront(), moveServo(), obstackleSimulation(), rob, scene, setDO(), setMotor(), setSharpVal(), setSimul(), Ui_Form::setupUi(), showMap(), stopDopravnikBack(), stopDopravnikFront(), stopMotors(), stateServa::transporterFront, and stateServa::transporterInner.
robomon::~robomon | ( | ) |
Robomon class destructor.
This is the robomon class destructor. It is used to detach the shared memory segment and to destroy ORTE application domain.
Definition at line 154 of file robomon.cpp.
bool robomon::event | ( | QEvent * | evet | ) |
QT event processing.
This function serves for processing of all QT events. If the event is one of user defined ones, appropriate function is called to process it, otherwise the event is passed on to the QT engine.
Definition at line 19 of file robomon.cpp.
References robot::moveRobot(), position::phi, rob, setDI(), setIR(), setSharp(), Ui_Form::tbPhi, Ui_Form::tbX, Ui_Form::tbY, position::x, and position::y.
void robomon::setDI | ( | stateDigIn | stateDI | ) |
Digital inputs visualization.
This function sets the checkboxes that represent digital inputs according DI data received from ORTE. It is called from event() when EVENT_DI is received (from DI subscriber callback from ORTE).
Definition at line 54 of file robomon.cpp.
References Ui_Form::cbDI0, Ui_Form::cbDI1, Ui_Form::cbDI2, Ui_Form::cbDI3, Ui_Form::cbDI4, Ui_Form::cbDI5, Ui_Form::cbDI6, Ui_Form::cbDI7, and stateDigIn::state.
Referenced by event().
void robomon::setSharp | ( | ) |
Sharp IR sensors data visualization.
This function sets the progress bars that represent IR sensors values according to data received from ORTE. It is called from event() when EVENT_SHARP is received (from sharp data subscriber from ORTE).
Definition at line 248 of file robomon.cpp.
References sharpLongs::longSharpDist1, sharpLongs::longSharpDist2, sharpLongs::longSharpDist3, Ui_Form::pbSharpLong1, Ui_Form::pbSharpLong2, Ui_Form::pbSharpLong3, Ui_Form::pbSharpShort1, Ui_Form::pbSharpShort2, Ui_Form::pbSharpShort3, Ui_Form::pbSharpShort4, sharpShorts::short1, sharpShorts::short2, sharpShorts::short3, sharpShorts::short4, Ui_Form::tbSharpLong1, Ui_Form::tbSharpLong2, Ui_Form::tbSharpLong3, Ui_Form::tbSharpShort1, Ui_Form::tbSharpShort2, Ui_Form::tbSharpShort3, and Ui_Form::tbSharpShort4.
Referenced by event().
void robomon::showMap | ( | void | ) | [slot] |
This function sets-up the application to load map from shared memory and display it.
The function finds out the size of map square representation on the screen (in px) and the size of the shared memory segment. Then the function tries to get the shm id and in case of failure an error message is displayed. If the function could get the segment id (segment_id), the segment is attached to map pointer.
Definition at line 309 of file robomon.cpp.
References MAP_HEIGHT, MAP_WIDTH, paintMap(), segment_id, shared_segment_size, SHM_MAP_KEY, size, and timer.
Referenced by robomon().
Graphics scene used to paint the graphic objects.
This scene is painted in gvPlaygroud GraphicsView. All the graphical obejcts to be painted should be added to this scene.
Definition at line 106 of file robomon.h.
Referenced by paintMap(), and robomon().
Structure for saving sensor values during sensor simulation.
This structure is used to save IR sensor values from sliding bars during sensor simulation. It is then published on ORTE.
Definition at line 118 of file robomon.h.
Referenced by setSharpVal().
Structure for saving sensor values during sensor simulation.
This structure is used to save IR sensor values from sliding bars during sensor simulation. It is then published on ORTE.
Definition at line 124 of file robomon.h.
Referenced by obstackleSimulation(), setSharpVal(), and simulateObstackles().
QTimer* robomon::timer |
int robomon::size |
Size of a map cell in px.
This variable contains size of map cells on the screen in px. It is calculated as PG_X / MAP_WIDTH in showMap() and is used in paintMap().
Definition at line 144 of file robomon.h.
Referenced by paintMap(), and showMap().