Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lrs_util_del
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
lrs
lrs_util_del
Commits
1f984a2e
Commit
1f984a2e
authored
7 years ago
by
Tommy Persson
Browse files
Options
Downloads
Patches
Plain Diff
start_execution method added
parent
e250e6c2
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/missionobject.cc
+54
-44
54 additions, 44 deletions
src/missionobject.cc
src/missionobject.h
+1
-0
1 addition, 0 deletions
src/missionobject.h
with
55 additions
and
44 deletions
src/missionobject.cc
+
54
−
44
View file @
1f984a2e
...
@@ -34,54 +34,12 @@ void MissionObject::set_title(std::string str) {
...
@@ -34,54 +34,12 @@ void MissionObject::set_title(std::string str) {
title
=
str
;
title
=
str
;
}
}
bool
MissionObject
::
delegation
(
bool
display_flag
,
bool
exectree_flag
)
{
bool
MissionObject
::
start_execution
(
bool
display_flag
)
{
//
// Display tree
//
std
::
string
ns
=
ros
::
names
::
clean
(
ros
::
this_node
::
getNamespace
());
std
::
string
ns
=
ros
::
names
::
clean
(
ros
::
this_node
::
getNamespace
());
display_tree
(
ns
,
title
+
" - before delegation"
,
root_id
);
display_tree
(
ns
,
title
+
" - execution"
,
root_id
);
std
::
string
fail_reason
;
std
::
string
cid
=
delegation_process_until_proposal
();
if
(
cid
!=
""
)
{
ROS_INFO
(
"WE HAVE A PROPOSAL"
);
}
else
{
ROS_ERROR
(
"missionobject::could not get a proposal"
);
return
false
;
}
if
(
!
delegation_process_approved_part
(
cid
,
fail_reason
))
{
ROS_ERROR
(
"Failed in approved part: %s"
,
fail_reason
.
c_str
());
return
false
;
}
display_tree
(
ns
,
title
+
" - after delegation"
,
root_id
);
//
// Save the dot file
//
#if 0
std::string dotstr = get_tst_string(ns, rootid,
lrs_srvs_tst::TSTGetTreeString::Request::FORMAT_DOT);
std::ofstream dotout("/tmp/terra_house_scan_example.dot");
dotout << dotstr << std::endl;
#endif
if
(
!
exectree_flag
)
{
return
true
;
}
//
// Start execution
//
ROS_INFO
(
"DELEGATION FINISHED - STARTING EXECUTION PHASE"
);
if
(
!
distribute_tree
(
ns
,
root_id
))
{
if
(
!
distribute_tree
(
ns
,
root_id
))
{
ROS_ERROR
(
"Failed to distribute tree"
);
ROS_ERROR
(
"Failed to distribute tree"
);
return
false
;
return
false
;
...
@@ -146,6 +104,58 @@ bool MissionObject::delegation(bool display_flag, bool exectree_flag) {
...
@@ -146,6 +104,58 @@ bool MissionObject::delegation(bool display_flag, bool exectree_flag) {
return
true
;
return
true
;
}
}
bool
MissionObject
::
delegation
(
bool
display_flag
,
bool
exectree_flag
)
{
//
// Display tree
//
std
::
string
ns
=
ros
::
names
::
clean
(
ros
::
this_node
::
getNamespace
());
display_tree
(
ns
,
title
+
" - before delegation"
,
root_id
);
std
::
string
fail_reason
;
std
::
string
cid
=
delegation_process_until_proposal
();
if
(
cid
!=
""
)
{
ROS_INFO
(
"WE HAVE A PROPOSAL"
);
}
else
{
ROS_ERROR
(
"missionobject::could not get a proposal"
);
return
false
;
}
if
(
!
delegation_process_approved_part
(
cid
,
fail_reason
))
{
ROS_ERROR
(
"Failed in approved part: %s"
,
fail_reason
.
c_str
());
return
false
;
}
display_tree
(
ns
,
title
+
" - after delegation"
,
root_id
);
//
// Save the dot file
//
#if 0
std::string dotstr = get_tst_string(ns, rootid,
lrs_srvs_tst::TSTGetTreeString::Request::FORMAT_DOT);
std::ofstream dotout("/tmp/terra_house_scan_example.dot");
dotout << dotstr << std::endl;
#endif
if
(
!
exectree_flag
)
{
return
true
;
}
//
// Start execution
//
ROS_INFO
(
"DELEGATION FINISHED - STARTING EXECUTION PHASE"
);
return
start_execution
(
false
);
}
std
::
string
MissionObject
::
delegation_process_until_proposal
()
{
std
::
string
MissionObject
::
delegation_process_until_proposal
()
{
...
...
This diff is collapsed.
Click to expand it.
src/missionobject.h
+
1
−
0
View file @
1f984a2e
...
@@ -22,6 +22,7 @@ public:
...
@@ -22,6 +22,7 @@ public:
~
MissionObject
();
~
MissionObject
();
bool
delegation
(
bool
display_flag
,
bool
exectree_flag
);
bool
delegation
(
bool
display_flag
,
bool
exectree_flag
);
bool
start_execution
(
bool
display_flag
);
std
::
string
delegation_process_until_proposal
();
std
::
string
delegation_process_until_proposal
();
bool
delegation_process_approved_part
(
std
::
string
cid
,
std
::
string
&
fail_reason
);
bool
delegation_process_approved_part
(
std
::
string
cid
,
std
::
string
&
fail_reason
);
...
...
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