Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
René Søndergaard Nilsson
LEGO
Commits
c250b4ac
Commit
c250b4ac
authored
Jun 09, 2015
by
ivangrujic
Browse files
ParticleOdometry
parent
2f4779e1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Lesson10/Programs/PilotMonitor/src/ParticleSet.java
View file @
c250b4ac
...
...
@@ -20,8 +20,8 @@ public class ParticleSet
{
// Instance variables
private
float
distanceNoiseFactor
=
0.
2
f
;
//0.2f;
private
float
angleNoiseFactor
=
4
;
//4f;
private
float
distanceNoiseFactor
=
0.
005
f
;
//0.2f;
private
float
angleNoiseFactor
=
2.5f
;
//4f;
private
int
numParticles
;
private
Particle
[]
particles
;
...
...
Lesson10/Programs/PilotMonitor/src/PilotMonitor.java
View file @
c250b4ac
...
...
@@ -19,7 +19,7 @@ public class PilotMonitor
private
InputOutputStreams
NXT
;
private
boolean
USB
=
false
;
private
Route
route
=
new
Route
();
private
ParticleSet
particles
=
new
ParticleSet
(
10
);
private
ParticleSet
particles
=
new
ParticleSet
(
10
0
);
private
PilotGUI
view
=
new
PilotGUI
(
particles
);
private
Move
move
;
...
...
@@ -43,7 +43,7 @@ public class PilotMonitor
m
=
new
Move
(
(
type
==
0
)?
Move
.
MoveType
.
TRAVEL
:
Move
.
MoveType
.
ROTATE
,
distance
,
angle
,
false
);
System
.
out
.
println
(
"Move "
+
distance
+
" "
+
angle
);
return
new
Move
(
Move
.
MoveType
.
TRAVEL
,
50
,
0
,
false
)
;
return
m
;
}
public
void
go
()
...
...
Lesson10/Programs/PilotRoute/src/PilotRoute.java
View file @
c250b4ac
...
...
@@ -8,7 +8,7 @@ public class PilotRoute
private
double
distFactor
=
0.99
;
private
double
wheelDiameterL
=
5.595
*
distFactor
,
wheelDiameterR
=
5.6
*
distFactor
,
trackWidth
=
16.27
;
private
double
travelSpeed
=
5
,
rotateSpeed
=
45
;
private
double
travelSpeed
=
2
5
,
rotateSpeed
=
45
;
private
NXTRegulatedMotor
left
=
Motor
.
B
;
private
NXTRegulatedMotor
right
=
Motor
.
C
;
...
...
@@ -49,10 +49,13 @@ public class PilotRoute
Sound
.
twoBeeps
();
travel
(
50
);
rotate
(
-
90
);
rotate
(
90
);
travel
(
50
);
rotate
(
-
90
);
rotate
(
90
);
travel
(
50
);
rotate
(
90
);
travel
(
50
);
rotate
(
90
);
while
(
!
Button
.
ENTER
.
isDown
())
Thread
.
yield
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment