10 #include <QVBoxLayout> 12 #include <QPushButton> 18 {
"t",
"x",
"y",
"theta",
"v",
"omega",
"v",
"omega"};
26 : QWidget(&parent), output(NULL), motion_GUI() {
28 QVBoxLayout *layout =
new QVBoxLayout(
this);
29 QGroupBox *odom_box =
new QGroupBox( tr(
"Odometry"),
this),
30 *cmd_box =
new QGroupBox( tr(
"Commands"),
this), *a_box;
31 layout->addWidget(odom_box);
32 layout->addWidget(cmd_box);
33 QGridLayout *odom_layout =
new QGridLayout(odom_box),
34 *cmd_layout =
new QGridLayout(cmd_box), *a_layout;
35 static const char *init_val =
"----.--";
37 for(idx = 0, a_layout = odom_layout; idx <
nbLabels; idx++) {
39 if (idx ==
nbOdoms) a_layout = cmd_layout;
41 const int nbCols = 3, dId = (idx ==
tOdom ?
nbOdoms - 1 :
45 line = dId / nbCols, col = (2 * dId) % (2 * nbCols);
50 sprintf(name,
"%s%s%s", isGreek ?
"<span>&" :
"<em>",
51 names[idx], isGreek ?
";</span>:" :
"</em>:");
52 a_layout->addWidget(
new QLabel( tr(name) ), line, col);
53 labels[idx].setText(init_val);
54 a_layout->addWidget(&(
labels[idx]), line, col + 1);
56 QPushButton *motionBtn =
new QPushButton(
"Historic");
57 layout->addWidget(motionBtn);
58 connect( motionBtn, SIGNAL( clicked() ),
71 static const QString val(
"%1");
73 const double *data_prt = data;
74 QLabel *label_prt = &(
labels[offset]);
75 for(idx = 0; idx < nbData; idx++, data_prt++, label_prt++)
79 ? val.arg(iSeeML::Object::rad2deg(*data_prt), 0,
'f', 0)
80 : val.arg(*data_prt, 0,
'f', 2) );
87 const iSeeML::geom::Point& P = q.position();
89 {state.
date(), P.xCoord(), P.yCoord(), q.orientation(),
95 for(idx = 0; idx <
nbOdoms; idx++)
96 *
output << data[idx] <<
'\t';
106 const double& rot_vel) {
107 const double data[] = {trans_vel, rot_vel};
const double & rotationVelocity() const
Gives the rotation velocity of the state.
const iSeeML::rob::OrPtConfig & configuration() const
Gives the configuration of the state.
const double & translationVelocity() const
Gives the translation velocity of the state.
const double & date() const
Gives the configuration of the state.
Qt widget displaying data for qt_ctrl.
This class defines a state, i.e. a configuration and its (translation and rotation) velocities...
void addState(const State &state, const Qt::GlobalColor motion_color=Qt::blue)