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
80006876
Commit
80006876
authored
2 years ago
by
AUTERNAUD Alex
Browse files
Options
Downloads
Patches
Plain Diff
comments added to debug
parent
3abd9278
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
social_mpc/goal.py
+15
-3
15 additions, 3 deletions
social_mpc/goal.py
with
15 additions
and
3 deletions
social_mpc/goal.py
+
15
−
3
View file @
80006876
...
@@ -79,7 +79,8 @@ class GoalFinder():
...
@@ -79,7 +79,8 @@ class GoalFinder():
n_group
=
np
.
sum
(
sh_groups
[:,
-
1
]
>=
0
)
n_group
=
np
.
sum
(
sh_groups
[:,
-
1
]
>=
0
)
sh_groups
=
sh_groups
[
n_group
,
:]
sh_groups
=
sh_groups
[
n_group
,
:]
group_ids
=
np
.
array
(
sh_groups
[
sh_groups
[:,
-
1
]
>=
0
,
-
1
],
dtype
=
int
).
tolist
()
group_ids
=
np
.
array
(
sh_groups
[
sh_groups
[:,
-
1
]
>=
0
,
-
1
],
dtype
=
int
).
tolist
()
logger
.
debug
(
"
human_ids : {}, {}, {}
"
.
format
(
human_ids
,
humans
,
n_human
))
print
(
"
human_ids : {}, {}, {}
"
.
format
(
human_ids
,
humans
,
n_human
))
print
(
"
group_ids : {}, {}, {}
"
.
format
(
group_ids
,
sh_groups
,
n_group
))
target
=
None
target
=
None
if
sh_goto_target_human_id
[
0
]:
if
sh_goto_target_human_id
[
0
]:
...
@@ -119,6 +120,7 @@ class GoalFinder():
...
@@ -119,6 +120,7 @@ class GoalFinder():
if
target
[
0
]
==
'
human_in_group
'
:
if
target
[
0
]
==
'
human_in_group
'
:
center
=
[
sh_groups
[
target
[
2
],
0
],
sh_groups
[
target
[
2
],
1
]]
center
=
[
sh_groups
[
target
[
2
],
0
],
sh_groups
[
target
[
2
],
1
]]
persons
=
humans
[
humans
[:,
-
2
]
==
target
[
2
],
:]
persons
=
humans
[
humans
[:,
-
2
]
==
target
[
2
],
:]
print
(
'
human_in_group : center {}, persons{}
'
.
format
(
center
,
persons
))
goal
=
ssn
.
calc_goal_pos
(
goal
=
ssn
.
calc_goal_pos
(
f_dsz
=
f_dsz
,
f_dsz
=
f_dsz
,
map
=
global_map
,
map
=
global_map
,
...
@@ -126,30 +128,40 @@ class GoalFinder():
...
@@ -126,30 +128,40 @@ class GoalFinder():
group_center
=
center
,
group_center
=
center
,
robot
=
robot_pose
)
robot
=
robot_pose
)
goal
=
list
(
goal
)
goal
=
list
(
goal
)
goal
[
2
]
=
np
.
arctan2
(
goal
[
1
]
-
humans
[
target
[
1
]][
1
],
goal
[
0
]
-
humans
[
target
[
1
]][
0
])
print
(
'
goal human_in_group before {}
'
.
format
(
goal
))
goal
[
2
]
=
np
.
arctan2
(
goal
[
1
]
-
humans
[
target
[
1
]][
1
],
goal
[
0
]
-
humans
[
target
[
1
]][
0
])
# to face the human
print
(
'
goal human_in_group after {}
'
.
format
(
goal
))
elif
target
[
0
]
==
'
isolated_human
'
:
elif
target
[
0
]
==
'
isolated_human
'
:
person
=
humans
[
target
[
1
],
:]
person
=
humans
[
target
[
1
],
:]
ts_x
=
person
[
0
]
+
np
.
cos
(
person
[
2
])
*
stride
ts_x
=
person
[
0
]
+
np
.
cos
(
person
[
2
])
*
stride
ts_y
=
person
[
1
]
+
np
.
sin
(
person
[
2
])
*
stride
ts_y
=
person
[
1
]
+
np
.
sin
(
person
[
2
])
*
stride
center
=
[
ts_x
,
ts_y
]
center
=
[
ts_x
,
ts_y
]
print
(
'
isolated_human : center {}, persons{}
'
.
format
(
center
,
persons
))
goal
=
ssn
.
calc_goal_pos
(
goal
=
ssn
.
calc_goal_pos
(
f_dsz
=
f_dsz
,
f_dsz
=
f_dsz
,
map
=
global_map
,
map
=
global_map
,
persons
=
person
,
persons
=
person
,
group_center
=
center
,
group_center
=
center
,
robot
=
robot_pose
)
robot
=
robot_pose
)
goal
=
list
(
goal
)
print
(
'
goal isolated_human before {}
'
.
format
(
goal
))
goal
[
2
]
=
np
.
arctan2
(
goal
[
1
]
-
humans
[
target
[
1
]][
1
],
goal
[
0
]
-
humans
[
target
[
1
]][
0
])
# to face the human
print
(
'
goal isolated_human after {}
'
.
format
(
goal
))
elif
target
[
0
]
==
'
group
'
:
elif
target
[
0
]
==
'
group
'
:
center
=
[
sh_groups
[
target
[
1
],
0
],
sh_groups
[
target
[
1
],
1
]]
center
=
[
sh_groups
[
target
[
1
],
0
],
sh_groups
[
target
[
1
],
1
]]
persons
=
humans
[
humans
[:,
-
2
]
==
target
[
1
],
:]
persons
=
humans
[
humans
[:,
-
2
]
==
target
[
1
],
:]
print
(
'
group : center {}, persons{}
'
.
format
(
center
,
persons
))
goal
=
ssn
.
calc_goal_pos
(
goal
=
ssn
.
calc_goal_pos
(
f_dsz
=
f_dsz
,
f_dsz
=
f_dsz
,
map
=
global_map
,
map
=
global_map
,
persons
=
persons
,
persons
=
persons
,
group_center
=
center
,
group_center
=
center
,
robot
=
robot_pose
)
robot
=
robot_pose
)
goal
=
list
(
goal
)
print
(
'
goal group {}
'
.
format
(
goal
))
else
:
else
:
continue
continue
logger
.
debug
(
"
goal : {}
"
.
format
(
goal
))
print
(
"
goal : {}
"
.
format
(
goal
))
with
lock
:
with
lock
:
shared_target
[
1
]
=
True
shared_target
[
1
]
=
True
...
...
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