ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Hello @Edvard,
Try out this code,
from launch import LaunchDescription
from launch_ros.actions import Node
from launch.substitutions import LaunchConfiguration
from launch.actions import DeclareLaunchArgument
from launch.substitutions import TextSubstitution
def generate_launch_description():
enable_launch_arg = DeclareLaunchArgument(
"enable", default_value=TextSubstitution(text="true")
)
node_1 = Node(
package='rosservice',
executable='rosservice',
name='enable_limiter',
arguments=["call","--wait","-b","/minicar/control/enable_limiter",],
parameters=[{
"enable": LaunchConfiguration('enable'),
}]
)
return LaunchDescription([
enable_launch_arg,
node_1,
])
ros2 launch <path_to_launch_file> enable:=false
2 | No.2 Revision |
Hello @Edvard,
Try out this code,
from launch import LaunchDescription
from launch_ros.actions import Node
from launch.substitutions import LaunchConfiguration
from launch.actions import DeclareLaunchArgument
from launch.substitutions import TextSubstitution
def generate_launch_description():
enable_launch_arg = DeclareLaunchArgument(
"enable", default_value=TextSubstitution(text="true")
)
node_1 = Node(
package='rosservice',
executable='rosservice',
name='enable_limiter',
arguments=["call","--wait","-b","/minicar/control/enable_limiter",],
parameters=[{
"enable": LaunchConfiguration('enable'),
}]
)
return LaunchDescription([
enable_launch_arg,
node_1,
])
Execution of code:
ros2 launch <path_to_launch_file> enable:=false