Skip to content

Commit 6806873

Browse files
committed
Use pedsim_ros implementation
1 parent 29bc731 commit 6806873

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

examples/example.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,20 @@
66
# initial states, each entry is the position, velocity and goal of a pedestrian: [px, py, vx, vy, gx, gy]
77
initial_state = np.array(
88
[
9-
[0.0, 0.0, 0.5, 0.5, 10.0, 10.0],
10-
[0.0, 0.5, 0.5, 0.5, 10.0, 10.0],
11-
[10.0, 0.3, -0.5, 0.5, 0.0, 10.0],
12-
[11.0, 0.3, -0.5, 0.5, 0.0, 10.0],
13-
[12.0, 0.3, -0.5, 0.5, 0.0, 10.0],
9+
# [0.0, 0.0, 0.5, 0.5, 10.0, 10.0],
10+
# [0.0, 0.5, 0.5, 0.5, 10.0, 10.0],
11+
[0.0, 0.0, 0.0, 0.5, 1.0, 30.0],
12+
[1.0, 0.0, 0.0, 0.5, 2.0, 30.0],
13+
[2.0, 0.0, 0.0, 0.5, 3.0, 30.0],
14+
[3.0, 0.0, 0.0, 0.5, 4.0, 30.0],
1415
]
1516
)
1617
# group informoation is represented as listes of indices of the members
17-
groups = [[0, 1], [2, 3, 4]]
18+
groups = [[0, 1, 2, 3]]
1819
# initiate the simulator,
1920
s = psf.Simulator(initial_state, groups=groups, obstacles=None)
2021
# update 80 steps
21-
s.step(80)
22+
s.step(150)
2223

2324
with psf.plot.SceneVisualizer(s, "images/exmaple") as sv:
2425
sv.animate()

images/exmaple.gif

-240 KB
Loading

pysocialforce/simulator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def make_forces(self, force_configs):
6464
group_forces = [
6565
forces.GroupCoherenceForceAlt(),
6666
forces.GroupRepulsiveForce(),
67-
forces.GroupGazeForce(),
67+
forces.GroupGazeForceAlt(),
6868
]
6969
if self.scene_config("enable_group"):
7070
force_list += group_forces

pysocialforce/utils/default.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@ threshold = 3.0
2929

3030

3131
[group_coherence_force]
32-
factor = 2.0
32+
factor = 3.0
3333

3434
[group_repulsive_force]
3535
factor = 1.0
36-
threshold = 0.5
36+
threshold = 0.8
3737

3838
[group_gaze_force]
39-
factor = 5.0
39+
factor = 4.0
4040
# fov params
41-
fov_phi = 100.0
41+
fov_phi = 180.0
4242

4343
[goal_attractive_force]
4444
factor = 1

0 commit comments

Comments
 (0)