Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SocialAgents3D
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thomas Pitiot
SocialAgents3D
Commits
a05111cb
Commit
a05111cb
authored
Mar 28, 2013
by
pitiot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
maj scenar corridor
parent
4c9e4a57
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
src/simulator.cpp
src/simulator.cpp
+10
-8
No files found.
src/simulator.cpp
View file @
a05111cb
...
...
@@ -392,9 +392,12 @@ void Simulator::setupCircleScenario(unsigned int nbAgents , unsigned int nbObsta
void
Simulator
::
setupCorridorScenario
(
unsigned
int
nbAgents
,
unsigned
int
nbObstacles
)
{
VEC3
xSide
(
5.0
f
,
0.0
f
,
0.0
f
);
VEC3
ySide
(
0.0
f
,
10.0
f
,
0.0
f
);
if
(
multires
)
{
envMap_.init(config, 1600.0f, 960.0f, minSize, 320.0f) ; //grosses cases
// envMap_.init(config, 1600.0f, 960.0f, minSize, 320.0f) ; //grosses cases
envMap_
.
init
(
config
,
nbObstacles
>
10
?
((
nbObstacles
*
20
*
xSide
[
0
])
/
6
)
:
500.0
f
,
960.0
f
,
minSize
,
320.0
f
)
;
//grosses cases
}
else
{
...
...
@@ -414,12 +417,12 @@ void Simulator::setupCorridorScenario(unsigned int nbAgents, unsigned int nbObst
// Départ des agents du quart gauche sur toute la hauteur
int
xStartMin
=
envMap_
.
geometry
.
min
()[
0
]
+
xBorder
;
int xStartDelta = envMap_.geometry.size(0) /
5
;
int
xStartDelta
=
envMap_
.
geometry
.
size
(
0
)
/
10
;
int
yStartMin
=
envMap_
.
geometry
.
min
()[
1
]
+
yBorder
;
int
yStartDelta
=
envMap_
.
geometry
.
size
(
1
)
-
2
*
yBorder
;
// Arrivée des agents à l'opposée
int xGoalDelta = envMap_.geometry.size(0) /
5
;
int
xGoalDelta
=
envMap_
.
geometry
.
size
(
0
)
/
10
;
int
xGoalMin
=
envMap_
.
geometry
.
max
()[
0
]
-
xBorder
-
xGoalDelta
;
int
yGoalMin
=
yStartMin
;
int
yGoalDelta
=
yStartDelta
;
...
...
@@ -437,8 +440,8 @@ void Simulator::setupCorridorScenario(unsigned int nbAgents, unsigned int nbObst
}
// Départ des obstacles du quart haut sur toute une demi-largeur
xStartMin = envMap_.geometry.min()[0] + envMap_.geometry.size(0) /
4
;
xStartDelta =
envMap_.geometry.size(0) / 2
;
xStartMin
=
envMap_
.
geometry
.
min
()[
0
]
+
envMap_
.
geometry
.
size
(
0
)
/
5
;
xStartDelta
=
6
*
envMap_
.
geometry
.
size
(
0
)
/
10
;
yStartMin
=
envMap_
.
geometry
.
min
()[
1
]
+
yBorder
;
yStartDelta
=
envMap_
.
geometry
.
size
(
1
)
/
5
;
...
...
@@ -446,14 +449,13 @@ void Simulator::setupCorridorScenario(unsigned int nbAgents, unsigned int nbObst
yGoalDelta
=
envMap_
.
geometry
.
size
(
1
)
/
5
;
yGoalMin
=
envMap_
.
geometry
.
max
()[
1
]
-
yBorder
-
yGoalDelta
;
VEC3 xSide (5.0f,0.0f,0.0f);
VEC3 ySide (0.0f,10.0f,0.0f);
std
::
vector
<
VEC3
>
vPos
;
MovingObstacle
*
mo4
;
for
(
unsigned
int
i
=
0
;
i
<
nbObstacles
;
i
++
)
{
float x = xStartMin + ((int)
i*30
) % xStartDelta;
float
x
=
xStartMin
+
((
int
)
(
i
*
2
*
xSide
[
0
])
)
%
xStartDelta
;
// std::cout << "x ? " << x << " xStartDelta " << xStartDelta << std::endl;
VEC3
start
(
x
,
yStartMin
+
rand
()
%
yStartDelta
,
0
)
;
VEC3
goal
(
x
,
yGoalMin
+
rand
()
%
yGoalDelta
,
0
)
;
...
...
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