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
6e030631
Commit
6e030631
authored
Sep 27, 2013
by
pitiot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pop
parent
31b1668a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
43 additions
and
26 deletions
+43
-26
cams/cam.out~
cams/cam.out~
+6
-5
include/env_map.h
include/env_map.h
+1
-1
src/agent.cpp
src/agent.cpp
+1
-1
src/moving_obstacle.cpp
src/moving_obstacle.cpp
+18
-3
src/simulator.cpp
src/simulator.cpp
+3
-2
src/viewer.cpp
src/viewer.cpp
+14
-14
No files found.
cams/cam.out~
View file @
6e030631
0 2892
0 13.2112 -343.6 594.385 10.9265 -307.115 501.306 0.0322209 0.930812 0.364074
1637 13.2112 -343.6 594.385 10.9265 -307.115 501.306 0.0322209 0.930812 0.364074
2263 -225.649 -65.4916 186.836 -153.811 -25.9154 129.625 0.511978 0.255997 0.819966
2892 154.528 244.386 80.6884 119.103 153.875 57.1753 0.0753229 -0.278238 0.957554
925 268.919 -599.764 174.022 229.193 -513.318 143.218 -0.154631 0.267809 0.950982
1420 114.119 -361.09 564.72 97.6865 -312.66 478.787 -0.25495 0.820722 0.511289
3115 -119.914 -198.458 186.027 -85.6747 -137.812 114.265 0.346014 0.628714 0.696415
4784 -179.491 -194.446 135.444 -125.036 -132.211 79.2166 0.368223 0.424929 0.826951
7798 -179.204 -102.848 442.481 -148.784 -85.0303 348.901 0.727103 0.591244 0.34893
12828 -125.14 -65.2268 467.511 -106.094 -55.2945 369.845 0.762254 0.611961 0.210886
include/env_map.h
View file @
6e030631
...
...
@@ -34,7 +34,7 @@ class ArticulatedObstacle;
//#define EXPORTING3
#define TWO_AND_HALF_DIM
//
#define TWO_AND_HALF_DIM
#ifdef EXPORTING3
...
...
src/agent.cpp
View file @
6e030631
...
...
@@ -763,7 +763,7 @@ void Agent::computeNewVelocity()
VEC3 normFace = VEC3 (0,0,1);
#endif
double collision_softening_factor;
float
ag_ambient_damping
=
10.0
;
float ag_ambient_damping = 10
00
.0;
// double mass_var = 0.95;
// double average_mass = 1.0;
...
...
src/moving_obstacle.cpp
View file @
6e030631
...
...
@@ -168,6 +168,14 @@ MovingObstacle::MovingObstacle(Simulator* sim, int ind, std::vector<VEC3> pos, s
speed_detection_factor
(
100
)
{
double
stiff_agent
=
500
;
double
radius_agent
=
30
;
double
stiff_obst
=
0.01
;
double
radius_obst
=
12
;
double
long_radius_agent
=
40
;
double
long_radius_obst
=
10
;
for
(
unsigned
int
i
=
0
;
i
<
nbVertices
;
++
i
)
{
...
...
@@ -386,7 +394,7 @@ MovingObstacle::MovingObstacle(Simulator* sim, int ind, std::vector<VEC3> pos, s
{
Obstacle
*
o
=
new
Obstacle
(
parts_
[
i
]
->
getPosition
(),
parts_
[(
i
+
1
)
%
nbVertices
]
->
getPosition
(),
this
,
i
,
1000
,
0.01
,
100
,
12
);
this
,
i
,
stiff_agent
,
stiff_obst
,
radius_agent
,
radius_obst
);
obstacles_
.
push_back
(
o
);
/////definition du troisieme point
if
(
rigid_
)
o
->
p3
=
parts_
[(
i
+
2
)
%
nbVertices
]
->
getPosition
();
...
...
@@ -400,7 +408,7 @@ MovingObstacle::MovingObstacle(Simulator* sim, int ind, std::vector<VEC3> pos, s
{
Obstacle
*
o
=
new
Obstacle
(
parts_
[
nbVertices
]
->
getPosition
(),
parts_
[
nbVertices
+
1
]
->
getPosition
(),
this
,
nbVertices
,
1000
,
100
,
500
,
20
);
this
,
nbVertices
,
stiff_agent
,
stiff_obst
,
long_radius_agent
,
long_radius_obst
);
obstacles_
.
push_back
(
o
);
...
...
@@ -511,6 +519,7 @@ void MovingObstacle::draw(bool showPath)
{
m_ds
->
newList
(
GL_COMPILE_AND_EXECUTE
);
m_ds
->
begin
(
GL_LINE_STRIP
);
VEC3
col
=
Utils
::
color_map_BCGYR
(
float
(
index
)
/
float
(
sim_
->
movingObstacles_
.
size
()));
...
...
@@ -526,7 +535,8 @@ void MovingObstacle::draw(bool showPath)
m_ds
->
end
();
m_ds
->
endList
();
}
}
}
VEC3
MovingObstacle
::
getDilatedPosition
(
unsigned
int
ind
)
...
...
@@ -1619,6 +1629,11 @@ void MovingObstacle::computePrefVelocity() //calcul du vecteur optimal pour atte
if
(
goalDist2
<
(
rigid_
?
5
:
1.4
)
*
(
gravity_dist
*
gravity_dist
)
)
{
curGoal_
=
(
curGoal_
+
1
)
%
goals_
.
size
()
;
velocity_factor
/=
1.3
;
goalVector
=
goals_
[
curGoal_
]
-
center
;
// goalVector = goals_[curGoal_] - position[groundFace] ;
goalDist2
=
goalVector
.
norm2
()
;
...
...
src/simulator.cpp
View file @
6e030631
...
...
@@ -497,6 +497,7 @@ void Simulator::setupCrowdedScenario(unsigned int nbAgents , unsigned int nbObst
start
=
center
;
float
mapSize
=
(
envMap_
.
geometry
.
max
()[
1
]
-
envMap_
.
geometry
.
min
()[
1
]);
start
[
1
]
-=
mapSize
/
4
;
start
[
0
]
-=
10.0
f
;
std
::
vector
<
VEC3
>
goals
;
VEC3
goal
;
...
...
@@ -513,11 +514,11 @@ if(snake==1)
positions
[
0
]
=
vPos
;
goal
=
center
;
goals
.
push_back
(
goal
);
goal
=
center
+
VEC3
(
mapSize
/
4
,
mapSize
/
4
,
0
);
goal
=
center
+
VEC3
(
mapSize
/
6
,
mapSize
/
6
,
0
);
goals
.
push_back
(
goal
);
goal
=
center
;
goals
.
push_back
(
goal
);
goal
=
center
+
VEC3
(
-
mapSize
/
4
,
mapSize
/
4
,
0
);
goal
=
center
+
VEC3
(
-
mapSize
/
6
,
mapSize
/
6
,
0
);
goals
.
push_back
(
goal
);
goal
=
center
;
goals
.
push_back
(
goal
);
...
...
src/viewer.cpp
View file @
6e030631
...
...
@@ -2170,21 +2170,21 @@ int main(int argc, char** argv)
glewInit();
//
sa.cam_output_file.open("cams/cam.out",std::ofstream::out);
//
char camfile[100];
//
sprintf(camfile,"cams/cam.scn%d.spline",config);
//
// sa.readCameraInputFile("cams/toto"
);
//
if(sa.cif_exists)
//
{
//
unsigned int i;
//
//
for(i=0;i<sa.cif_begin;i++)
//
{
//
sa.nbIterations = sa.cif_begin;
sa.cam_output_file.open("cams/cam.out",std::ofstream::out);
char camfile[100];
sprintf(camfile,"cams/cam.scn%d.spline",config);
sa.readCameraInputFile(camfile
);
if(sa.cif_exists)
{
unsigned int i;
for(i=0;i<sa.cif_begin;i++)
{
sa.nbIterations = sa.cif_begin;
sa.simulator.doStep();
//
}
//
}
}
}
sa.show() ;
// if (argc > 1)
...
...
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