-
Notifications
You must be signed in to change notification settings - Fork 1
/
configwidget.h
138 lines (124 loc) · 4.21 KB
/
configwidget.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/*
grSim - RoboCup Small Size Soccer Robots Simulator
Copyright (C) 2011, Parsian Robotic Center (eew.aut.ac.ir/~parsian/grsim)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CONFIGWIDGET_H
#define CONFIGWIDGET_H
#include "parammanager.h"
namespace ZSS{
class ParamManagerSimulator:public ParamManager{
public:
ParamManagerSimulator():ParamManager("zss_simulator.ini"){}
~ParamManagerSimulator(){}
};
typedef Singleton<ParamManagerSimulator> pm;
}
#define DEF_VALUE(type,Type,name) \
type v_##name; \
inline type name() { return v_##name; }
#define DEF_ENUM(type,name) \
DEF_VALUE(type,type,name)
class RobotSettings {
public:
//geometeric settings
double RobotCenterFromKicker;
double RobotRadius;
double RobotHeight;
double BottomHeight;
double KickerZ;
double KickerThickness;
double KickerWidth;
double KickerHeight;
double NoSpiralWidth;
double WheelRadius;
double WheelThickness;
double Wheel1Angle;
double Wheel2Angle;
double Wheel3Angle;
double Wheel4Angle;
//physical settings
double BodyMass;
double WheelMass;
double KickerMass;
double KickerDampFactor;
double RollerTorqueFactor;
double RollerPerpendicularTorqueFactor;
double Kicker_Friction;
double WheelTangentFriction;
double WheelPerpendicularFriction;
double Wheel_Motor_FMax;
};
class ConfigWidget
{
public:
ConfigWidget();
virtual ~ConfigWidget();
QSettings* robot_settings;
RobotSettings robotSettings;
RobotSettings blueSettings;
RobotSettings yellowSettings;
/* Geometry/Game Vartypes */
DEF_VALUE(int,Int,Robots_Count)
DEF_VALUE(double,Double,Field_Line_Width)
DEF_VALUE(double,Double,Field_Length)
DEF_VALUE(double,Double,Field_Width)
DEF_VALUE(double,Double,Field_Rad)
DEF_VALUE(double,Double,Field_Free_Kick)
DEF_VALUE(double,Double,Field_Penalty_Width)
DEF_VALUE(double,Double,Field_Penalty_Depth)
DEF_VALUE(double,Double,Field_Penalty_Point)
DEF_VALUE(double,Double,Field_Margin)
DEF_VALUE(double,Double,Field_Referee_Margin)
DEF_VALUE(double,Double,Wall_Thickness)
DEF_VALUE(double,Double,Goal_Thickness)
DEF_VALUE(double,Double,Goal_Depth)
DEF_VALUE(double,Double,Goal_Width)
DEF_VALUE(double,Double,Goal_Height)
DEF_VALUE(double,Double,overlap)
DEF_VALUE(QString,String,YellowTeam)
DEF_VALUE(QString,String,BlueTeam)
DEF_VALUE(double,Double,BallRadius)
DEF_VALUE(double,Double,BallMass)
DEF_VALUE(double,Double,BallFriction)
DEF_VALUE(double,Double,BallSlip)
DEF_VALUE(double,Double,BallBounce)
DEF_VALUE(double,Double,BallBounceVel)
DEF_VALUE(double,Double,BallLinearDamp)
DEF_VALUE(double,Double,BallAngularDamp)
DEF_VALUE(bool,Bool,SyncWithGL)
DEF_VALUE(double,Double,DesiredFPS)
DEF_VALUE(double,Double,DeltaTime)
DEF_VALUE(int,Int,sendGeometryEvery)
DEF_VALUE(double,Double,Gravity)
DEF_VALUE(QString,String,VisionMulticastAddr)
DEF_VALUE(int,Int,VisionMulticastPort)
DEF_VALUE(int,Int,CommandListenPort)
DEF_VALUE(int,Int,BlueStatusSendPort)
DEF_VALUE(int,Int,YellowStatusSendPort)
DEF_VALUE(int,Int,sendDelay)
DEF_VALUE(bool,Bool,noise)
DEF_VALUE(double,Double,noiseDeviation_x)
DEF_VALUE(double,Double,noiseDeviation_y)
DEF_VALUE(double,Double,noiseDeviation_angle)
DEF_VALUE(bool,Bool,vanishing)
DEF_VALUE(double,Double,ball_vanishing)
DEF_VALUE(double,Double,blue_team_vanishing)
DEF_VALUE(double,Double,yellow_team_vanishing)
DEF_VALUE(QString, String, plotter_addr)
DEF_VALUE(int, Int, plotter_port)
DEF_VALUE(bool, Bool, plotter)
void loadRobotSettings(QString team);
public slots:
void loadRobotsSettings();
};
#endif // CONFIGWIDGET_H