-
Notifications
You must be signed in to change notification settings - Fork 1
/
mainwindow.h
67 lines (53 loc) · 2.03 KB
/
mainwindow.h
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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <Eigen/Dense>
#include "tendon_robot.h"
#include "robot_controller.h"
#include "vtk_visualizer.h"
#include "lib/qcustomplot.h"
#include <QSplitter>
#include <QButtonGroup>
#include <QDoubleSpinBox>
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
protected:
bool eventFilter(QObject* obj, QEvent* event);
private slots:
void on_posePlotCheckBox_stateChanged(int checked);
void on_calculateButton_clicked();
private:
Ui::MainWindow *ui;
QButtonGroup robotSelectBtnGroup;
int selectedRobotId;
// Tip pose plotting
QCustomPlot posePlot;
QCPAxisRect *xPlotAxes, *yPlotAxes, *zPlotAxes, *rollPlotAxes, *pitchPlotAxes, *yawPlotAxes;
QCPGraph *xPlot, *yPlot, *zPlot, *rollPlot, *pitchPlot, *yawPlot;
std::vector<TendonRobot> robots;
std::vector<Eigen::VectorXd> segLengthUI;
std::vector<Eigen::VectorXd> segLengthOld; // Record previous backbone length for animation
std::vector<Eigen::MatrixXd> tendonLengthChangeUI;
std::vector<Eigen::MatrixXd> tendonLengthChangeOld; // Record previous tendon length change for animation
std::vector<Eigen::MatrixXi> tendonLengthChangeMod; // Record if each value is modified
BaseController* controller;
int maxFrameNum; // Maximum number of frame updates per path planning calculation
int frameFreq; // Frame update frequency
VtkVisualizer* visualizer;
bool ReadFromXMLFile(QString const& fileName);
void InitializeRobotConfig(TendonRobot & robot, int robotId);
void UpdateSingleTendon(int seg, int tend, double newLenChg, QDoubleSpinBox* tenLenBox);
void SwitchRobotInput(); // When clicking radio button, reset input GUI to stored value of that robot
// Tip pose plotting
void InitPosePlot();
void DeletePosePlot();
void UpdatePosePlot(double t, Eigen::Matrix4d pose);
};
#endif // MAINWINDOW_H