diff --git a/nav2_minimal_tb3_sim/launch/spawn_tb3_gps.launch.py b/nav2_minimal_tb3_sim/launch/spawn_tb3_gps.launch.py index 3e4352d..3b90c48 100644 --- a/nav2_minimal_tb3_sim/launch/spawn_tb3_gps.launch.py +++ b/nav2_minimal_tb3_sim/launch/spawn_tb3_gps.launch.py @@ -30,92 +30,92 @@ def generate_launch_description(): - bringup_dir = get_package_share_directory("nav2_minimal_tb3_sim") + bringup_dir = get_package_share_directory('nav2_minimal_tb3_sim') - namespace = LaunchConfiguration("namespace") - robot_name = LaunchConfiguration("robot_name") - robot_sdf = LaunchConfiguration("robot_sdf") + namespace = LaunchConfiguration('namespace') + robot_name = LaunchConfiguration('robot_name') + robot_sdf = LaunchConfiguration('robot_sdf') pose = { - "x": LaunchConfiguration("x_pose", default="-2.00"), - "y": LaunchConfiguration("y_pose", default="-0.50"), - "z": LaunchConfiguration("z_pose", default="0.01"), - "R": LaunchConfiguration("roll", default="0.00"), - "P": LaunchConfiguration("pitch", default="0.00"), - "Y": LaunchConfiguration("yaw", default="0.00"), + 'x': LaunchConfiguration('x_pose', default='-2.00'), + 'y': LaunchConfiguration('y_pose', default='-0.50'), + 'z': LaunchConfiguration('z_pose', default='0.01'), + 'R': LaunchConfiguration('roll', default='0.00'), + 'P': LaunchConfiguration('pitch', default='0.00'), + 'Y': LaunchConfiguration('yaw', default='0.00'), } # Declare the launch arguments declare_namespace_cmd = DeclareLaunchArgument( - "namespace", default_value="", description="Top-level namespace" + 'namespace', default_value='', description='Top-level namespace' ) declare_robot_name_cmd = DeclareLaunchArgument( - "robot_name", - default_value="turtlebot3_waffle_gps", - description="name of the robot", + 'robot_name', + default_value='turtlebot3_waffle_gps', + description='name of the robot', ) declare_robot_sdf_cmd = DeclareLaunchArgument( - "robot_sdf", - default_value=os.path.join(bringup_dir, "urdf", "gz_waffle_gps.sdf.xacro"), - description="Full path to robot sdf file to spawn the robot in gazebo", + 'robot_sdf', + default_value=os.path.join(bringup_dir, 'urdf', 'gz_waffle_gps.sdf.xacro'), + description='Full path to robot sdf file to spawn the robot in gazebo', ) bridge = Node( - package="ros_gz_bridge", - executable="parameter_bridge", + package='ros_gz_bridge', + executable='parameter_bridge', namespace=namespace, parameters=[ { - "config_file": os.path.join( - bringup_dir, "configs", "turtlebot3_waffle_gps_bridge.yaml" + 'config_file': os.path.join( + bringup_dir, 'configs', 'turtlebot3_waffle_gps_bridge.yaml' ), - "expand_gz_topic_names": True, - "use_sim_time": True, + 'expand_gz_topic_names': True, + 'use_sim_time': True, } ], - output="screen", + output='screen', ) spawn_model = Node( - package="ros_gz_sim", - executable="create", - output="screen", + package='ros_gz_sim', + executable='create', + output='screen', namespace=namespace, arguments=[ - "-name", + '-name', robot_name, - "-string", + '-string', Command( [ - FindExecutable(name="xacro"), - " ", - "namespace:=", - LaunchConfiguration("namespace"), - " ", + FindExecutable(name='xacro'), + ' ', + 'namespace:=', + LaunchConfiguration('namespace'), + ' ', robot_sdf, ] ), - "-x", - pose["x"], - "-y", - pose["y"], - "-z", - pose["z"], - "-R", - pose["R"], - "-P", - pose["P"], - "-Y", - pose["Y"], + '-x', + pose['x'], + '-y', + pose['y'], + '-z', + pose['z'], + '-R', + pose['R'], + '-P', + pose['P'], + '-Y', + pose['Y'], ], ) set_env_vars_resources = AppendEnvironmentVariable( - "GZ_SIM_RESOURCE_PATH", os.path.join(bringup_dir, "models") + 'GZ_SIM_RESOURCE_PATH', os.path.join(bringup_dir, 'models') ) set_env_vars_resources2 = AppendEnvironmentVariable( - "GZ_SIM_RESOURCE_PATH", str(Path(os.path.join(bringup_dir)).parent.resolve()) + 'GZ_SIM_RESOURCE_PATH', str(Path(os.path.join(bringup_dir)).parent.resolve()) ) # Create the launch description and populate