Skip to content

Commit

Permalink
removed action group
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Delicat <[email protected]>
  • Loading branch information
delihus committed Nov 13, 2023
1 parent 2213a81 commit 2b479a6
Showing 1 changed file with 16 additions and 28 deletions.
44 changes: 16 additions & 28 deletions rosbot_controller/launch/controller.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.

from launch import LaunchDescription
from launch.actions import RegisterEventHandler, DeclareLaunchArgument, GroupAction
from launch.actions import RegisterEventHandler, DeclareLaunchArgument
from launch.conditions import UnlessCondition
from launch.event_handlers import OnProcessExit
from launch.substitutions import (
Expand Down Expand Up @@ -83,12 +83,12 @@ def generate_launch_description():
" else 'controller_manager'",
]
)

controller_manager_name = LaunchConfiguration("controller_manager_name")
namespace_for_controller_name = PythonExpression(
["''", " if '", namespace, "' == '' ", "else ", "'", namespace, "/'"]
)

namespace_for_controller_name
declare_controller_manager_name_arg = DeclareLaunchArgument(
"controller_manager_name",
default_value=[namespace_for_controller_name, controller_manager_type_name],
Expand Down Expand Up @@ -145,6 +145,7 @@ def generate_launch_description():
package="robot_state_publisher",
executable="robot_state_publisher",
parameters=[robot_description],
namespace=namespace,
)

joint_state_broadcaster_spawner = Node(
Expand Down Expand Up @@ -206,32 +207,19 @@ def generate_launch_description():
)
)

args_declarations_actions = [
declare_namespace_arg,
declare_mecanum_arg,
declare_use_sim_arg,
declare_use_gpu_arg,
declare_simulation_engine_arg,
declare_controller_manager_name_arg,
]

nodes_actions = [
control_node,
robot_state_pub_node,
joint_state_broadcaster_spawner,
delay_robot_controller_spawner_after_joint_state_broadcaster_spawner,
delay_imu_broadcaster_spawner_after_robot_controller_spawner,
]

return LaunchDescription(
args_declarations_actions
+ [
GroupAction(
actions=[
# PushRosNamespace(namespace),
SetParameter(name="use_sim_time", value=use_sim),
]
+ nodes_actions
)
[
declare_namespace_arg,
declare_mecanum_arg,
declare_use_sim_arg,
declare_use_gpu_arg,
declare_simulation_engine_arg,
declare_controller_manager_name_arg,
SetParameter("use_sim_time"),
control_node,
robot_state_pub_node,
joint_state_broadcaster_spawner,
delay_robot_controller_spawner_after_joint_state_broadcaster_spawner,
delay_imu_broadcaster_spawner_after_robot_controller_spawner,
]
)

0 comments on commit 2b479a6

Please sign in to comment.