1 package cz.cuni.amis.pogamut.usar2004.communication.messages.usarcommands;
2
3 import cz.cuni.amis.pogamut.base.communication.messages.*;
4 import cz.cuni.amis.pogamut.usar2004.communication.messages.datatypes.CustomTypes.*;
5
6
7
8
9
10
11
12
13 public class DriveAerial extends CommandMessage
14 {
15
16 public DriveAerial(double AltitudeVelocity, double LinearVelocity, double LateralVelocity, double RotationalVelocity, boolean Normalized)
17 {
18 this.AltitudeVelocity = AltitudeVelocity;
19 this.LinearVelocity = LinearVelocity;
20 this.LateralVelocity = LateralVelocity;
21 this.RotationalVelocity = RotationalVelocity;
22 this.Normalized = Normalized;
23 }
24
25
26
27
28
29 public DriveAerial()
30 {
31 }
32
33
34
35
36
37
38
39
40 protected double AltitudeVelocity = 0;
41
42 public double getAltitudeVelocity()
43 {
44 return AltitudeVelocity;
45 }
46
47 public DriveAerial setAltitudeVelocity(double AltitudeVelocity)
48 {
49 this.AltitudeVelocity = AltitudeVelocity;
50 return this;
51 }
52
53
54
55
56
57
58 protected double LinearVelocity = 0;
59
60 public double getLinearVelocity()
61 {
62 return LinearVelocity;
63 }
64
65 public DriveAerial setLinearVelocity(double LinearVelocity)
66 {
67 this.LinearVelocity = LinearVelocity;
68 return this;
69 }
70
71
72
73
74
75
76 protected double LateralVelocity = 0;
77
78 public double getLaterarVelocity()
79 {
80 return LateralVelocity;
81 }
82
83 public DriveAerial setLaterarVelocity(double LaterarVelocity)
84 {
85 this.LateralVelocity = LaterarVelocity;
86 return this;
87 }
88
89
90
91
92
93
94 protected double RotationalVelocity = 0;
95
96 public double getRotationalVelocity()
97 {
98 return RotationalVelocity;
99 }
100
101 public DriveAerial setRotationalVelocity(double RotationalVelocity)
102 {
103 this.RotationalVelocity = RotationalVelocity;
104 return this;
105 }
106
107
108
109
110
111
112
113
114
115
116
117 protected boolean Normalized = false;
118
119 public boolean isNormalized()
120 {
121 return Normalized;
122 }
123
124
125
126
127
128
129
130
131
132
133
134 public DriveAerial(DriveAerial original)
135 {
136 this.Normalized = original.Normalized;
137 this.AltitudeVelocity = original.AltitudeVelocity;
138 this.LinearVelocity = original.LinearVelocity;
139 this.LateralVelocity = original.LateralVelocity;
140 this.RotationalVelocity = original.RotationalVelocity;
141 }
142
143 @Override
144 public String toString()
145 {
146 return toMessage();
147 }
148
149 public String toHtmlString()
150 {
151 return super.toString()
152 + "<b>AltitudeVelocity</b> : "
153 + String.valueOf(AltitudeVelocity)
154 + " <br/> "
155 + "<b>LinearVelocity</b> : "
156 + String.valueOf(LinearVelocity)
157 + " <br/> "
158 + "<b>LateralVelocity</b> : "
159 + String.valueOf(LateralVelocity)
160 + " <br/> "
161 + "<b>RotationalVelocity</b> : "
162 + String.valueOf(RotationalVelocity)
163 + " <br/> "
164 + "<b>Normalized</b> : "
165 + String.valueOf(Normalized)
166 + " <br/> "
167 + "";
168 }
169
170 public String toMessage()
171 {
172
173 StringBuilder buf = new StringBuilder();
174 buf.append("DRIVE");
175 buf.append(" {Normalized ").append(Normalized).append("}");
176 buf.append(" {AltitudeVelocity ").append(AltitudeVelocity).append("}");
177 buf.append(" {LinearVelocity ").append(LinearVelocity).append("}");
178 buf.append(" {LateralVelocity ").append(LateralVelocity).append("}");
179 buf.append(" {RotationalVelocity ").append(RotationalVelocity).append("}");
180
181 return buf.toString();
182 }
183 }