Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
210910794
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Summer2021
210910794
Commits
b91734bb
Commit
b91734bb
authored
5 years ago
by
Michael Jeronimo
Committed by
Carl Delsey
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add parameter to the lifecycle manager to enable autostarting the stack
parent
928e6ee9
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
nav2_lifecycle_manager/include/nav2_lifecycle_manager/lifecycle_manager.hpp
+3
-0
3 additions, 0 deletions
...ager/include/nav2_lifecycle_manager/lifecycle_manager.hpp
nav2_lifecycle_manager/src/lifecycle_manager.cpp
+8
-1
8 additions, 1 deletion
nav2_lifecycle_manager/src/lifecycle_manager.cpp
with
11 additions
and
1 deletion
nav2_lifecycle_manager/include/nav2_lifecycle_manager/lifecycle_manager.hpp
+
3
−
0
View file @
b91734bb
...
...
@@ -88,6 +88,9 @@ protected:
// The names of the nodes to be managed, in the order of desired bring-up
std
::
vector
<
std
::
string
>
node_names_
;
// Whether to automatically start up the system
bool
autostart_
;
};
}
// namespace nav2_lifecycle_manager
...
...
This diff is collapsed.
Click to expand it.
nav2_lifecycle_manager/src/lifecycle_manager.cpp
+
8
−
1
View file @
b91734bb
...
...
@@ -39,9 +39,12 @@ LifecycleManager::LifecycleManager()
std
::
vector
<
std
::
string
>
default_node_names
{
"map_server"
,
"amcl"
,
"world_model"
,
"dwb_controller"
,
"navfn_planner"
,
"bt_navigator"
};
//
However, it
is parameterized, allowing this module to be used with a different set of nodes
//
The list of names
is parameterized, allowing this module to be used with a different set of nodes
declare_parameter
(
"node_names"
,
rclcpp
::
ParameterValue
(
default_node_names
));
declare_parameter
(
"autostart"
,
rclcpp
::
ParameterValue
(
false
));
get_parameter
(
"node_names"
,
node_names_
);
get_parameter
(
"autostart"
,
autostart_
);
startup_srv_
=
create_service
<
std_srvs
::
srv
::
Empty
>
(
"lifecycle_manager/startup"
,
std
::
bind
(
&
LifecycleManager
::
startupCallback
,
this
,
_1
,
_2
,
_3
));
...
...
@@ -56,6 +59,10 @@ LifecycleManager::LifecycleManager()
std
::
bind
(
&
LifecycleManager
::
resumeCallback
,
this
,
_1
,
_2
,
_3
));
service_client_node_
=
std
::
make_shared
<
rclcpp
::
Node
>
(
"lifecycle_manager_service_client"
);
if
(
autostart_
)
{
startup
();
}
}
LifecycleManager
::~
LifecycleManager
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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