Skip to content

Commit

Permalink
Update real and Gazebo Fortress lidarbot bringup launch files
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNoobInventor committed Aug 25, 2024
1 parent ac28493 commit 62315de
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 65 deletions.
63 changes: 22 additions & 41 deletions lidarbot_bringup/launch/lidarbot_bringup_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from launch import LaunchDescription
from launch.actions import (
DeclareLaunchArgument,
ExecuteProcess,
IncludeLaunchDescription,
TimerAction,
RegisterEventHandler,
Expand Down Expand Up @@ -85,43 +84,25 @@ def generate_launch_description():
parameters=[{"robot_description": robot_description}, controller_params_file],
)

# Start joint_state_broadcaster
load_joint_state_broadcaster = ExecuteProcess(
cmd=[
"ros2",
"control",
"load_controller",
"--set-state",
"active",
"joint_broadcaster",
],
output="screen",
)

# Start diff_drive_controller
load_diff_drive_controller = ExecuteProcess(
cmd=[
"ros2",
"control",
"load_controller",
"--set-state",
"active",
"diff_controller",
],
output="screen",
)

# Start imu_sensor_broadcaster
load_imu_sensor_broadcaster = ExecuteProcess(
cmd=[
"ros2",
"control",
"load_controller",
"--set-state",
"active",
"imu_broadcaster",
],
output="screen",
# Spawn diff_controller
start_diff_controller_cmd = Node(
package="controller_manager",
executable="spawner",
arguments=["diff_controller", "--controller-manager", "/controller_manager"],
)

# Spawn joint_state_broadcaser
start_joint_broadcaster_cmd = Node(
package="controller_manager",
executable="spawner",
arguments=["joint_broadcaster", "--controller-manager", "/controller_manager"],
)

# Spawn imu_sensor_broadcaster
start_imu_broadcaster_cmd = Node(
package="controller_manager",
executable="spawner",
arguments=["imu_broadcaster", "--controller-manager", "/controller_manager"],
)

# Delayed controller manager action
Expand All @@ -133,23 +114,23 @@ def generate_launch_description():
start_delayed_diff_drive_spawner = RegisterEventHandler(
event_handler=OnProcessStart(
target_action=start_controller_manager_cmd,
on_start=[load_diff_drive_controller],
on_start=[start_diff_controller_cmd],
)
)

# Delayed joint_broadcaster_spawner action
start_delayed_joint_broadcaster_spawner = RegisterEventHandler(
event_handler=OnProcessStart(
target_action=start_controller_manager_cmd,
on_start=[load_joint_state_broadcaster],
on_start=[start_joint_broadcaster_cmd],
)
)

# Delayed imu_broadcaster_spawner action
start_delayed_imu_broadcaster_spawner = RegisterEventHandler(
event_handler=OnProcessStart(
target_action=start_controller_manager_cmd,
on_start=[load_imu_sensor_broadcaster],
on_start=[start_imu_broadcaster_cmd],
)
)

Expand Down
36 changes: 12 additions & 24 deletions lidarbot_gz/launch/gz_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,30 +133,18 @@ def generate_launch_description():
output="screen",
)

# Start joint_state_broadcaster
load_joint_state_broadcaster = ExecuteProcess(
cmd=[
"ros2",
"control",
"load_controller",
"--set-state",
"active",
"joint_broadcaster",
],
output="screen",
# Spawn diff_controller
start_diff_controller_cmd = Node(
package="controller_manager",
executable="spawner",
arguments=["diff_controller", "--controller-manager", "/controller_manager"],
)

# Start diff_drive_controller
load_diff_drive_controller = ExecuteProcess(
cmd=[
"ros2",
"control",
"load_controller",
"--set-state",
"active",
"diff_controller",
],
output="screen",
# Spawn joint_state_broadcaser
start_joint_broadcaster_cmd = Node(
package="controller_manager",
executable="spawner",
arguments=["joint_broadcaster", "--controller-manager", "/controller_manager"],
)

# Start robot localization using an Extended Kalman Filter
Expand Down Expand Up @@ -200,8 +188,8 @@ def generate_launch_description():
ld.add_action(start_gazebo_ros_bridge_cmd)
ld.add_action(start_gazebo_ros_image_bridge_cmd)
ld.add_action(start_robot_localization_cmd)
ld.add_action(load_diff_drive_controller)
ld.add_action(load_joint_state_broadcaster)
ld.add_action(start_diff_controller_cmd)
ld.add_action(start_joint_broadcaster_cmd)
ld.add_action(start_joystick_cmd)
ld.add_action(start_twist_mux_cmd)

Expand Down

0 comments on commit 62315de

Please sign in to comment.