15from launch
import LaunchDescription
16from launch_ros.actions
import Node
17from carma_ros2_utils.launch.get_current_namespace
import GetCurrentNamespace
18from launch.substitutions
import LaunchConfiguration
19from launch.actions
import DeclareLaunchArgument
26 Launch robot_state_publisher to read in URDF file
28 use_sim_time = LaunchConfiguration('use_sim_time')
29 declare_use_sim_time_arg = DeclareLaunchArgument(
30 name =
'use_sim_time',
31 default_value =
"False",
32 description =
"True if simulation mode is on"
37 with open(
'/opt/carma/vehicle/calibration/urdf/carma.urdf',
'r')
as in_file:
38 robot_description = in_file.read()
40 start_robot_state_publisher_cmd = Node(
41 package=
'robot_state_publisher',
42 executable=
'robot_state_publisher',
43 name=
'robot_state_publisher',
44 namespace=GetCurrentNamespace(),
46 {
'robot_description': robot_description},
47 {
"use_sim_time" : use_sim_time}
51 return LaunchDescription([
52 start_robot_state_publisher_cmd,
53 declare_use_sim_time_arg