#include <map.h>
#include <robomath.h>
#include <hokuyo.h>
+#include <actuators.h>
#include "PlaygroundScene.h"
#include "MiscGui.h"
#include "robomon_orte.h"
leftBrushDial = new QDial();
rightBrushDial = new QDial();
- bagrDial = new QDial();
- carouselDial = new QDial();
+ lift_posDial = new QDial();
+ pusherDial = new QDial();
leftBrushDriveCheckBox = new QCheckBox(tr("L&eft brush"));
rightBrushDriveCheckBox = new QCheckBox(tr("Ri&ght brush"));
- bagrDriveCheckBox = new QCheckBox(tr("B&agr"));
+ lift_posDriveCheckBox = new QCheckBox(tr("B&agr"));
leftBrushDial->setRange(0,200);
leftBrushDial->setValue(100);
rightBrushDial->setRange(0,200);
rightBrushDial->setValue(100);
- bagrDial->setRange(0,200);
- bagrDial->setValue(100);
- carouselDial->setRange(0,4);
- carouselDial->setNotchesVisible(1);
+ lift_posDial->setRange(0,200);
+ lift_posDial->setValue(100);
+ pusherDial->setRange(0,4);
+ pusherDial->setNotchesVisible(1);
layout->addWidget(leftBrushDial, 0, 0);
layout->addWidget(leftBrushDriveCheckBox, 0, 1);
layout->addWidget(rightBrushDial, 1, 0);
layout->addWidget(rightBrushDriveCheckBox, 1, 1);
- layout->addWidget(bagrDial, 2, 0);
- layout->addWidget(bagrDriveCheckBox, 2, 1);
- layout->addWidget(carouselDial, 3, 0);
+ layout->addWidget(lift_posDial, 2, 0);
+ layout->addWidget(lift_posDriveCheckBox, 2, 1);
+ layout->addWidget(pusherDial, 3, 0);
drivesGroupBox->setLayout(layout);
}
this, SLOT(setDrives(int)));
connect(rightBrushDial, SIGNAL(valueChanged(int)),
this, SLOT(setDrives(int)));
- connect(bagrDial, SIGNAL(valueChanged(int)),
+ connect(lift_posDial, SIGNAL(valueChanged(int)),
this, SLOT(setDrives(int)));
- connect(carouselDial, SIGNAL(valueChanged(int)),
+ connect(pusherDial, SIGNAL(valueChanged(int)),
this, SLOT(setDrives(int)));
connect(leftBrushDriveCheckBox, SIGNAL(stateChanged(int)),
this, SLOT(setLeftBrushDriveCB(int)));
connect(rightBrushDriveCheckBox, SIGNAL(stateChanged(int)),
this, SLOT(setRightBrushDriveCB(int)));
- connect(bagrDriveCheckBox, SIGNAL(stateChanged(int)),
- this, SLOT(setBagrDriveCB(int)));
+ connect(lift_posDriveCheckBox, SIGNAL(stateChanged(int)),
+ this, SLOT(setlift_posDriveCB(int)));
/* DIO */
for (int i=0; i<8; i++)
connect(doCheckBox[0], SIGNAL(stateChanged(int)),
void RobomonAtlantis::moveLeftBrush(int state)
{
if (state)
- orte.servos.brush_left = BRUSH_LEFT_OPEN;
+ actlib_servos_brush_left_open();
else
- orte.servos.brush_left = BRUSH_LEFT_CLOSE;
+ actlib_servos_brush_left_close();
}
void RobomonAtlantis::moveRightBrush(int state)
{
if (state)
- orte.servos.brush_right = BRUSH_RIGHT_OPEN;
+ actlib_servos_brush_right_open();
else
- orte.servos.brush_right = BRUSH_RIGHT_CLOSE;
+ actlib_servos_brush_right_close();
}
void RobomonAtlantis::setDrives(int state)
{
orte.drives.brush_left = leftBrushDial->value();
orte.drives.brush_right = rightBrushDial->value();
- orte.drives.bagr = bagrDial->value();
- orte.drives.carousel_pos = carouselDial->value();
+ orte.drives.lift_pos = lift_posDial->value();
+ orte.drives.pusher = pusherDial->value();
}
void RobomonAtlantis::setLeftBrushDriveCB(int state) {
if(state)
- orte.drives.brush_left = LEFT_BRUSH_DRIVE_ON;
+ actlib_drives_brush_left_on();
else
- orte.drives.brush_left = LEFT_BRUSH_DRIVE_OFF;
+ actlib_drives_brush_left_off();
}
void RobomonAtlantis::setRightBrushDriveCB(int state) {
if(state)
- orte.drives.brush_right = RIGHT_BRUSH_DRIVE_ON;
+ actlib_drives_brush_right_on();
else
- orte.drives.brush_right = RIGHT_BRUSH_DRIVE_OFF;
+ actlib_drives_brush_right_off();
}
-void RobomonAtlantis::setBagrDriveCB(int state) {
+void RobomonAtlantis::setlift_posDriveCB(int state) {
if(state)
- orte.drives.bagr = BAGR_DRIVE_ON;
+ orte.drives.lift_pos = 1;
else
- orte.drives.bagr = BAGR_DRIVE_OFF;
+ orte.drives.lift_pos = 2;
}
void RobomonAtlantis::setDO(int state)
void RobomonAtlantis::setLaser(int state) {
if(state)
- orte.laser_cmd.speed = LASER_DRIVE_ON;
+ actlib_laser_on();
else
- orte.laser_cmd.speed = LASER_DRIVE_OFF;
- ORTEPublicationSend(orte.publication_laser_cmd);
+ actlib_laser_off();
}
void RobomonAtlantis::showMap()
setDrives(0);
setLaser(0);
+ actlib_init(&orte);
+
/* set actions to do when we receive data from orte */
connect(this, SIGNAL(motionStatusReceivedSignal()),
this, SLOT(motionStatusReceived()));
brushLeft = new QDial();
brushRight = new QDial();
- roboBagr = new QDial();
- carousel = new QDial();
+ liftPos = new QDial();
+ pusher = new QDial();
brushLeftLEdit = new QLineEdit();
brushRightLEdit = new QLineEdit();
- roboBagrLEdit = new QLineEdit();
- carouselLEdit = new QLineEdit();
+ liftPosLEdit = new QLineEdit();
+ pusherLEdit = new QLineEdit();
brushLeft->setMinimum(0);
- brushLeft->setMaximum(200);
- brushLeft->setValue(100);
+ brushLeft->setMaximum(100);
+ brushLeft->setValue(0);
brushRight->setMinimum(0);
- brushRight->setMaximum(200);
- brushRight->setValue(100);
+ brushRight->setMaximum(100);
+ brushRight->setValue(0);
- roboBagr->setMinimum(0);
- roboBagr->setMaximum(200);
- roboBagr->setValue(100);
-
- carousel->setMinimum(1);
- carousel->setMaximum(5);
- carousel->setValue(1);
- carousel->setNotchesVisible(1);
+ liftPos->setMinimum(1);
+ liftPos->setMaximum(4);
+ liftPos->setValue(1);
+
+ pusher->setMinimum(1);
+ pusher->setMaximum(2);
+ pusher->setValue(1);
+ pusher->setNotchesVisible(1);
layout->addWidget(brushLeft,0,0);
layout->addWidget(MiscGui::createLabel("Left brush", Qt::AlignLeft), 1, 0);
layout->addWidget(brushRight,0,1);
layout->addWidget(MiscGui::createLabel("Right brush", Qt::AlignLeft), 1, 1);
layout->addWidget(brushRightLEdit, 2, 1);
- layout->addWidget(roboBagr,3,0);
- layout->addWidget(MiscGui::createLabel("Robo bagr", Qt::AlignLeft), 4, 0);
- layout->addWidget(roboBagrLEdit, 5, 0);
- layout->addWidget(carousel,3,1);
- layout->addWidget(MiscGui::createLabel("Carousel", Qt::AlignLeft), 4, 1);
- layout->addWidget(carouselLEdit, 5, 1);
+ layout->addWidget(liftPos,3,0);
+ layout->addWidget(MiscGui::createLabel("Lift position", Qt::AlignLeft), 4, 0);
+ layout->addWidget(liftPosLEdit, 5, 0);
+ layout->addWidget(pusher,3,1);
+ layout->addWidget(MiscGui::createLabel("Pusher", Qt::AlignLeft), 4, 1);
+ layout->addWidget(pusherLEdit, 5, 1);
enginesGroupBox->setLayout(layout);
servoBrushLeft = new QDial();
servoBrushRight = new QDial();
- servoDoorTop = new QDial();
- servoDoorBottom = new QDial();
- servoDoorBack = new QDial();
+ servoHolder = new QDial();
servoReserve = new QDial();
servoBrushLeftLEdit = new QLineEdit();
servoBrushRightLEdit = new QLineEdit();
- servoDoorTopLEdit = new QLineEdit();
- servoDoorBackLEdit = new QLineEdit();
- servoDoorBottomLEdit = new QLineEdit();
+ servoHolderLEdit = new QLineEdit();
+ servoReserveLEdit = new QLineEdit();
servoBrushLeft->setMinimum(0);
servoBrushLeft->setMaximum(255);
servoBrushRight->setMaximum(255);
servoBrushRight->setValue(127);
- servoDoorTop->setMinimum(0);
- servoDoorTop->setMaximum(255);
- servoDoorTop->setValue(127);
-
- servoDoorBottom->setMinimum(0);
- servoDoorBottom->setMaximum(255);
- servoDoorBottom->setValue(127);
-
- servoDoorBack->setMinimum(0);
- servoDoorBack->setMaximum(255);
- servoDoorBack->setValue(127);
+ servoHolder->setMinimum(0);
+ servoHolder->setMaximum(255);
+ servoHolder->setValue(127);
servoReserve->setMinimum(0);
servoReserve->setMaximum(255);
layout->addWidget(servoBrushRight, 0, 1);
layout->addWidget(MiscGui::createLabel("Right brush", Qt::AlignLeft), 1, 1);
layout->addWidget(servoBrushRightLEdit, 2, 1);
- layout->addWidget(servoDoorTop, 0, 2);
- layout->addWidget(MiscGui::createLabel("Top door", Qt::AlignLeft), 1, 2);
- layout->addWidget(servoDoorTopLEdit, 2, 2);
- layout->addWidget(servoDoorBottom, 3, 0);
- layout->addWidget(MiscGui::createLabel("Bottom Door", Qt::AlignLeft), 4, 0);
- layout->addWidget(servoDoorBottomLEdit, 5, 0);
- layout->addWidget(servoDoorBack, 3, 1);
- layout->addWidget(MiscGui::createLabel("Back door", Qt::AlignLeft), 4, 1);
- layout->addWidget(servoDoorBackLEdit, 5, 1);
+ layout->addWidget(servoHolder, 0, 2);
+ layout->addWidget(MiscGui::createLabel("Holder", Qt::AlignLeft), 1, 2);
+ layout->addWidget(servoHolderLEdit, 2, 2);
+// layout->addWidget(servoDoorBottom, 3, 0);
+// layout->addWidget(MiscGui::createLabel("Bottom Door", Qt::AlignLeft), 4, 0);
+// layout->addWidget(servoDoorBottomLEdit, 5, 0);
+// layout->addWidget(servoDoorBack, 3, 1);
+// layout->addWidget(MiscGui::createLabel("Back door", Qt::AlignLeft), 4, 1);
+// layout->addWidget(servoDoorBackLEdit, 5, 1);
layout->addWidget(servoReserve, 3, 2);
layout->addWidget(MiscGui::createLabel("Reserve", Qt::AlignLeft), 4, 2);
servosGroupBox->setLayout(layout);
this, SLOT(setMotors(int)));
connect(brushRight, SIGNAL(valueChanged(int)),
this, SLOT(setMotors(int)));
- connect(roboBagr, SIGNAL(valueChanged(int)),
+ connect(liftPos, SIGNAL(valueChanged(int)),
this, SLOT(setMotors(int)));
- connect(carousel, SIGNAL(valueChanged(int)),
+ connect(pusher, SIGNAL(valueChanged(int)),
this, SLOT(setMotors(int)));
this, SLOT(setServos(int)));
connect(servoBrushRight, SIGNAL(valueChanged(int)),
this, SLOT(setServos(int)));
- connect(servoDoorTop, SIGNAL(valueChanged(int)),
- this, SLOT(setServos(int)));
- connect(servoDoorBack, SIGNAL(valueChanged(int)),
+ connect(servoHolder, SIGNAL(valueChanged(int)),
this, SLOT(setServos(int)));
- connect(servoDoorBottom, SIGNAL(valueChanged(int)),
+ connect(servoReserve, SIGNAL(valueChanged(int)),
this, SLOT(setServos(int)));
connect(pwrAlertCBox, SIGNAL(stateChanged(int)),
servoBrushLeftLEdit->setText(QString("%1").arg(orte.servos.brush_left));
orte.servos.brush_right = (u_int8_t)servoBrushRight->value();
servoBrushRightLEdit->setText(QString("%1").arg(orte.servos.brush_right));
+ orte.servos.holder = (u_int8_t)servoHolder->value();
+ servoHolderLEdit->setText(QString("%1").arg(orte.servos.holder));
+ orte.servos.reserve = (u_int8_t)servoReserve->value();
+ servoReserveLEdit->setText(QString("%1").arg(orte.servos.reserve));
ORTEPublicationSend(orte.publication_servos);
}
{
orte.drives.brush_left = brushLeft->value();
orte.drives.brush_right = brushRight->value();
- orte.drives.bagr = roboBagr->value();
- orte.drives.carousel_pos = carousel->value();
+ orte.drives.lift_pos = liftPos->value();
+ orte.drives.pusher = pusher->value();
ORTEPublicationSend(orte.publication_drives);
brushLeftLEdit->setText(QString("%1").arg(orte.drives.brush_left));
brushRightLEdit->setText(QString("%1").arg(orte.drives.brush_right));
- roboBagrLEdit->setText(QString("%1").arg(orte.drives.bagr));
- carouselLEdit->setText(QString("%1").arg(orte.drives.carousel_pos));
+ liftPosLEdit->setText(QString("%1").arg(orte.drives.lift_pos));
+ pusherLEdit->setText(QString("%1").arg(orte.drives.pusher));
}