-
Notifications
You must be signed in to change notification settings - Fork 0
/
walkwindow.cpp
67 lines (52 loc) · 1.28 KB
/
walkwindow.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include "walkwindow.h"
#include "ui_walkwindow.h"
WalkWindow::WalkWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::WalkWindow)
{
ui->setupUi(this);
}
QString QDoubleSpinBox::textFromValue(double val) const
{
return QWidget::locale().toString(val, 'g', 6);
}
WalkWindow::~WalkWindow()
{
delete ui;
}
void WalkWindow::on_pb_send_clicked()
{
zmp_cmd_t cmd;
cmd.walk_type = getWalkType();
cmd.ik_sense = getIKSense();
cmd.max_step_count = ui->spin_steps->value();
cmd.walk_circle_radius = ui->spin_walk_circle_radius->value();
cmd.walk_dist = ui->spin_walk_dist();
if(ui->rad_backward->isChecked()) cmd.walk_dist *= -1;
cmd.walk_sideways = ui->rad_sideways->isChecked();
// TODO: continue from Swing Foot Settings
}
walktype WalkWindow::getWalkType()
{
switch( ui->list_walktype->currentIndex() )
{
case 1:
return walk_line;
case 2:
return walk_circle;
default:
return walk_canned;
}
}
ik_error_sensitivity WalkWindow::getIKSense()
{
switch( ui->list_sensitivity->currentIndex() )
{
case 1:
return ik_swing_permissive;
case 2:
return ik_sloppy;
default:
return ik_strict;
}
}