Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
REX-D
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
perception
REX-D
Commits
43d82db9
Commit
43d82db9
authored
10 years ago
by
David Martínez
Browse files
Options
Downloads
Patches
Plain Diff
Fixed combination of rule alternatives with dangerous actions.
parent
d186eb64
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/lfd/failure_analyzer_utils.cpp
+2
-0
2 additions, 0 deletions
src/lfd/failure_analyzer_utils.cpp
src/rexd/high_level_planner.cpp
+13
-0
13 additions, 0 deletions
src/rexd/high_level_planner.cpp
with
15 additions
and
0 deletions
src/lfd/failure_analyzer_utils.cpp
+
2
−
0
View file @
43d82db9
...
...
@@ -26,6 +26,8 @@ std::vector<RuleSet> FailureAnalyzerUtils::get_rules_that_overcome_planning_fail
RuleSet
new_rules
=
create_new_rule_candidates_with_planning_failure
(
*
rule_it
,
symbolic_planning_failure
,
transitions
);
CINFO
(
"excuses"
)
<<
"Checking "
<<
new_rules
.
size
()
<<
" new rules for action "
<<
(
*
rule_it
)
->
name
<<
" with score ( "
<<
orig_score
<<
" ): "
<<
NOENDL
;
if
(
DEBUG
>
1
)
CINFO
(
"excuses"
)
<<
"Original rule was "
<<
**
rule_it
;
for
(
RuleList
::
iterator
new_rule_it
=
new_rules
.
begin
()
;
new_rule_it
!=
new_rules
.
end
();
++
new_rule_it
)
{
RuleSet
new_generated_rules
(
rules_copy
);
new_generated_rules
.
push_back
(
*
new_rule_it
);
...
...
This diff is collapsed.
Click to expand it.
src/rexd/high_level_planner.cpp
+
13
−
0
View file @
43d82db9
...
...
@@ -197,6 +197,7 @@ bool HighLevelPlanner::replan_without_dangerous_actions(const Scenario& scenario
check_teacher_demonstration_requested
(
new_planning_res
);
if
(
new_planning_res
)
{
LOG
(
INFO
)
<<
START_COLOR_CYAN
<<
"Replanning without dangerous rules was successful"
<<
END_COLOR
;
*
logging_file_ptr
<<
"Replan without dangerous rule: "
<<
*
new_planning_res
<<
std
::
endl
;
planning_res
=
new_planning_res
;
return
true
;
// found new plan, not dangerous any more
// TODO Make a recursive loop until no dangerous action is planned
...
...
@@ -262,6 +263,18 @@ SymbolOptional HighLevelPlanner::planning_with_alternative_rules(Scenario& scena
}
if
(
!
extra_rulesets
.
empty
())
CINFO
(
"excuses"
);
// don't select dangerous actions with rule alternatives
if
(
planning_res
&&
scenario
.
config_reader
.
get_variable
<
bool
>
(
"confirm_dangerous_actions"
)
&&
scenario
.
get_rules
().
is_dangerous
(
*
planning_res
,
scenario
.
get_state
())
)
{
float
prob_success
=
planner
->
get_expected_action_success_probability
(
scenario
,
*
planning_res
,
true
);
if
(
prob_success
<
1.0
)
{
(
*
logging_file_ptr
)
<<
"Ignoring dangerous alternative due to possible dead end: "
<<
*
planning_res
<<
std
::
endl
;
CINFO
(
"excuses"
)
<<
"Ignoring dangerous alternative due to possible dead end: "
<<
*
planning_res
;
planning_res
=
SymbolOptional
();
}
}
// if found good rules -> save them
if
(
planning_res
)
{
...
...
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