Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Krabi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Victor
Krabi
Commits
ecedb2e9
Commit
ecedb2e9
authored
13 years ago
by
Grégoire Payen de La Garanderie
Browse files
Options
Downloads
Patches
Plain Diff
Simplification du design de la classe Odometrie pour la simulation.
parent
feae951d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
stm32/include/odometrie.h
+8
-5
8 additions, 5 deletions
stm32/include/odometrie.h
stm32/include/simul/robot.h
+1
-1
1 addition, 1 deletion
stm32/include/simul/robot.h
stm32/src/simul/robot.cpp
+23
-27
23 additions, 27 deletions
stm32/src/simul/robot.cpp
with
32 additions
and
33 deletions
stm32/include/odometrie.h
+
8
−
5
View file @
ecedb2e9
...
...
@@ -7,12 +7,15 @@
#ifndef ROBOTHW
class
Odometrie
{
private:
class
Robot
*
robot
;
public:
virtual
PositionPlusAngle
getPos
()
=
0
;
virtual
void
setPos
(
PositionPlusAngle
p
)
=
0
;
virtual
Angle
getVitesseAngulaire
()
=
0
;
virtual
Distance
getVitesseLineaire
()
=
0
;
virtual
void
update
()
{
};
Odometrie
(
Robot
*
robot
);
PositionPlusAngle
getPos
();
void
setPos
(
PositionPlusAngle
p
);
Angle
getVitesseAngulaire
();
Distance
getVitesseLineaire
();
void
update
()
{
};
};
#else
...
...
This diff is collapsed.
Click to expand it.
stm32/include/simul/robot.h
+
1
−
1
View file @
ecedb2e9
...
...
@@ -18,7 +18,7 @@ public:
PositionPlusAngle
deriv
;
boost
::
circular_buffer
<
PositionPlusAngle
>
olds
;
class
Asservissement
*
asservissement
;
class
Odo
Robot
*
odometrie
;
class
Odo
metrie
*
odometrie
;
class
Strategie
*
strategie
;
b2Body
*
body
;
...
...
This diff is collapsed.
Click to expand it.
stm32/src/simul/robot.cpp
+
23
−
27
View file @
ecedb2e9
...
...
@@ -8,37 +8,33 @@
#include
"strategie.h"
#include
<iostream>
class
OdoRobot
:
public
Odometrie
//Odometrie class implementation for the simulation
//Yes, it's ugly ! it should not be in this file.
//But in a separate file
Odometrie
::
Odometrie
(
Robot
*
robot
)
{
private:
Robot
*
robot
;
public:
OdoRobot
(
Robot
*
robot
)
{
this
->
robot
=
robot
;
}
this
->
robot
=
robot
;
}
PositionPlusAngle
getPos
()
{
return
robot
->
pos
;
}
PositionPlusAngle
Odometrie
::
getPos
()
{
return
robot
->
pos
;
}
Distance
getVitesseLineaire
()
{
return
robot
->
deriv
.
position
.
getNorme
();
}
Distance
Odometrie
::
getVitesseLineaire
()
{
return
robot
->
deriv
.
position
.
getNorme
();
}
Angle
getVitesseAngulaire
()
{
return
robot
->
deriv
.
angle
;
}
Angle
Odometrie
::
getVitesseAngulaire
()
{
return
robot
->
deriv
.
angle
;
}
void
setPos
(
PositionPlusAngle
p
)
{
robot
->
pos
=
p
;
}
};
void
Odometrie
::
setPos
(
PositionPlusAngle
p
)
{
robot
->
pos
=
p
;
}
Robot
::
Robot
(
b2World
&
world
)
:
world
(
world
),
olds
(
10000
)
...
...
@@ -50,7 +46,7 @@ Robot::Robot(b2World & world) : world(world), olds(10000)
joint
=
NULL
;
level
=
0
;
odometrie
=
new
Odo
Robot
(
this
);
odometrie
=
new
Odo
metrie
(
this
);
asservissement
=
new
Asservissement
(
odometrie
);
strategie
=
new
Strategie
(
true
,
odometrie
);
asservissement
->
strategie
=
strategie
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment