From 62231a763aae511c23b5c8833ff0045045b13821 Mon Sep 17 00:00:00 2001 From: stevedan Date: Tue, 17 Sep 2024 15:28:17 +0200 Subject: [PATCH 1/6] include gps launch Signed-off-by: stevedan --- .../configs/turtlebot3_waffle_gps_bridge.yaml | 50 ++ .../launch/spawn_tb3_gps.launch.py | 108 ++++ .../urdf/gz_waffle_gps.sdf.xacro | 517 ++++++++++++++++++ .../urdf/turtlebot3_waffle_gps.urdf | 300 ++++++++++ nav2_minimal_tb3_sim/worlds/tb3_gps.sdf.xacro | 102 ++++ 5 files changed, 1077 insertions(+) create mode 100644 nav2_minimal_tb3_sim/configs/turtlebot3_waffle_gps_bridge.yaml create mode 100644 nav2_minimal_tb3_sim/launch/spawn_tb3_gps.launch.py create mode 100644 nav2_minimal_tb3_sim/urdf/gz_waffle_gps.sdf.xacro create mode 100644 nav2_minimal_tb3_sim/urdf/turtlebot3_waffle_gps.urdf create mode 100644 nav2_minimal_tb3_sim/worlds/tb3_gps.sdf.xacro diff --git a/nav2_minimal_tb3_sim/configs/turtlebot3_waffle_gps_bridge.yaml b/nav2_minimal_tb3_sim/configs/turtlebot3_waffle_gps_bridge.yaml new file mode 100644 index 0000000..8d32123 --- /dev/null +++ b/nav2_minimal_tb3_sim/configs/turtlebot3_waffle_gps_bridge.yaml @@ -0,0 +1,50 @@ +# replace clock_bridge +- topic_name: "/clock" + ros_type_name: "rosgraph_msgs/msg/Clock" + gz_type_name: "gz.msgs.Clock" + direction: GZ_TO_ROS + +# no equivalent in TB3 - add +- topic_name: "joint_states" + ros_type_name: "sensor_msgs/msg/JointState" + gz_type_name: "gz.msgs.Model" + direction: GZ_TO_ROS + +# replace odom_bridge - check gz topic name +# gz topic published by DiffDrive plugin +- topic_name: "odom" + ros_type_name: "nav_msgs/msg/Odometry" + gz_type_name: "gz.msgs.Odometry" + direction: GZ_TO_ROS + +# replace odom_tf_bridge - check gz and ros topic names +# gz topic published by DiffDrive plugin +# prefix ros2 topic with gz +- topic_name: "tf" + ros_type_name: "tf2_msgs/msg/TFMessage" + gz_type_name: "gz.msgs.Pose_V" + direction: GZ_TO_ROS + +# replace imu_bridge - check gz topic name +- topic_name: "imu" + ros_type_name: "sensor_msgs/msg/Imu" + gz_type_name: "gz.msgs.IMU" + direction: GZ_TO_ROS + +# replace lidar_bridge +- topic_name: "scan" + ros_type_name: "sensor_msgs/msg/LaserScan" + gz_type_name: "gz.msgs.LaserScan" + direction: GZ_TO_ROS + +# replace cmd_vel_bridge +- topic_name: "cmd_vel" + ros_type_name: "geometry_msgs/msg/Twist" + gz_type_name: "gz.msgs.Twist" + direction: ROS_TO_GZ + +# replae navsat_bridge - check gz topic name +- topic_name: "navsat" + ros_type_name: "sensor_msgs/msg/NavSatFix" + gz_type_name: "gz.msgs.GPS" + direction: GZ_TO_ROS diff --git a/nav2_minimal_tb3_sim/launch/spawn_tb3_gps.launch.py b/nav2_minimal_tb3_sim/launch/spawn_tb3_gps.launch.py new file mode 100644 index 0000000..ab80268 --- /dev/null +++ b/nav2_minimal_tb3_sim/launch/spawn_tb3_gps.launch.py @@ -0,0 +1,108 @@ +# Copyright (C) 2023 Open Source Robotics Foundation +# Copyright (C) 2024 Open Navigation LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +from pathlib import Path + + +from ament_index_python.packages import get_package_share_directory + +from launch import LaunchDescription +from launch.actions import AppendEnvironmentVariable +from launch.actions import DeclareLaunchArgument +from launch.substitutions import LaunchConfiguration +from launch.substitutions.command import Command +from launch.substitutions.find_executable import FindExecutable + +from launch_ros.actions import Node + + +def generate_launch_description(): + bringup_dir = get_package_share_directory('nav2_minimal_tb3_sim') + + 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')} + + # Declare the launch arguments + declare_namespace_cmd = DeclareLaunchArgument( + 'namespace', + default_value='', + description='Top-level namespace') + + declare_robot_name_cmd = DeclareLaunchArgument( + 'robot_name', + default_value='turtlebot3_waffle', + 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') + + bridge = Node( + package='ros_gz_bridge', + executable='parameter_bridge', + namespace=namespace, + parameters=[ + { + 'config_file': os.path.join( + bringup_dir, 'configs', 'turtlebot3_waffle_gps_bridge.yaml' + ), + 'expand_gz_topic_names': True, + 'use_sim_time': True, + } + ], + output='screen', + ) + + spawn_model = Node( + package='ros_gz_sim', + executable='create', + output='screen', + namespace=namespace, + arguments=[ + '-name', robot_name, + '-string', Command([ + 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']] + ) + + set_env_vars_resources = AppendEnvironmentVariable( + '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())) + + # Create the launch description and populate + ld = LaunchDescription() + ld.add_action(declare_namespace_cmd) + ld.add_action(declare_robot_name_cmd) + ld.add_action(declare_robot_sdf_cmd) + + ld.add_action(set_env_vars_resources) + ld.add_action(set_env_vars_resources2) + + ld.add_action(bridge) + ld.add_action(spawn_model) + return ld diff --git a/nav2_minimal_tb3_sim/urdf/gz_waffle_gps.sdf.xacro b/nav2_minimal_tb3_sim/urdf/gz_waffle_gps.sdf.xacro new file mode 100644 index 0000000..3f1ca75 --- /dev/null +++ b/nav2_minimal_tb3_sim/urdf/gz_waffle_gps.sdf.xacro @@ -0,0 +1,517 @@ + + + + + + 0.0 0.0 0.0 0.0 0.0 0.0 + + + + + + + -0.064 0 0.048 0 0 0 + + 0.001 + 0.000 + 0.000 + 0.001 + 0.000 + 0.001 + + 1.0 + + + + -0.064 0 0.048 0 0 0 + + + 0.265 0.265 0.089 + + + + + + -0.064 0 0 0 0 0 + + + package://nav2_minimal_tb3_sim/models/turtlebot3_model/meshes/waffle_base.dae + 0.001 0.001 0.001 + + + + 1 1 1 + + + + + + + true + 200 + $(arg namespace)/imu + imu_link + + + + + 0.0 + 2e-4 + + + + + 0.0 + 2e-4 + + + + + 0.0 + 2e-4 + + + + + + + 0.0 + 1.7e-2 + + + + + 0.0 + 1.7e-2 + + + + + 0.0 + 1.7e-2 + + + + + + + + + + true + 1 + $(arg namespace)/navsat + 0 0 0 0 0 0 + + + + + 0.0 + 0.1 + + + + + 0.0 + 0.0 + + + + + + + + + + -0.064 0 0.121 0 0 0 + + 0.001 + 0.000 + 0.000 + 0.001 + 0.000 + 0.001 + + 0.125 + + + + -0.052 0 0.111 0 0 0 + + + 0.0508 + 0.055 + + + + + + -0.064 0 0.121 0 0 0 + + + package://nav2_minimal_tb3_sim/models/turtlebot3_model/meshes/lds.dae + 0.001 0.001 0.001 + + + + 1 1 1 + + + + + true + true + -0.064 0 0.15 0 0 0 + 5 + $(arg namespace)/scan + base_scan + + + + 360 + 1.000000 + 0.000000 + 6.280000 + + + + 0.00001 + 20.0 + 0.015000 + + + gaussian + 0.0 + 0.01 + + + + + + + + + 0.0 0.144 0.023 -1.57 0 0 + + 0.001 + 0.000 + 0.000 + 0.001 + 0.000 + 0.001 + + 0.1 + + + + 0.0 0.144 0.023 -1.57 0 0 + + + 0.033 + 0.018 + + + + + + 1 + 1 + 0.035 + 0 + 0 0 1 + + + + + 0 + 0.2 + 1e+5 + 1 + 0.01 + 0.001 + + + + + + + 0.0 0.144 0.023 0 0 0 + + + package://nav2_minimal_tb3_sim/models/turtlebot3_model/meshes/tire.dae + 0.001 0.001 0.001 + + + + 1 1 1 + + + + + + + + 0.0 -0.144 0.023 -1.57 0 0 + + 0.001 + 0.000 + 0.000 + 0.001 + 0.000 + 0.001 + + 0.1 + + + + 0.0 -0.144 0.023 -1.57 0 0 + + + 0.033 + 0.018 + + + + + + 1 + 1 + 0.035 + 0 + 0 0 1 + + + + + 0 + 0.2 + 1e+5 + 1 + 0.01 + 0.001 + + + + + + + 0.0 -0.144 0.023 0 0 0 + + + package://nav2_minimal_tb3_sim/models/turtlebot3_model/meshes/tire.dae + 0.001 0.001 0.001 + + + + 1 1 1 + + + + + + -0.177 -0.064 -0.004 0 0 0 + + 0.001 + + 0.00001 + 0.000 + 0.000 + 0.00001 + 0.000 + 0.00001 + + + + + + 0.005000 + + + + + + 0 + 0.2 + 1e+5 + 1 + 0.01 + 0.001 + + + + + + + + -0.177 0.064 -0.004 0 0 0 + + 0.001 + + 0.00001 + 0.000 + 0.000 + 0.00001 + 0.000 + 0.00001 + + + + + + 0.005000 + + + + + + 0 + 0.2 + 1e+5 + 1 + 0.01 + 0.001 + + + + + + + + + 0.069 -0.047 0.107 0 0 0 + + 0.001 + 0.000 + 0.000 + 0.001 + 0.000 + 0.001 + + 0.035 + + + 0 0.047 -0.005 0 0 0 + + + 0.008 0.130 0.022 + + + + + 0.069 -0.047 0.107 0 0 0 + + + 1 + 5 + 0.064 -0.047 0.107 0 0 0 + camera_depth_frame + + 1.047 + + 320 + 240 + + + + + + 19.4 + + + + + 0.001 + 5.0 + + + + + + + + base_footprint + base_link + 0.0 0.0 0.010 0 0 0 + + + + base_link + wheel_left_link + 0.0 0.144 0.023 -1.57 0 0 + + 0 0 1 + + + + + base_link + wheel_right_link + 0.0 -0.144 0.023 -1.57 0 0 + + 0 0 1 + + + + + base_link + caster_back_right_link + + + + base_link + caster_back_left_link + + + + base_link + base_scan + -0.064 0 0.121 0 0 0 + + 0 0 1 + + + + + base_link + camera_link + 0.064 -0.065 0.094 0 0 0 + + 0 0 1 + + + + + + wheel_left_joint + wheel_right_joint + 0.287 + 0.033 + 1 + -1 + 2 + -2 + 0.46 + -0.46 + 1.9 + -1.9 + $(arg namespace)/cmd_vel + $(arg namespace)/odom + $(arg namespace)/tf + odom + base_footprint + 30 + + + + wheel_left_joint + wheel_right_joint + $(arg namespace)/joint_states + 30 + + + + diff --git a/nav2_minimal_tb3_sim/urdf/turtlebot3_waffle_gps.urdf b/nav2_minimal_tb3_sim/urdf/turtlebot3_waffle_gps.urdf new file mode 100644 index 0000000..011e3f5 --- /dev/null +++ b/nav2_minimal_tb3_sim/urdf/turtlebot3_waffle_gps.urdf @@ -0,0 +1,300 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nav2_minimal_tb3_sim/worlds/tb3_gps.sdf.xacro b/nav2_minimal_tb3_sim/worlds/tb3_gps.sdf.xacro new file mode 100644 index 0000000..ed6c368 --- /dev/null +++ b/nav2_minimal_tb3_sim/worlds/tb3_gps.sdf.xacro @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + ogre2 + + + + + + + EARTH_WGS84 + ENU + 55.944831 + -3.186998 + 0 + 0 + + + + 0 + 0 0 10 0 0 0 + 0.8 0.8 0.8 1 + 0.8 0.8 0.8 1 + + 1000 + 0.9 + 0.01 + 0.001 + + -0.5 0.1 -0.9 + + + 1 + + + + + 0 0 1 + 100 100 + + + 10 + + + + + 0 0 1 + 100 100 + + + + 0.8 0.8 0.8 1 + 0.8 0.8 0.8 1 + 0.8 0.8 0.8 1 + + + + + + + 0 + + + + 0.003 + 1 + + + + + + From a7b69653b0061fd50813ef90d140a059961fbed4 Mon Sep 17 00:00:00 2001 From: stevedan Date: Wed, 18 Sep 2024 08:27:08 +0200 Subject: [PATCH 2/6] working version Signed-off-by: stevedan --- .../configs/turtlebot3_waffle_gps_bridge.yaml | 6 +- .../launch/spawn_tb3_gps.launch.py | 102 +++++++++++------- .../urdf/gz_waffle_gps.sdf.xacro | 22 +++- .../urdf/turtlebot3_waffle_gps.urdf | 8 +- 4 files changed, 87 insertions(+), 51 deletions(-) diff --git a/nav2_minimal_tb3_sim/configs/turtlebot3_waffle_gps_bridge.yaml b/nav2_minimal_tb3_sim/configs/turtlebot3_waffle_gps_bridge.yaml index 8d32123..dc59b5c 100644 --- a/nav2_minimal_tb3_sim/configs/turtlebot3_waffle_gps_bridge.yaml +++ b/nav2_minimal_tb3_sim/configs/turtlebot3_waffle_gps_bridge.yaml @@ -26,7 +26,7 @@ direction: GZ_TO_ROS # replace imu_bridge - check gz topic name -- topic_name: "imu" +- topic_name: "imu/data" ros_type_name: "sensor_msgs/msg/Imu" gz_type_name: "gz.msgs.IMU" direction: GZ_TO_ROS @@ -44,7 +44,7 @@ direction: ROS_TO_GZ # replae navsat_bridge - check gz topic name -- topic_name: "navsat" +- topic_name: "gps/fix" ros_type_name: "sensor_msgs/msg/NavSatFix" - gz_type_name: "gz.msgs.GPS" + gz_type_name: "gz.msgs.NavSat" direction: GZ_TO_ROS 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 ab80268..3e4352d 100644 --- a/nav2_minimal_tb3_sim/launch/spawn_tb3_gps.launch.py +++ b/nav2_minimal_tb3_sim/launch/spawn_tb3_gps.launch.py @@ -30,69 +30,93 @@ def generate_launch_description(): - bringup_dir = get_package_share_directory('nav2_minimal_tb3_sim') - - 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')} + bringup_dir = get_package_share_directory("nav2_minimal_tb3_sim") + + 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"), + } # 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', - 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', robot_name, - '-string', Command([ - 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']] + "-name", + robot_name, + "-string", + Command( + [ + 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"], + ], ) 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 ld = LaunchDescription() diff --git a/nav2_minimal_tb3_sim/urdf/gz_waffle_gps.sdf.xacro b/nav2_minimal_tb3_sim/urdf/gz_waffle_gps.sdf.xacro index 3f1ca75..a04d530 100644 --- a/nav2_minimal_tb3_sim/urdf/gz_waffle_gps.sdf.xacro +++ b/nav2_minimal_tb3_sim/urdf/gz_waffle_gps.sdf.xacro @@ -49,7 +49,7 @@ true 200 - $(arg namespace)/imu + $(arg namespace)/imu/data imu_link @@ -96,18 +96,18 @@ - + true 1 - $(arg namespace)/navsat - 0 0 0 0 0 0 + $(arg namespace)/gps/fix + gps_link 0.0 - 0.1 + 0.0 @@ -480,6 +480,18 @@ + + base_link + imu_link + 0.0 0 0.068 0 0 0 + + + + base_link + gps_link + -0.05 0 0.05 0 0 0 + + - + - + - - + + From 4f31969bcb3b3b90ac02cd8d27d4658c5f6f4c2b Mon Sep 17 00:00:00 2001 From: stevedan Date: Wed, 18 Sep 2024 08:39:14 +0200 Subject: [PATCH 3/6] lintering Signed-off-by: stevedan --- .../launch/spawn_tb3_gps.launch.py | 96 +++++++++---------- 1 file changed, 48 insertions(+), 48 deletions(-) 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 From ecb5f3a87e5ca765b63f7ad52b332da5fc4ac0ab Mon Sep 17 00:00:00 2001 From: Stevedan Ogochukwu Omodolor <61468301+stevedanomodolor@users.noreply.github.com> Date: Tue, 24 Sep 2024 23:31:47 +0200 Subject: [PATCH 4/6] Update nav2_minimal_tb3_sim/configs/turtlebot3_waffle_gps_bridge.yaml Co-authored-by: Steve Macenski Signed-off-by: Stevedan Ogochukwu Omodolor <61468301+stevedanomodolor@users.noreply.github.com> --- nav2_minimal_tb3_sim/configs/turtlebot3_waffle_gps_bridge.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nav2_minimal_tb3_sim/configs/turtlebot3_waffle_gps_bridge.yaml b/nav2_minimal_tb3_sim/configs/turtlebot3_waffle_gps_bridge.yaml index dc59b5c..83d38e9 100644 --- a/nav2_minimal_tb3_sim/configs/turtlebot3_waffle_gps_bridge.yaml +++ b/nav2_minimal_tb3_sim/configs/turtlebot3_waffle_gps_bridge.yaml @@ -43,7 +43,7 @@ gz_type_name: "gz.msgs.Twist" direction: ROS_TO_GZ -# replae navsat_bridge - check gz topic name +# replace navsat_bridge - check gz topic name - topic_name: "gps/fix" ros_type_name: "sensor_msgs/msg/NavSatFix" gz_type_name: "gz.msgs.NavSat" From 1e172a4f60d3e195e7fe8a32b4c8b2e07cc689bb Mon Sep 17 00:00:00 2001 From: stevedan Date: Tue, 24 Sep 2024 23:32:26 +0200 Subject: [PATCH 5/6] Change naming Signed-off-by: stevedan --- .../worlds/{tb3_gps.sdf.xacro => tb3_empty_world.sdf.xacro} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename nav2_minimal_tb3_sim/worlds/{tb3_gps.sdf.xacro => tb3_empty_world.sdf.xacro} (100%) diff --git a/nav2_minimal_tb3_sim/worlds/tb3_gps.sdf.xacro b/nav2_minimal_tb3_sim/worlds/tb3_empty_world.sdf.xacro similarity index 100% rename from nav2_minimal_tb3_sim/worlds/tb3_gps.sdf.xacro rename to nav2_minimal_tb3_sim/worlds/tb3_empty_world.sdf.xacro From e14266571b574dab10879a5e8f15d175bc4e9aa4 Mon Sep 17 00:00:00 2001 From: stevedan Date: Wed, 25 Sep 2024 06:18:02 +0200 Subject: [PATCH 6/6] change artifat from v1 to v4 Signed-off-by: stevedan --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ac98831..cbeb9cf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,7 +27,7 @@ jobs: with: import-token: ${{ secrets.GITHUB_TOKEN }} target-ros2-distro: ${{ matrix.ros_distro }} - - uses: actions/upload-artifact@v1 + - uses: actions/upload-artifact@v4 with: name: colcon-logs path: ros_ws/log