Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Em6
robotique
Commits
409018b2
Commit
409018b2
authored
Mar 24, 2016
by
root
Browse files
Merge branch 'master' of /srv/git/hook_robotique/../repositories/gitRobotique
parents
848c908b
aadf5eea
Changes
3
Hide whitespace changes
Inline
Side-by-side
stm32/src/strategie/cabine.cpp
View file @
409018b2
...
...
@@ -10,9 +10,9 @@
Cabine
::
Cabine
(){}
Cabine
::
Cabine
(
Position
p
osition
)
:
MediumLevelAction
(
p
osition
)
Cabine
::
Cabine
(
Position
goalP
osition
)
:
MediumLevelAction
(
goalP
osition
)
{
goalPosition
=
this
->
goalPosition
;
}
Cabine
::~
Cabine
(){}
...
...
@@ -27,11 +27,41 @@ int Cabine::update()
if
(
status
==
0
)
//Début
{
StrategieV2
::
setCurrentGoal
(
this
->
getGoalPosition
(),
false
,
VITESSE_LINEAIRE_MAX
,
-
100.0
,
200.
f
);
#ifndef ROBOTHW
qDebug
()
<<
"O
uverture cabin
e"
;
qDebug
()
<<
"O
n se prepare a pousser une port
e"
;
#endif
status
++
;
}
else
if
(
status
==
1
)
{
if
(
Command
::
isNear
(
this
->
getGoalPosition
(),
200.0
f
))
// le second paramètre est la distance a l'objectif
{
// après avoir poussé les cubes on revient en marche arrière
StrategieV2
::
setCurrentGoal
(
Position
(
600
,
900
),
true
,
VITESSE_LINEAIRE_MAX
,
-
100.0
,
10.
f
);
#ifndef ROBOTHW
qDebug
()
<<
"On revient en marche arriere au point ou on prend son elan"
;
#endif
status
++
;
}
}
else
if
(
status
==
2
)
{
if
(
Command
::
isNear
(
Position
(
600
,
900
),
10.0
f
))
// le second paramètre est la distance a l'objectif
{
#ifndef ROBOTHW
qDebug
()
<<
"On est revenu au point ou on prend son elan"
;
#endif
status
++
;
}
}
else
if
(
status
==
3
)
{
#ifndef ROBOTHW
qDebug
()
<<
"Etape fermeture de cabine finie"
;
#endif
status
=
-
1
;
}
return
status
;
}
stm32/src/strategie/cubeDebut.cpp
View file @
409018b2
...
...
@@ -47,6 +47,9 @@ int CubeDebut::update()
}
else
if
(
status
==
2
)
{
// A faire, ne pas hardcoder la position
if
(
Command
::
isNear
(
Position
(
600
,
900
),
10.0
f
))
// le second paramètre est la distance a l'objectif
{
#ifndef ROBOTHW
...
...
stm32/src/strategie/krabi2016.cpp
View file @
409018b2
...
...
@@ -23,32 +23,39 @@ Krabi2016::Krabi2016(bool isYellow) : StrategieV3(isYellow)
/** Points de passage **/
int
wa
=
Etape
::
makeEtape
(
Position
(
600
,
900
,
true
));
int
wb
=
Etape
::
makeEtape
(
Position
(
680
,
740
,
true
));
int
wb
=
Etape
::
makeEtape
(
Position
(
680
,
700
,
true
));
int
wc
=
Etape
::
makeEtape
(
Position
(
1000
,
500
,
true
));
int
wd
=
Etape
::
makeEtape
(
Position
(
400
,
500
,
true
));
// On crée l'étape "pousse les cubes du début"
int
c1
=
Etape
::
makeEtape
(
new
CubeDebut
(
Position
(
900
,
900
,
true
)));
int
c
d
1
=
Etape
::
makeEtape
(
new
CubeDebut
(
Position
(
900
,
900
,
true
)));
/** Actions **/
// Zone de construction
int
zc1
=
Etape
::
makeEtape
(
new
ZoneConstruction
(
Position
(
98
0
,
92
0
,
true
),
benne
));
int
zc2
=
Etape
::
makeEtape
(
new
ZoneConstruction
(
Position
(
1050
,
105
0
,
true
),
benne
));
int
zc1
=
Etape
::
makeEtape
(
new
ZoneConstruction
(
Position
(
100
0
,
60
0
,
true
),
benne
));
int
zc2
=
Etape
::
makeEtape
(
new
ZoneConstruction
(
Position
(
1050
,
60
0
,
true
),
benne
));
// Pieds
int
pa
=
Etape
::
makeEtape
(
new
RamasserPied
(
Position
(
970
,
260
,
true
)));
int
pb
=
Etape
::
makeEtape
(
new
RamasserPied
(
Position
(
1200
,
260
,
true
)));
// Etc.
// Cabines de plage
int
cp1
=
Etape
::
makeEtape
(
new
Cabine
(
Position
(
250
,
50
,
true
)));
int
cp2
=
Etape
::
makeEtape
(
new
Cabine
(
Position
(
500
,
50
,
true
)));
/** Liens **/
// [WIP]
Etape
::
get
(
start
)
->
addVoisin
(
wa
);
Etape
::
get
(
wa
)
->
addVoisin
(
wb
,
zc2
);
Etape
::
get
(
wa
)
->
addVoisin
(
zc1
);
Etape
::
get
(
c1
)
->
addVoisin
(
wa
);
Etape
::
get
(
wb
)
->
addVoisin
(
zc2
);
Etape
::
get
(
wc
)
->
addVoisin
(
zc1
);
Etape
::
get
(
cd1
)
->
addVoisin
(
wa
);
Etape
::
get
(
cp1
)
->
addVoisin
(
wd
);
Etape
::
get
(
cp2
)
->
addVoisin
(
wd
);
Etape
::
get
(
wc
)
->
addVoisin
(
zc2
);
Etape
::
get
(
wd
)
->
addVoisin
(
wb
);
Etape
::
get
(
pa
)
->
addVoisin
(
wb
,
zc2
);
Etape
::
get
(
pb
)
->
addVoisin
(
pa
,
zc2
);
...
...
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