Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Motor_Controller
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
Spring
WP6_Robot_Behavior
Motor_Controller
Commits
27bc59e8
Commit
27bc59e8
authored
1 year ago
by
AUTERNAUD Alex
Browse files
Options
Downloads
Patches
Plain Diff
create SocialSpaces once
parent
9f02c51f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
social_mpc/controller.py
+6
-7
6 additions, 7 deletions
social_mpc/controller.py
with
6 additions
and
7 deletions
social_mpc/controller.py
+
6
−
7
View file @
27bc59e8
...
@@ -491,12 +491,6 @@ class RobotController():
...
@@ -491,12 +491,6 @@ class RobotController():
def
get_social_cost_map
(
self
,
state
):
def
get_social_cost_map
(
self
,
state
):
tic
=
time
.
time
()
tic
=
time
.
time
()
groups
=
None
groups
=
None
world_size
=
state
.
config
.
local_map_size
ssn
=
SocialSpaces
(
bbox
=
world_size
,
map_shape
=
(
state
.
config
.
local_map_height
,
state
.
config
.
local_map_width
))
ids
=
np
.
where
(
state
.
humans_visible
==
0
)[
0
]
ids
=
np
.
where
(
state
.
humans_visible
==
0
)[
0
]
# ids = ids[ids != state.humans_id.tolist().index(self.human_target_id)]
# ids = ids[ids != state.humans_id.tolist().index(self.human_target_id)]
n_human
=
len
(
ids
)
n_human
=
len
(
ids
)
...
@@ -520,7 +514,7 @@ class RobotController():
...
@@ -520,7 +514,7 @@ class RobotController():
else
:
else
:
break
break
f_dsz
=
ssn
.
calc_dsz
(
humans
,
groups
=
groups
)
f_dsz
=
self
.
ssn
.
calc_dsz
(
humans
,
groups
=
groups
)
rospy
.
logdebug
(
"
Social cost map time : {0}
"
.
format
(
time
.
time
()
-
tic
))
rospy
.
logdebug
(
"
Social cost map time : {0}
"
.
format
(
time
.
time
()
-
tic
))
return
f_dsz
return
f_dsz
...
@@ -720,6 +714,11 @@ class RobotController():
...
@@ -720,6 +714,11 @@ class RobotController():
self
.
set_targets
(
state
=
state
)
self
.
set_targets
(
state
=
state
)
self
.
set_mode
()
self
.
set_mode
()
self
.
set_weights
()
self
.
set_weights
()
world_size
=
state
.
config
.
local_map_size
self
.
ssn
=
SocialSpaces
(
bbox
=
world_size
,
map_shape
=
(
state
.
config
.
local_map_height
,
state
.
config
.
local_map_width
))
self
.
compute_cost_map
(
state
)
self
.
compute_cost_map
(
state
)
if
self
.
update_goals_enabled
or
self
.
path_planner_enabled
:
if
self
.
update_goals_enabled
or
self
.
path_planner_enabled
:
...
...
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