-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathClass1.cs
66 lines (57 loc) · 1.49 KB
/
Class1.cs
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DrRobot.JaguarControl
{
class Robot
{
float x;
float y;
float t;
public Robot()
{
x = initialX;
y = initialY;
t = initialT;
Initialize();
}
public Robot(float _x, float _y, float _t)
{
x = _x;
y = _y;
t = _t;
Initialize();
}
public void Initialize()
{
x_est = initialX;
y_est = initialY;
t_est = initialT;
// Set desired state
desiredX = initialX;
desiredY = initialY;
desiredT = initialT;
// Reset Localization Variables
currentEncoderPulse1 = 0;
currentEncoderPulse2 = 0;
lastEncoderPulse1 = 0;
lastEncoderPulse2 = 0;
wheelDistanceR = 0;
wheelDistanceL = 0;
// Set default to simulator mode
robotType = ROBOT_TYPE_SIMULATED;
// Stop all experiments by default
controllerType = CONTROLLERTYPE_MANUALCONTROL;
// Set random start for particles
InitializeParticles();
// Set default to no motionPlanRequired
motionPlanRequired = false;
// Set visual display
tiltAngle = 25.0;
zoom = 2.0;
displayParticles = true;
displayNodes = true;
displaySimRobot = true;
}
}