-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from launch_ros.actions import LifecycleNode | ||
from launch_ros.events.lifecycle import ChangeState | ||
from launch.events.matchers import matches_action | ||
from launch.actions import DeclareLaunchArgument, EmitEvent | ||
from launch.substitutions import LaunchConfiguration | ||
from launch import LaunchDescription | ||
from lifecycle_msgs.msg import Transition | ||
|
||
|
||
def generate_launch_description(): | ||
use_sim_arg = DeclareLaunchArgument("use_sim", default_value="False", description="Use sim time.") | ||
human_detector = LifecycleNode( | ||
package="human_detector", | ||
executable="human_detector", | ||
name="human_detector", | ||
output="screen", | ||
namespace="", | ||
parameters=[ | ||
{"use_sim_time": LaunchConfiguration("use_sim")}, | ||
], | ||
) | ||
|
||
move_human_detector_to_configure_state_event = EmitEvent( | ||
event=ChangeState( | ||
lifecycle_node_matcher=matches_action(human_detector), | ||
transition_id=Transition.TRANSITION_CONFIGURE, | ||
) | ||
) | ||
|
||
return LaunchDescription( | ||
[ | ||
use_sim_arg, | ||
human_detector, | ||
move_human_detector_to_configure_state_event, | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters