Skip to content

Commit

Permalink
Drop version distinction from the launch file
Browse files Browse the repository at this point in the history
Also use the topic-based `controller_manager` configuration.
  • Loading branch information
stefanscherzinger committed Oct 18, 2024
1 parent 8e78b61 commit 4d99864
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions cartesian_controller_simulation/launch/simulation.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,6 @@
from launch_ros.actions import Node
from launch_ros.substitutions import FindPackageShare

import os

distro = os.environ["ROS_DISTRO"]
if distro in ["galactic", "humble", "iron"]:
spawner = "spawner"
else: # foxy
spawner = "spawner.py"


def generate_launch_description():
# Declare arguments
Expand Down Expand Up @@ -98,10 +90,11 @@ def generate_launch_description():
control_node = Node(
package="controller_manager",
executable="ros2_control_node",
parameters=[robot_description, robot_controllers],
# prefix="screen -d -m gdb -command=/home/scherzin/.ros/my_debug_log --ex run --args", # noqa: E501
parameters=[robot_controllers],
# prefix="screen -d -m gdb -command=/home/stefan/.gdb_debug_config --ex run --args", # noqa E501
output="both",
remappings=[
("~/robot_description", "/robot_description"),
("motion_control_handle/target_frame", "target_frame"),
("cartesian_motion_controller/target_frame", "target_frame"),
("cartesian_compliance_controller/target_frame", "target_frame"),
Expand All @@ -116,7 +109,7 @@ def generate_launch_description():
def controller_spawner(name, *args):
return Node(
package="controller_manager",
executable=spawner,
executable="spawner",
output="screen",
arguments=[name] + [a for a in args],
)
Expand All @@ -137,7 +130,7 @@ def controller_spawner(name, *args):
"invalid_cartesian_compliance_controller",
"invalid_cartesian_force_controller",
]
state = "--inactive" if distro in ["humble", "iron"] else "--stopped"
state = "--inactive"
inactive_spawners = [
controller_spawner(controller, state) for controller in inactive_list
]
Expand Down

0 comments on commit 4d99864

Please sign in to comment.