From 45a542fd2242a1509a8165bb18ba42b2cb4bcf15 Mon Sep 17 00:00:00 2001 From: attu0 Date: Tue, 19 May 2026 15:29:58 +0530 Subject: [PATCH 01/16] Started with jazzy switch --- description/robot.urdf.xacro | 5 -- launch/ekf.launch.py | 31 ---------- launch/launch_robot.launch.py | 111 ---------------------------------- launch/launch_sim.launch.py | 87 ++++++++++---------------- 4 files changed, 33 insertions(+), 201 deletions(-) delete mode 100644 launch/ekf.launch.py delete mode 100644 launch/launch_robot.launch.py diff --git a/description/robot.urdf.xacro b/description/robot.urdf.xacro index 6211f8c..18c7df3 100644 --- a/description/robot.urdf.xacro +++ b/description/robot.urdf.xacro @@ -4,10 +4,5 @@ - - - - - \ No newline at end of file diff --git a/launch/ekf.launch.py b/launch/ekf.launch.py deleted file mode 100644 index 8789f3b..0000000 --- a/launch/ekf.launch.py +++ /dev/null @@ -1,31 +0,0 @@ -import os - -from ament_index_python.packages import get_package_share_directory -from launch import LaunchDescription -from launch_ros.actions import Node - - -def generate_launch_description(): - - package_name = 'articubot_two' - - ekf_config = os.path.join( - get_package_share_directory(package_name), - 'config', - 'ekf.yaml' - ) - - ekf_node = Node( - package='robot_localization', - executable='ekf_node', - name='ekf_filter_node', - output='screen', - parameters=[ - ekf_config, - {'use_sim_time': True} - ], - ) - - return LaunchDescription([ - ekf_node - ]) diff --git a/launch/launch_robot.launch.py b/launch/launch_robot.launch.py deleted file mode 100644 index b0d9b8e..0000000 --- a/launch/launch_robot.launch.py +++ /dev/null @@ -1,111 +0,0 @@ -import os - -from ament_index_python.packages import get_package_share_directory - - -from launch import LaunchDescription -from launch.actions import IncludeLaunchDescription, TimerAction -from launch.launch_description_sources import PythonLaunchDescriptionSource -from launch.substitutions import Command -from launch.actions import RegisterEventHandler -from launch.event_handlers import OnProcessStart - -from launch_ros.actions import Node - - - -def generate_launch_description(): - - - # Include the robot_state_publisher launch file, provided by our own package. Force sim time to be enabled - # !!! MAKE SURE YOU SET THE PACKAGE NAME CORRECTLY !!! - - package_name='articubot_two' #<--- CHANGE ME - - rsp = IncludeLaunchDescription( - PythonLaunchDescriptionSource([os.path.join( - get_package_share_directory(package_name),'launch','rsp.launch.py' - )]), launch_arguments={'use_sim_time': 'false'}.items() - ) - - twist_mux_params = os.path.join(get_package_share_directory(package_name),'config','twist_mux.yaml') - twist_mux = Node( - package="twist_mux", - executable="twist_mux", - parameters=[twist_mux_params], - remappings=[('/cmd_vel_out','/diff_cont/cmd_vel_unstamped')] - ) - - robot_description = Command(['ros2 param get --hide-type /robot_state_publisher robot_description']) - - controller_params_file = os.path.join(get_package_share_directory(package_name),'config','my_controllers.yaml') - - controller_manager = Node( - package="controller_manager", - executable="ros2_control_node", - parameters=[{'robot_description': robot_description}, - controller_params_file] - ) - - delayed_controller_manager = TimerAction(period=3.0, actions=[controller_manager]) - - ekf_config = os.path.join( - get_package_share_directory(package_name), - 'config', - 'ekf.yaml' - ) - - diff_drive_spawner = Node( - package="controller_manager", - executable="spawner", - arguments=["diff_cont"], - ) - - delayed_diff_drive_spawner = RegisterEventHandler( - event_handler=OnProcessStart( - target_action=controller_manager, - on_start=[diff_drive_spawner], - ) - ) - - joint_broad_spawner = Node( - package="controller_manager", - executable="spawner", - arguments=["joint_broad"], - ) - - delayed_joint_broad_spawner = RegisterEventHandler( - event_handler=OnProcessStart( - target_action=controller_manager, - on_start=[joint_broad_spawner], - ) - ) - - ekf_node = Node( - package='robot_localization', - executable='ekf_node', - name='ekf_filter_node', - output='screen', - parameters=[ - ekf_config, - {'use_sim_time': False} - ], - ) - - delayed_ekf_node = RegisterEventHandler( - event_handler=OnProcessStart( - target_action=controller_manager, - on_start=[ekf_node], - ) - ) - - - # Launch them all! - return LaunchDescription([ - rsp, - twist_mux, - delayed_controller_manager, - delayed_diff_drive_spawner, - delayed_joint_broad_spawner, - delayed_ekf_node, - ]) \ No newline at end of file diff --git a/launch/launch_sim.launch.py b/launch/launch_sim.launch.py index 5b06eb1..1683ebd 100644 --- a/launch/launch_sim.launch.py +++ b/launch/launch_sim.launch.py @@ -2,7 +2,6 @@ from ament_index_python.packages import get_package_share_directory - from launch import LaunchDescription from launch.actions import IncludeLaunchDescription from launch.launch_description_sources import PythonLaunchDescriptionSource @@ -10,72 +9,52 @@ from launch_ros.actions import Node - def generate_launch_description(): + package_name = 'articubot_two' - # Include the robot_state_publisher launch file, provided by our own package. Force sim time to be enabled - # !!! MAKE SURE YOU SET THE PACKAGE NAME CORRECTLY !!! - - package_name='articubot_two' #<--- CHANGE ME - + # Robot State Publisher rsp = IncludeLaunchDescription( - PythonLaunchDescriptionSource([os.path.join( - get_package_share_directory(package_name),'launch','rsp.launch.py' - )]), launch_arguments={'use_sim_time': 'true'}.items() - ) - - ekf_config = os.path.join( - get_package_share_directory(package_name), - 'config', - 'ekf.yaml' + PythonLaunchDescriptionSource( + os.path.join( + get_package_share_directory(package_name), + 'launch', + 'rsp.launch.py' + ) + ), + launch_arguments={'use_sim_time': 'true'}.items() ) - gazebo_params_file = os.path.join(get_package_share_directory(package_name),'config','gazebo_params.yaml') - - # Include the Gazebo launch file, provided by the gazebo_ros package + # Gazebo Harmonic gazebo = IncludeLaunchDescription( - PythonLaunchDescriptionSource([os.path.join( - get_package_share_directory('gazebo_ros'), 'launch', 'gazebo.launch.py')]), - launch_arguments={'extra_gazebo_args': '--ros-args --params-file ' + gazebo_params_file}.items() - ) - - # Run the spawner node from the gazebo_ros package. The entity name doesn't really matter if you only have a single robot. - spawn_entity = Node(package='gazebo_ros', executable='spawn_entity.py', - arguments=['-topic', 'robot_description', - '-entity', 'my_bot'], - output='screen') - - diff_drive_spawner = Node( - package="controller_manager", - executable="spawner", - arguments=["diff_cont"], + PythonLaunchDescriptionSource( + os.path.join( + get_package_share_directory('ros_gz_sim'), + 'launch', + 'gz_sim.launch.py' + ) + ), + launch_arguments={ + 'gz_args': '-r empty.sdf' + }.items() ) - joint_broad_spawner = Node( - package="controller_manager", - executable="spawner", - arguments=["joint_broad"], - ) - - ekf_node = Node( - package='robot_localization', - executable='ekf_node', - name='ekf_filter_node', - output='screen', - parameters=[ - ekf_config, - {'use_sim_time': True} + # Spawn robot + spawn = Node( + package='ros_gz_sim', + executable='create', + arguments=[ + '-topic', 'robot_description', + '-name', 'my_bot', + '-x', '0.0', + '-y', '0.0', + '-z', '0.2' ], + output='screen' ) - - # Launch them all! return LaunchDescription([ rsp, gazebo, - spawn_entity, - diff_drive_spawner, - joint_broad_spawner, - ekf_node, + spawn ]) \ No newline at end of file From 4a93c972245daf0ea38f0fe24dc803da3d4e50fd Mon Sep 17 00:00:00 2001 From: attu0 Date: Tue, 19 May 2026 15:58:11 +0530 Subject: [PATCH 02/16] updated to correct launch_sim --- description/camera.xacro | 91 ++++++++++++++++++++++++++++-------- description/lidar.xacro | 73 +++++++++++++++++++---------- description/robot.urdf.xacro | 2 - launch/launch_sim.launch.py | 11 ++--- 4 files changed, 123 insertions(+), 54 deletions(-) diff --git a/description/camera.xacro b/description/camera.xacro index a4e1ffb..dc36134 100644 --- a/description/camera.xacro +++ b/description/camera.xacro @@ -1,5 +1,8 @@ - + + + + @@ -7,49 +10,97 @@ + + + + + + - + + - - - - - - + - + + + + + + + + + + + + + + - - Gazebo/Red + + + + + + + + true - - 0 0 0 0 0 0 true + 30 + + /camera + - 0.933 + + 1.047 + - R8G8B8 640 480 + R8G8B8 + 0.1 - 100.0 + 100 + - - camera_link_optical - + - + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/description/lidar.xacro b/description/lidar.xacro index 6bea529..db77503 100644 --- a/description/lidar.xacro +++ b/description/lidar.xacro @@ -1,55 +1,78 @@ - + - + - + + + + + + + + + + + - + - - - + + - + + + + + + + - - 0 0 0 0 0 0 - true + + Gazebo/Black + + + + 0 0 0 0 0 0 + + false + 10 - + + scan + + + - - - 360 + 1 -3.14 3.14 + 0.3 - 12 + 12.0 + 0.01 - - - - ~/out:=scan - - sensor_msgs/LaserScan - laser_frame - + + + + true + - Gazebo/Red + + \ No newline at end of file diff --git a/description/robot.urdf.xacro b/description/robot.urdf.xacro index 18c7df3..0818fee 100644 --- a/description/robot.urdf.xacro +++ b/description/robot.urdf.xacro @@ -1,8 +1,6 @@ - - \ No newline at end of file diff --git a/launch/launch_sim.launch.py b/launch/launch_sim.launch.py index 1683ebd..1b0f4c2 100644 --- a/launch/launch_sim.launch.py +++ b/launch/launch_sim.launch.py @@ -25,7 +25,7 @@ def generate_launch_description(): launch_arguments={'use_sim_time': 'true'}.items() ) - # Gazebo Harmonic + # Gazebo Harmonic launch gazebo = IncludeLaunchDescription( PythonLaunchDescriptionSource( os.path.join( @@ -40,15 +40,12 @@ def generate_launch_description(): ) # Spawn robot - spawn = Node( + spawn_entity = Node( package='ros_gz_sim', executable='create', arguments=[ '-topic', 'robot_description', - '-name', 'my_bot', - '-x', '0.0', - '-y', '0.0', - '-z', '0.2' + '-name', 'my_bot' ], output='screen' ) @@ -56,5 +53,5 @@ def generate_launch_description(): return LaunchDescription([ rsp, gazebo, - spawn + spawn_entity, ]) \ No newline at end of file From 5669d8bc60c66c74e544fd81cb0e466295155459 Mon Sep 17 00:00:00 2001 From: attu0 Date: Tue, 19 May 2026 16:22:44 +0530 Subject: [PATCH 03/16] Added gazebo control, now can teleop --- config/gz_bridge.yaml | 47 ++++++++++++++++++++++++++++++++ description/gazebo_control.xacro | 31 ++++++++++++++------- description/robot.urdf.xacro | 1 + launch/launch_sim.launch.py | 28 ++++++++++++++++--- 4 files changed, 93 insertions(+), 14 deletions(-) create mode 100644 config/gz_bridge.yaml diff --git a/config/gz_bridge.yaml b/config/gz_bridge.yaml new file mode 100644 index 0000000..fb98084 --- /dev/null +++ b/config/gz_bridge.yaml @@ -0,0 +1,47 @@ +- ros_topic_name: "/clock" + gz_topic_name: "/clock" + ros_type_name: "rosgraph_msgs/msg/Clock" + gz_type_name: "gz.msgs.Clock" + direction: GZ_TO_ROS + +# Lidar +- ros_topic_name: "/scan" + gz_topic_name: "/scan" + ros_type_name: "sensor_msgs/msg/LaserScan" + gz_type_name: "gz.msgs.LaserScan" + direction: GZ_TO_ROS + +# Camera +- ros_topic_name: "/camera/camera_info" + gz_topic_name: "/camera/camera_info" + ros_type_name: "sensor_msgs/msg/CameraInfo" + gz_type_name: "gz.msgs.CameraInfo" + direction: GZ_TO_ROS + +# Odometry +- ros_topic_name: "/odom" + gz_topic_name: "/odom" + ros_type_name: "nav_msgs/msg/Odometry" + gz_type_name: "gz.msgs.Odometry" + direction: GZ_TO_ROS + +# TF +- ros_topic_name: "/tf" + gz_topic_name: "/tf" + ros_type_name: "tf2_msgs/msg/TFMessage" + gz_type_name: "gz.msgs.Pose_V" + direction: GZ_TO_ROS + +# Velocity commands +- ros_topic_name: "/cmd_vel" + gz_topic_name: "/cmd_vel" + ros_type_name: "geometry_msgs/msg/Twist" + gz_type_name: "gz.msgs.Twist" + direction: ROS_TO_GZ + +# Joint states +- ros_topic_name: "/joint_states" + gz_topic_name: "/joint_states" + ros_type_name: "sensor_msgs/msg/JointState" + gz_type_name: "gz.msgs.Model" + direction: GZ_TO_ROS \ No newline at end of file diff --git a/description/gazebo_control.xacro b/description/gazebo_control.xacro index 3501277..8df320f 100644 --- a/description/gazebo_control.xacro +++ b/description/gazebo_control.xacro @@ -2,28 +2,39 @@ - + left_wheel_joint right_wheel_joint - 0.18 - 0.07 + 0.297 + 0.033 - 100 - 10.0 + + 0.33 + + + cmd_vel - odom - base_link + odom + base_link + odom + 30 + + /tf + + - true - true - true + + joint_states + left_wheel_joint + right_wheel_joint diff --git a/description/robot.urdf.xacro b/description/robot.urdf.xacro index 0818fee..3456612 100644 --- a/description/robot.urdf.xacro +++ b/description/robot.urdf.xacro @@ -2,5 +2,6 @@ + \ No newline at end of file diff --git a/launch/launch_sim.launch.py b/launch/launch_sim.launch.py index 1b0f4c2..d108a43 100644 --- a/launch/launch_sim.launch.py +++ b/launch/launch_sim.launch.py @@ -50,8 +50,28 @@ def generate_launch_description(): output='screen' ) + + bridge_params = os.path.join(get_package_share_directory(package_name),'config','gz_bridge.yaml') + ros_gz_bridge = Node( + package="ros_gz_bridge", + executable="parameter_bridge", + arguments=[ + '--ros-args', + '-p', + f'config_file:={bridge_params}', + ] + ) + + ros_gz_image_bridge = Node( + package="ros_gz_image", + executable="image_bridge", + arguments=["/camera/image_raw"] + ) + return LaunchDescription([ - rsp, - gazebo, - spawn_entity, - ]) \ No newline at end of file + rsp, + gazebo, + spawn_entity, + ros_gz_bridge, + ros_gz_image_bridge, +]) \ No newline at end of file From e90b6706e1855a0ee804ccd83235174f9889ce7f Mon Sep 17 00:00:00 2001 From: attu0 Date: Tue, 19 May 2026 16:41:36 +0530 Subject: [PATCH 04/16] Removed excess junk --- config/ekf.yaml | 31 -------- config/empty.yaml | 1 - config/gaz_ros2_ctl_use_sim.yaml | 3 - config/gazebo_params.yaml | 3 - config/mapper_params_online_async.yaml | 73 ----------------- config/my_controllers.yaml | 68 ---------------- description/camera.xacro | 106 ------------------------- description/imu.xacro | 57 ------------- description/lidar.xacro | 78 ------------------ description/ros2_control.xacro | 69 ---------------- launch/camera.launch.py | 18 ----- launch/joystick.launch.py | 34 -------- launch/launch_sim.launch.py | 2 +- launch/rplidar.launch.py | 19 ----- 14 files changed, 1 insertion(+), 561 deletions(-) delete mode 100644 config/ekf.yaml delete mode 100644 config/empty.yaml delete mode 100644 config/gaz_ros2_ctl_use_sim.yaml delete mode 100644 config/gazebo_params.yaml delete mode 100644 config/mapper_params_online_async.yaml delete mode 100644 config/my_controllers.yaml delete mode 100644 description/camera.xacro delete mode 100644 description/imu.xacro delete mode 100644 description/lidar.xacro delete mode 100644 description/ros2_control.xacro delete mode 100644 launch/camera.launch.py delete mode 100644 launch/joystick.launch.py delete mode 100644 launch/rplidar.launch.py diff --git a/config/ekf.yaml b/config/ekf.yaml deleted file mode 100644 index 16a19bc..0000000 --- a/config/ekf.yaml +++ /dev/null @@ -1,31 +0,0 @@ -ekf_filter_node: - ros__parameters: - - frequency: 50.0 - sensor_timeout: 0.1 - two_d_mode: true - - publish_tf: true - - map_frame: map - odom_frame: odom - base_link_frame: base_link - world_frame: odom - - # Wheel Odometry (position + linear velocity only) - odom0: /diff_cont/odom - odom0_config: [true, true, false, # x, y - false, false, false, # roll, pitch, yaw (disabled) - true, false, false, # vx - false, false, false, # vroll, vpitch, vyaw - false, false, false] - - # IMU (Yaw + angular velocity) - imu0: /imu/data - imu0_config: [false, false, false, - false, false, true, # yaw - false, false, false, - false, false, true, # vyaw - false, false, false] - - imu0_remove_gravitational_acceleration: true \ No newline at end of file diff --git a/config/empty.yaml b/config/empty.yaml deleted file mode 100644 index 04700ba..0000000 --- a/config/empty.yaml +++ /dev/null @@ -1 +0,0 @@ -# This is an empty file, so that git commits the folder correctly \ No newline at end of file diff --git a/config/gaz_ros2_ctl_use_sim.yaml b/config/gaz_ros2_ctl_use_sim.yaml deleted file mode 100644 index 775d5c6..0000000 --- a/config/gaz_ros2_ctl_use_sim.yaml +++ /dev/null @@ -1,3 +0,0 @@ -controller_manager: - ros__parameters: - use_sim_time: true diff --git a/config/gazebo_params.yaml b/config/gazebo_params.yaml deleted file mode 100644 index d7caf6d..0000000 --- a/config/gazebo_params.yaml +++ /dev/null @@ -1,3 +0,0 @@ -gazebo: - ros__parameters: - publish_rate: 400.0 \ No newline at end of file diff --git a/config/mapper_params_online_async.yaml b/config/mapper_params_online_async.yaml deleted file mode 100644 index 571354c..0000000 --- a/config/mapper_params_online_async.yaml +++ /dev/null @@ -1,73 +0,0 @@ -slam_toolbox: - ros__parameters: - - # Plugin params - solver_plugin: solver_plugins::CeresSolver - ceres_linear_solver: SPARSE_NORMAL_CHOLESKY - ceres_preconditioner: SCHUR_JACOBI - ceres_trust_strategy: LEVENBERG_MARQUARDT - ceres_dogleg_type: TRADITIONAL_DOGLEG - ceres_loss_function: None - - # ROS Parameters - odom_frame: odom - map_frame: map - base_frame: base_footprint - scan_topic: /scan - mode: localization #mapping - - # if you'd like to immediately start continuing a map at a given pose - # or at the dock, but they are mutually exclusive, if pose is given - # will use pose - map_file_name: /home/atharv/bot_ws/my_map_serial - # map_start_pose: [0.0, 0.0, 0.0] - map_start_at_dock: true - - debug_logging: false - throttle_scans: 1 - transform_publish_period: 0.02 #if 0 never publishes odometry - map_update_interval: 5.0 - resolution: 0.05 - max_laser_range: 20.0 #for rastering images - minimum_time_interval: 0.5 - transform_timeout: 0.2 - tf_buffer_duration: 30. - stack_size_to_use: 40000000 #// program needs a larger stack size to serialize large maps - enable_interactive_mode: true - - # General Parameters - use_scan_matching: true - use_scan_barycenter: true - minimum_travel_distance: 0.5 - minimum_travel_heading: 0.5 - scan_buffer_size: 10 - scan_buffer_maximum_scan_distance: 10.0 - link_match_minimum_response_fine: 0.1 - link_scan_maximum_distance: 1.5 - loop_search_maximum_distance: 3.0 - do_loop_closing: true - loop_match_minimum_chain_size: 10 - loop_match_maximum_variance_coarse: 3.0 - loop_match_minimum_response_coarse: 0.35 - loop_match_minimum_response_fine: 0.45 - - # Correlation Parameters - Correlation Parameters - correlation_search_space_dimension: 0.5 - correlation_search_space_resolution: 0.01 - correlation_search_space_smear_deviation: 0.1 - - # Correlation Parameters - Loop Closure Parameters - loop_search_space_dimension: 8.0 - loop_search_space_resolution: 0.05 - loop_search_space_smear_deviation: 0.03 - - # Scan Matcher Parameters - distance_variance_penalty: 0.5 - angle_variance_penalty: 1.0 - - fine_search_angle_offset: 0.00349 - coarse_search_angle_offset: 0.349 - coarse_angle_resolution: 0.0349 - minimum_angle_penalty: 0.9 - minimum_distance_penalty: 0.5 - use_response_expansion: true diff --git a/config/my_controllers.yaml b/config/my_controllers.yaml deleted file mode 100644 index 53551ef..0000000 --- a/config/my_controllers.yaml +++ /dev/null @@ -1,68 +0,0 @@ -controller_manager: - ros__parameters: - update_rate: 50 - #use_sim_time: true - - diff_cont: - type: diff_drive_controller/DiffDriveController - - joint_broad: - type: joint_state_broadcaster/JointStateBroadcaster - -diff_cont: - ros__parameters: - - publish_rate: 50.0 - - base_frame_id: base_link - - left_wheel_names: ['left_wheel_joint'] - right_wheel_names: ['right_wheel_joint'] - wheel_separation: 0.18 - wheel_radius: 0.035 - - use_stamped_vel: false - - # open_loop: false - - # wheels_per_side: x - # wheel_separation_multiplier: x - # left_wheel_radius_multiplier: 1.026 - # right_wheel_radius_multiplier: 0.976 - - # odom_frame_id: x - # pose_covariance_diagonal: x - # twist_covariance_diagonal: x - # open_loop: x - enable_odom_tf: false - - # cmd_vel_timeout: x - # publish_limited_velocity: x - # velocity_rolling_window_size: x - - - # linear.x.has_velocity_limits: false - # linear.x.has_acceleration_limits: false - # linear.x.has_jerk_limits: false - # linear.x.max_velocity: NAN - # linear.x.min_velocity: NAN - # linear.x.max_acceleration: NAN - # linear.x.min_acceleration: NAN - # linear.x.max_jerk: NAN - # linear.x.min_jerk: NAN - - # angular.z.has_velocity_limits: false - # angular.z.has_acceleration_limits: false - # angular.z.has_jerk_limits: false - # angular.z.max_velocity: NAN - # angular.z.min_velocity: NAN - # angular.z.max_acceleration: NAN - # angular.z.min_acceleration: NAN - # angular.z.max_jerk: NAN - # angular.z.min_jerk: NAN - - - - -# joint_broad: -# ros__parameters: \ No newline at end of file diff --git a/description/camera.xacro b/description/camera.xacro deleted file mode 100644 index dc36134..0000000 --- a/description/camera.xacro +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - true - - 30 - - /camera - - - - 1.047 - - - 640 - 480 - R8G8B8 - - - - 0.1 - 100 - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/description/imu.xacro b/description/imu.xacro deleted file mode 100644 index 1ab6eb3..0000000 --- a/description/imu.xacro +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - 30 - true - - - - ~/out:=/imu/data - - imu_link - - - - - - - diff --git a/description/lidar.xacro b/description/lidar.xacro deleted file mode 100644 index db77503..0000000 --- a/description/lidar.xacro +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Gazebo/Black - - - - 0 0 0 0 0 0 - - false - - 10 - - scan - - - - - - 360 - 1 - -3.14 - 3.14 - - - - - 0.3 - 12.0 - 0.01 - - - - - true - - - - - - \ No newline at end of file diff --git a/description/ros2_control.xacro b/description/ros2_control.xacro deleted file mode 100644 index c387af2..0000000 --- a/description/ros2_control.xacro +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - diffdrive_arduino/DiffDriveArduinoHardware - - /dev/ttyACM0 - 57600 - 100 - 1286 - 30.0 - 0.035 - 0.180 - left_wheel_joint - right_wheel_joint - 0 - 0 - 0 - 0 - - - - - - - - - - - - - - - - - - - - gazebo_ros2_control/GazeboSystem - - - - -10 - 10 - - - - - - - -10 - 10 - - - - - - - - - - $(find articubot_two)/config/my_controllers.yaml - $(find articubot_two)/config/gaz_ros2_ctl_use_sim.yaml - - - - \ No newline at end of file diff --git a/launch/camera.launch.py b/launch/camera.launch.py deleted file mode 100644 index 1c8f681..0000000 --- a/launch/camera.launch.py +++ /dev/null @@ -1,18 +0,0 @@ -import os - -from launch import LaunchDescription -from launch_ros.actions import Node - -def generate_launch_description(): - return LaunchDescription([ - Node( - package='v4l2_camera', - executable='v4l2_camera_node', - output='screen', - parameters=[{ - 'image_size':[640,480], - 'camera_frame_id':'camera_link_optical' - }] - ) - ]) - diff --git a/launch/joystick.launch.py b/launch/joystick.launch.py deleted file mode 100644 index 11f62c7..0000000 --- a/launch/joystick.launch.py +++ /dev/null @@ -1,34 +0,0 @@ -from launch import LaunchDescription -from launch_ros.actions import Node - - -def generate_launch_description(): - - joy_node = Node( - package="joy", - executable="joy_node", - name="joy_node", - output="screen", - ) - - teleop_node = Node( - package="teleop_twist_joy", - executable="teleop_node", - name="teleop_twist_joy", - output="screen", - remappings=[ - ("cmd_vel", "/diff_cont/cmd_vel_unstamped") - ], - parameters=[{ - "axis_linear.x": 1, - "axis_angular.yaw": 0, - "scale_linear.x": 0.5, - "scale_angular.yaw": 1.0, - "enable_button": 5 - }] - ) - - return LaunchDescription([ - joy_node, - teleop_node - ]) \ No newline at end of file diff --git a/launch/launch_sim.launch.py b/launch/launch_sim.launch.py index d108a43..d30e46c 100644 --- a/launch/launch_sim.launch.py +++ b/launch/launch_sim.launch.py @@ -71,7 +71,7 @@ def generate_launch_description(): return LaunchDescription([ rsp, gazebo, - spawn_entity, + spawn_entity, ros_gz_bridge, ros_gz_image_bridge, ]) \ No newline at end of file diff --git a/launch/rplidar.launch.py b/launch/rplidar.launch.py deleted file mode 100644 index e4edbd6..0000000 --- a/launch/rplidar.launch.py +++ /dev/null @@ -1,19 +0,0 @@ -from launch import LaunchDescription -from launch_ros.actions import Node - -def generate_launch_description(): - return LaunchDescription([ - Node( - package='rplidar_ros', - executable='rplidar_node', - name='rplidar', - output='screen', - parameters=[{ - 'serial_port': '/dev/ttyUSB0', - 'serial_baudrate': 115200, - 'frame_id': 'laser_frame', - 'angle_compensate': False, - 'scan_mode': 'Standard' - }] - ) - ]) From 83465caee4936dc210cc749d1b368e2db135cb81 Mon Sep 17 00:00:00 2001 From: attu0 Date: Fri, 5 Jun 2026 17:11:56 +0530 Subject: [PATCH 05/16] Fixed the readme for jazzy --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cd6ad1c..17c83c1 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ## Requirements - OS: Ubuntu 22.04 Jammy -- Ros2 Humble +- Ros2 jazzy ## Build your Workspace for devloper pc @@ -44,7 +44,7 @@ colcon build --symlink-install ##### Source it ```bash cd ~/dev_ws -source /opt/ros/humble/setup.bash +source /opt/ros/jazzy/setup.bash source install/setup.bash ``` @@ -83,7 +83,7 @@ ros2 launch articubot_one rplidar.launch.py ##### Source it ```bash cd ~/robot_ws -source /opt/ros/humble/setup.bash +source /opt/ros/jazzy/setup.bash source install/setup.bash ``` From 8209a0e6b4c260bc2b19eac6d36aa33a6fcff3cc Mon Sep 17 00:00:00 2001 From: attu0 Date: Sat, 6 Jun 2026 14:22:29 +0530 Subject: [PATCH 06/16] fixed color --- description/robot_core.xacro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/description/robot_core.xacro b/description/robot_core.xacro index c493c49..fe5516e 100644 --- a/description/robot_core.xacro +++ b/description/robot_core.xacro @@ -46,7 +46,7 @@ - Gazebo/White + Gazebo/Orange From 53bc0ab5c8c7a0bce7be44edcc36ff572a06a2c7 Mon Sep 17 00:00:00 2001 From: attu0 Date: Sat, 6 Jun 2026 14:35:53 +0530 Subject: [PATCH 07/16] Added lidar but its not scanningyet --- config/empty.yaml | 1 + config/gaz_ros2_ctl_use_sim.yaml | 3 ++ config/gz_bridge.yaml | 41 ++++++++++++------------ description/lidar.xacro | 53 ++++++++++++++++++++++++++++++++ description/robot.urdf.xacro | 1 + 5 files changed, 79 insertions(+), 20 deletions(-) create mode 100644 config/empty.yaml create mode 100644 config/gaz_ros2_ctl_use_sim.yaml create mode 100644 description/lidar.xacro diff --git a/config/empty.yaml b/config/empty.yaml new file mode 100644 index 0000000..04700ba --- /dev/null +++ b/config/empty.yaml @@ -0,0 +1 @@ +# This is an empty file, so that git commits the folder correctly \ No newline at end of file diff --git a/config/gaz_ros2_ctl_use_sim.yaml b/config/gaz_ros2_ctl_use_sim.yaml new file mode 100644 index 0000000..775d5c6 --- /dev/null +++ b/config/gaz_ros2_ctl_use_sim.yaml @@ -0,0 +1,3 @@ +controller_manager: + ros__parameters: + use_sim_time: true diff --git a/config/gz_bridge.yaml b/config/gz_bridge.yaml index fb98084..c7e6896 100644 --- a/config/gz_bridge.yaml +++ b/config/gz_bridge.yaml @@ -1,47 +1,48 @@ -- ros_topic_name: "/clock" - gz_topic_name: "/clock" +- ros_topic_name: "clock" + gz_topic_name: "clock" ros_type_name: "rosgraph_msgs/msg/Clock" gz_type_name: "gz.msgs.Clock" direction: GZ_TO_ROS -# Lidar -- ros_topic_name: "/scan" - gz_topic_name: "/scan" +# gz topic published by Sensors plugin +- ros_topic_name: "scan" + gz_topic_name: "scan" ros_type_name: "sensor_msgs/msg/LaserScan" gz_type_name: "gz.msgs.LaserScan" direction: GZ_TO_ROS -# Camera -- ros_topic_name: "/camera/camera_info" - gz_topic_name: "/camera/camera_info" +# gz topic published by Sensors plugin (Camera) +- ros_topic_name: "camera/camera_info" + gz_topic_name: "camera/camera_info" ros_type_name: "sensor_msgs/msg/CameraInfo" gz_type_name: "gz.msgs.CameraInfo" direction: GZ_TO_ROS -# Odometry -- ros_topic_name: "/odom" - gz_topic_name: "/odom" + +# gz topic published by DiffDrive plugin +- ros_topic_name: "odom" + gz_topic_name: "odom" ros_type_name: "nav_msgs/msg/Odometry" gz_type_name: "gz.msgs.Odometry" direction: GZ_TO_ROS -# TF -- ros_topic_name: "/tf" - gz_topic_name: "/tf" +# gz topic published by DiffDrive plugin +- ros_topic_name: "tf" + gz_topic_name: "tf" ros_type_name: "tf2_msgs/msg/TFMessage" gz_type_name: "gz.msgs.Pose_V" direction: GZ_TO_ROS -# Velocity commands -- ros_topic_name: "/cmd_vel" - gz_topic_name: "/cmd_vel" +# gz topic subscribed to by DiffDrive plugin +- ros_topic_name: "diff_cont/cmd_vel_unstamped" + gz_topic_name: "cmd_vel" ros_type_name: "geometry_msgs/msg/Twist" gz_type_name: "gz.msgs.Twist" direction: ROS_TO_GZ -# Joint states -- ros_topic_name: "/joint_states" - gz_topic_name: "/joint_states" +# gz topic published by JointState plugin +- ros_topic_name: "joint_states" + gz_topic_name: "joint_states" ros_type_name: "sensor_msgs/msg/JointState" gz_type_name: "gz.msgs.Model" direction: GZ_TO_ROS \ No newline at end of file diff --git a/description/lidar.xacro b/description/lidar.xacro new file mode 100644 index 0000000..4c89ed2 --- /dev/null +++ b/description/lidar.xacro @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Gazebo/Black + + + 0 0 0 0 0 0 + false + 10 + + + + 360 + -3.14 + 3.14 + + + + 0.3 + 12 + + + scan + laser_frame + + + + \ No newline at end of file diff --git a/description/robot.urdf.xacro b/description/robot.urdf.xacro index 3456612..b855e37 100644 --- a/description/robot.urdf.xacro +++ b/description/robot.urdf.xacro @@ -3,5 +3,6 @@ + \ No newline at end of file From 2f7d286624d6eacd301c7f046cb3cb467009ed18 Mon Sep 17 00:00:00 2001 From: attu0 Date: Sat, 6 Jun 2026 14:41:59 +0530 Subject: [PATCH 08/16] added camera, still facing issues with sensors(camera.lidar) --- description/camera.xacro | 55 ++++++++++++++++++++++++++++++++++++ description/robot.urdf.xacro | 1 + 2 files changed, 56 insertions(+) create mode 100644 description/camera.xacro diff --git a/description/camera.xacro b/description/camera.xacro new file mode 100644 index 0000000..9ba2d80 --- /dev/null +++ b/description/camera.xacro @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Gazebo/Black + + + 0 0 0 0 0 0 + true + 10 + + camera/camera_info + 1.089 + + R8G8B8 + 640 + 480 + + + 0.05 + 8.0 + + + camera/image_raw + camera_link_optical + + + + \ No newline at end of file diff --git a/description/robot.urdf.xacro b/description/robot.urdf.xacro index b855e37..c8e9c76 100644 --- a/description/robot.urdf.xacro +++ b/description/robot.urdf.xacro @@ -4,5 +4,6 @@ + \ No newline at end of file From afdc4b7d3289cd44cc1a2630a3662d64553793e5 Mon Sep 17 00:00:00 2001 From: attu0 Date: Sat, 6 Jun 2026 14:56:40 +0530 Subject: [PATCH 09/16] Fixed the sensor issue, also updated lauch file --- description/camera.xacro | 1 + description/lidar.xacro | 1 + launch/launch_sim.launch.py | 132 ++++++++++++++++++++++++++---------- worlds/empty.world | 81 ++++++++++++++++++---- 4 files changed, 166 insertions(+), 49 deletions(-) diff --git a/description/camera.xacro b/description/camera.xacro index 9ba2d80..59ac017 100644 --- a/description/camera.xacro +++ b/description/camera.xacro @@ -32,6 +32,7 @@ 0 0 0 0 0 0 + true true 10 diff --git a/description/lidar.xacro b/description/lidar.xacro index 4c89ed2..fd36c06 100644 --- a/description/lidar.xacro +++ b/description/lidar.xacro @@ -31,6 +31,7 @@ 0 0 0 0 0 0 false + true 10 diff --git a/launch/launch_sim.launch.py b/launch/launch_sim.launch.py index d30e46c..399df0c 100644 --- a/launch/launch_sim.launch.py +++ b/launch/launch_sim.launch.py @@ -2,52 +2,84 @@ from ament_index_python.packages import get_package_share_directory + from launch import LaunchDescription -from launch.actions import IncludeLaunchDescription +from launch.actions import IncludeLaunchDescription, DeclareLaunchArgument from launch.launch_description_sources import PythonLaunchDescriptionSource +from launch.substitutions import LaunchConfiguration from launch_ros.actions import Node + def generate_launch_description(): - package_name = 'articubot_two' - # Robot State Publisher + # Include the robot_state_publisher launch file, provided by our own package. Force sim time to be enabled + # !!! MAKE SURE YOU SET THE PACKAGE NAME CORRECTLY !!! + + package_name='articubot_two' #<--- CHANGE ME + rsp = IncludeLaunchDescription( - PythonLaunchDescriptionSource( - os.path.join( - get_package_share_directory(package_name), - 'launch', - 'rsp.launch.py' - ) - ), - launch_arguments={'use_sim_time': 'true'}.items() + PythonLaunchDescriptionSource([os.path.join( + get_package_share_directory(package_name),'launch','rsp.launch.py' + )]), launch_arguments={'use_sim_time': 'true', 'use_ros2_control': 'true'}.items() + ) + + joystick = IncludeLaunchDescription( + PythonLaunchDescriptionSource([os.path.join( + get_package_share_directory(package_name),'launch','joystick.launch.py' + )]), launch_arguments={'use_sim_time': 'true'}.items() ) - # Gazebo Harmonic launch + twist_mux_params = os.path.join(get_package_share_directory(package_name),'config','twist_mux.yaml') + twist_mux = Node( + package="twist_mux", + executable="twist_mux", + parameters=[twist_mux_params, {'use_sim_time': True}], + remappings=[('/cmd_vel_out','/diff_cont/cmd_vel_unstamped')] + ) + + + default_world = os.path.join( + get_package_share_directory(package_name), + 'worlds', + 'empty.world' + ) + + world = LaunchConfiguration('world') + + world_arg = DeclareLaunchArgument( + 'world', + default_value=default_world, + description='World to load' + ) + + # Include the Gazebo launch file, provided by the ros_gz_sim package gazebo = IncludeLaunchDescription( - PythonLaunchDescriptionSource( - os.path.join( - get_package_share_directory('ros_gz_sim'), - 'launch', - 'gz_sim.launch.py' - ) - ), - launch_arguments={ - 'gz_args': '-r empty.sdf' - }.items() + PythonLaunchDescriptionSource([os.path.join( + get_package_share_directory('ros_gz_sim'), 'launch', 'gz_sim.launch.py')]), + launch_arguments={'gz_args': ['-r -v4 ', world], 'on_exit_shutdown': 'true'}.items() + ) + + # Run the spawner node from the ros_gz_sim package. The entity name doesn't really matter if you only have a single robot. + spawn_entity = Node(package='ros_gz_sim', executable='create', + arguments=['-topic', 'robot_description', + '-name', 'my_bot', + '-z', '0.1'], + output='screen') + + + diff_drive_spawner = Node( + package="controller_manager", + executable="spawner", + arguments=["diff_cont"], ) - # Spawn robot - spawn_entity = Node( - package='ros_gz_sim', - executable='create', - arguments=[ - '-topic', 'robot_description', - '-name', 'my_bot' - ], - output='screen' + joint_broad_spawner = Node( + package="controller_manager", + executable="spawner", + arguments=["joint_broad"], ) @@ -68,10 +100,36 @@ def generate_launch_description(): arguments=["/camera/image_raw"] ) + + + # Code for delaying a node (I haven't tested how effective it is) + # + # First add the below lines to imports + # from launch.actions import RegisterEventHandler + # from launch.event_handlers import OnProcessExit + # + # Then add the following below the current diff_drive_spawner + # delayed_diff_drive_spawner = RegisterEventHandler( + # event_handler=OnProcessExit( + # target_action=spawn_entity, + # on_exit=[diff_drive_spawner], + # ) + # ) + # + # Replace the diff_drive_spawner in the final return with delayed_diff_drive_spawner + + + + # Launch them all! return LaunchDescription([ - rsp, - gazebo, - spawn_entity, - ros_gz_bridge, - ros_gz_image_bridge, -]) \ No newline at end of file + rsp, + #joystick, + #twist_mux, + world_arg, + gazebo, + spawn_entity, + diff_drive_spawner, + joint_broad_spawner, + ros_gz_bridge, + ros_gz_image_bridge + ]) diff --git a/worlds/empty.world b/worlds/empty.world index 5321672..61f365f 100644 --- a/worlds/empty.world +++ b/worlds/empty.world @@ -1,13 +1,70 @@ - - - - - - model://sun - - - - model://ground_plane - + + + + 0.001 + 1.0 + + + + + + + + + ogre2 + + + + + + true + 0 0 10 0 0 0 + 0.8 0.8 0.8 1 + 0.2 0.2 0.2 1 + + 1000 + 0.9 + 0.01 + 0.001 + + -0.5 0.1 -0.9 + + + + true + + + + + 0 0 1 + 100 100 + + + + + + + 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 + + + + - + \ No newline at end of file From e9ee11d4492a38a8b8afb7f6439124ffbe58e0c6 Mon Sep 17 00:00:00 2001 From: attu0 Date: Sat, 6 Jun 2026 15:15:41 +0530 Subject: [PATCH 10/16] added world --- config/my_controllers.yaml | 68 ++++ description/ros2_control.xacro | 66 ++++ worlds/obstacle.sdf | 669 +++++++++++++++++++++++++++++++++ 3 files changed, 803 insertions(+) create mode 100644 config/my_controllers.yaml create mode 100644 description/ros2_control.xacro create mode 100644 worlds/obstacle.sdf diff --git a/config/my_controllers.yaml b/config/my_controllers.yaml new file mode 100644 index 0000000..9b13b48 --- /dev/null +++ b/config/my_controllers.yaml @@ -0,0 +1,68 @@ +controller_manager: + ros__parameters: + update_rate: 30 + # use_sim_time: true + + diff_cont: + type: diff_drive_controller/DiffDriveController + + joint_broad: + type: joint_state_broadcaster/JointStateBroadcaster + +diff_cont: + ros__parameters: + + publish_rate: 50.0 + + base_frame_id: base_link + + left_wheel_names: ['left_wheel_joint'] + right_wheel_names: ['right_wheel_joint'] + wheel_separation: 0.18 + wheel_radius: 0.035 + + # use_stamped_vel: false + + # open_loop: false + + # wheels_per_side: x + # wheel_separation_multiplier: x + # left_wheel_radius_multiplier: x + # right_wheel_radius_multiplier: x + + # odom_frame_id: x + # pose_covariance_diagonal: x + # twist_covariance_diagonal: x + # open_loop: x + # enable_odom_tf: x + + # cmd_vel_timeout: x + # publish_limited_velocity: x + # velocity_rolling_window_size: x + + + # linear.x.has_velocity_limits: false + # linear.x.has_acceleration_limits: false + # linear.x.has_jerk_limits: false + # linear.x.max_velocity: NAN + # linear.x.min_velocity: NAN + # linear.x.max_acceleration: NAN + # linear.x.min_acceleration: NAN + # linear.x.max_jerk: NAN + # linear.x.min_jerk: NAN + + # angular.z.has_velocity_limits: false + # angular.z.has_acceleration_limits: false + # angular.z.has_jerk_limits: false + # angular.z.max_velocity: NAN + # angular.z.min_velocity: NAN + # angular.z.max_acceleration: NAN + # angular.z.min_acceleration: NAN + # angular.z.max_jerk: NAN + # angular.z.min_jerk: NAN + + + + +# joint_broad: +# ros__parameters: \ No newline at end of file diff --git a/description/ros2_control.xacro b/description/ros2_control.xacro new file mode 100644 index 0000000..7cf72ad --- /dev/null +++ b/description/ros2_control.xacro @@ -0,0 +1,66 @@ + + + + + + + diffdrive_arduino/DiffDriveArduinoHardware + left_wheel_joint + right_wheel_joint + 30 + /dev/ttyUSB0 + 57600 + 1000 + 3436 + + + + -10 + 10 + + + + + + + -10 + 10 + + + + + + + + + + + gz_ros2_control/GazeboSimSystem + + + + -10 + 10 + + + + + + + -10 + 10 + + + + + + + + + + $(find articubot_two)/config/my_controllers.yaml + $(find articubot_two)/config/gaz_ros2_ctl_use_sim.yaml + + + + diff --git a/worlds/obstacle.sdf b/worlds/obstacle.sdf new file mode 100644 index 0000000..d012bbd --- /dev/null +++ b/worlds/obstacle.sdf @@ -0,0 +1,669 @@ + + + + 0.001 + 1 + 1000 + + + + + + 0 0 -9.8000000000000007 + 5.5644999999999998e-06 2.2875799999999999e-05 -4.2388400000000002e-05 + + + 0.400000006 0.400000006 0.400000006 1 + 0.699999988 0.699999988 0.699999988 1 + true + + + true + + + + + 0 0 1 + 100 100 + + + + + + + + + + + + + + 0 0 1 + 100 100 + + + + 0.800000012 0.800000012 0.800000012 1 + 0.800000012 0.800000012 0.800000012 1 + 0.800000012 0.800000012 0.800000012 1 + + + 0 0 0 0 0 0 + + 0 0 0 0 0 0 + 1 + + 1 + 0 + 0 + 1 + 0 + 1 + + + false + + 0 0 0 0 0 0 + false + + + 5.5894286916536018 6.3544884049254602 0.49999999990199806 6.2287739151293738e-22 9.3279666454713669e-22 -3.6315533669320137e-22 + + + + 0.16666 + 0 + 0 + 0.16666 + 0 + 0.16666 + + 1 + 0 0 0 0 0 0 + + + + + 1 1 1 + + + + + + + + + + + + + + 1 1 1 + + + + 0.300000012 0.300000012 0.300000012 1 + 0.699999988 0.699999988 0.699999988 1 + 1 1 1 1 + + + 0 0 0 0 0 0 + false + + false + false + + + 4.5887850280838904 -6.8070545031201179 0.49999999990199806 6.2287739151293738e-22 9.3279666454713669e-22 -3.6315533669320137e-22 + + + + 0.16666 + 0 + 0 + 0.16666 + 0 + 0.16666 + + 1 + 0 0 0 0 0 0 + + + + + 1 1 1 + + + + + + + + + + + + + + 1 1 1 + + + + 0.300000012 0.300000012 0.300000012 1 + 0.699999988 0.699999988 0.699999988 1 + 1 1 1 1 + + + 0 0 0 0 0 0 + false + + false + false + + + -4.1596935908624157 3.4553966257400903 0.49999999990199806 6.2287739151293738e-22 9.3279666454713669e-22 -3.6315533669320137e-22 + + + + 0.16666 + 0 + 0 + 0.16666 + 0 + 0.16666 + + 1 + 0 0 0 0 0 0 + + + + + 1 1 1 + + + + + + + + + + + + + + 1 1 1 + + + + 0.300000012 0.300000012 0.300000012 1 + 0.699999988 0.699999988 0.699999988 1 + 1 1 1 1 + + + 0 0 0 0 0 0 + false + + false + false + + + -2.098045030429577 -6.0188182638182255 0.49999999990199806 6.2287739151293738e-22 9.3279666454713669e-22 -3.6315533669320137e-22 + + + + 0.16666 + 0 + 0 + 0.16666 + 0 + 0.16666 + + 1 + 0 0 0 0 0 0 + + + + + 1 1 1 + + + + + + + + + + + + + + 1 1 1 + + + + 0.300000012 0.300000012 0.300000012 1 + 0.699999988 0.699999988 0.699999988 1 + 1 1 1 1 + + + 0 0 0 0 0 0 + false + + false + false + + + 4.849065764223452 1.301547479847297 0.49999942638036005 -3.234197451796803e-19 1.6873891088410844e-19 -8.6718542870722761e-21 + + + + 0.14580000000000001 + 0 + 0 + 0.14580000000000001 + 0 + 0.125 + + 1 + 0 0 0 0 0 0 + + + + + 0.5 + 1 + + + + + + + + + + + + + + 0.5 + 1 + + + + 0.300000012 0.300000012 0.300000012 1 + 0.699999988 0.699999988 0.699999988 1 + 1 1 1 1 + + + 0 0 0 0 0 0 + false + + false + false + + + 1.1419232346405686 -7.821728095094409 0.49999942638036005 2.6402521966221052e-19 3.329359840486923e-19 8.8426103357745432e-21 + + + + 0.14580000000000001 + 0 + 0 + 0.14580000000000001 + 0 + 0.125 + + 1 + 0 0 0 0 0 0 + + + + + 0.5 + 1 + + + + + + + + + + + + + + 0.5 + 1 + + + + 0.300000012 0.300000012 0.300000012 1 + 0.699999988 0.699999988 0.699999988 1 + 1 1 1 1 + + + 0 0 0 0 0 0 + false + + false + false + + + -5.9916297247377308 -4.8035849282983474 0.49999942638036005 -1.2325108630750125e-19 5.2332237750184956e-20 1.4519371047189128e-20 + + + + 0.14580000000000001 + 0 + 0 + 0.14580000000000001 + 0 + 0.125 + + 1 + 0 0 0 0 0 0 + + + + + 0.5 + 1 + + + + + + + + + + + + + + 0.5 + 1 + + + + 0.300000012 0.300000012 0.300000012 1 + 0.699999988 0.699999988 0.699999988 1 + 1 1 1 1 + + + 0 0 0 0 0 0 + false + + false + false + + + -1.2607789948470884 6.4899256913593222 0.49999942638036005 1.7878695869122041e-19 -9.7096515711216193e-20 8.5210264014226988e-21 + + + + 0.14580000000000001 + 0 + 0 + 0.14580000000000001 + 0 + 0.125 + + 1 + 0 0 0 0 0 0 + + + + + 0.5 + 1 + + + + + + + + + + + + + + 0.5 + 1 + + + + 0.300000012 0.300000012 0.300000012 1 + 0.699999988 0.699999988 0.699999988 1 + 1 1 1 1 + + + 0 0 0 0 0 0 + false + + false + false + + + -6.2595785317039949 -0.5709626899557172 0.499999999902001 0 0 0 + + + + 0.074153999999999998 + 0 + 0 + 0.074153999999999998 + 0 + 0.018769000000000001 + + 1 + 0 0 0 0 0 0 + + + + + 0.20000000000000001 + 0.59999999999999998 + + + + + + + + + + + + + + 0.20000000000000001 + 0.59999999999999998 + + + + 0.300000012 0.300000012 0.300000012 1 + 0.699999988 0.699999988 0.699999988 1 + 1 1 1 1 + + + 0 0 0 0 0 0 + false + + false + false + + + -8.3546134112281631 5.7117435524002271 0.5 0 0 0 + + + + 0.074999999999999997 + 0 + 0 + 0.074999999999999997 + 0 + 0.074999999999999997 + + 1 + 0 0 0 0 0 0 + + + + + 0.5 + 1 + + + + + + + + + + + + + + 0.5 + 1 + + + + 0.300000012 0.300000012 0.300000012 1 + 0.699999988 0.699999988 0.699999988 1 + 1 1 1 1 + + + 0 0 0 0 0 0 + false + + false + false + + + 6.6916393047249407 -4.0550962129920318 0.5 0 0 0 + + + + 0.074999999999999997 + 0 + 0 + 0.074999999999999997 + 0 + 0.074999999999999997 + + 1 + 0 0 0 0 0 0 + + + + + 0.5 + 1 + + + + + + + + + + + + + + 0.5 + 1 + + + + 0.300000012 0.300000012 0.300000012 1 + 0.699999988 0.699999988 0.699999988 1 + 1 1 1 1 + + + 0 0 0 0 0 0 + false + + false + false + + + -8.8563514285855298 -1.1184917215844943 0.5 0 0 0 + + + + 0.074999999999999997 + 0 + 0 + 0.074999999999999997 + 0 + 0.074999999999999997 + + 1 + 0 0 0 0 0 0 + + + + + 0.5 + 1 + + + + + + + + + + + + + + 0.5 + 1 + + + + 0.300000012 0.300000012 0.300000012 1 + 0.699999988 0.699999988 0.699999988 1 + 1 1 1 1 + + + 0 0 0 0 0 0 + false + + false + false + + + 0 0 10 0 0 0 + true + 1 + -0.5 0.10000000000000001 -0.90000000000000002 + 0.800000012 0.800000012 0.800000012 1 + 0.200000003 0.200000003 0.200000003 1 + + 1000 + 0.0099999997764825821 + 0.89999997615814209 + 0.0010000000474974513 + + + 0 + 0 + 0 + + + + From 2afa450cbc84f5345fb72b496a29a1e36c6a337f Mon Sep 17 00:00:00 2001 From: attu0 Date: Fri, 19 Jun 2026 10:45:44 +0530 Subject: [PATCH 11/16] Everything works --- config/joystick.yaml | 27 ++ config/map.rviz | 338 +++++++++++++++++ config/mapper_params_online_async.yaml | 73 ++++ config/nav.rviz | 361 ++++++++++++++++++ config/nav2_params_clean.yaml | 470 ++++++++++++++++++++++++ config/twist_mux.yaml | 15 + description/camera.xacro | 2 +- description/gazebo_control.xacro | 4 +- launch/joystick.launch.py | 45 +++ launch/launch_sim.launch.py | 23 +- launch/localization_launch.py | 107 ++++++ launch/navigation_launch.py | 367 ++++++++++++++++++ launch/online_async_launch.py | 59 +++ worlds/{obstacle.sdf => obstacle.world} | 0 14 files changed, 1867 insertions(+), 24 deletions(-) create mode 100644 config/joystick.yaml create mode 100644 config/map.rviz create mode 100644 config/mapper_params_online_async.yaml create mode 100644 config/nav.rviz create mode 100644 config/nav2_params_clean.yaml create mode 100644 config/twist_mux.yaml create mode 100644 launch/joystick.launch.py create mode 100644 launch/localization_launch.py create mode 100644 launch/navigation_launch.py create mode 100644 launch/online_async_launch.py rename worlds/{obstacle.sdf => obstacle.world} (100%) diff --git a/config/joystick.yaml b/config/joystick.yaml new file mode 100644 index 0000000..6f994fd --- /dev/null +++ b/config/joystick.yaml @@ -0,0 +1,27 @@ +joy_node: + ros__parameters: + device_id: 0 + deadzone: 0.05 + autorepeat_rate: 20.0 + +teleop_node: + ros__parameters: + axis_linear: + x: 1 + scale_linear: + x: 0.5 + scale_linear_turbo: + x: 1.0 + + axis_angular: + yaw: 0 + scale_angular: + yaw: 0.5 + scale_angular_turbo: + yaw: 1.0 + + + enable_button: 6 + enable_turbo_button: 7 + + require_enable_button: true \ No newline at end of file diff --git a/config/map.rviz b/config/map.rviz new file mode 100644 index 0000000..550255f --- /dev/null +++ b/config/map.rviz @@ -0,0 +1,338 @@ +Panels: + - Class: rviz_common/Displays + Help Height: 78 + Name: Displays + Property Tree Widget: + Expanded: ~ + Splitter Ratio: 0.5 + Tree Height: 468 + - Class: rviz_common/Selection + Name: Selection + - Class: rviz_common/Tool Properties + Expanded: + - /2D Goal Pose1 + - /Publish Point1 + Name: Tool Properties + Splitter Ratio: 0.5886790156364441 + - Class: rviz_common/Views + Expanded: + - /Current View1 + Name: Views + Splitter Ratio: 0.5 + - Class: rviz_common/Time + Experimental: false + Name: Time + SyncMode: 0 + SyncSource: LaserScan +Visualization Manager: + Class: "" + Displays: + - Alpha: 0.5 + Cell Size: 1 + Class: rviz_default_plugins/Grid + Color: 160; 160; 164 + Enabled: true + Line Style: + Line Width: 0.029999999329447746 + Value: Lines + Name: Grid + Normal Cell Count: 0 + Offset: + X: 0 + Y: 0 + Z: 0 + Plane: XY + Plane Cell Count: 10 + Reference Frame: + Value: true + - Class: rviz_default_plugins/TF + Enabled: true + Filter (blacklist): "" + Filter (whitelist): "" + Frame Timeout: 15 + Frames: + All Enabled: true + back_caster_wheel_one: + Value: true + base_footprint: + Value: true + base_link: + Value: true + camera_link: + Value: true + camera_link_optical: + Value: true + chassis: + Value: true + front_caster_wheel_one: + Value: true + laser_frame: + Value: true + left_wheel: + Value: true + map: + Value: true + odom: + Value: true + right_wheel: + Value: true + Marker Scale: 1 + Name: TF + Show Arrows: true + Show Axes: true + Show Names: false + Tree: + map: + {} + odom: + base_link: + base_footprint: + {} + chassis: + back_caster_wheel_one: + {} + camera_link: + camera_link_optical: + {} + front_caster_wheel_one: + {} + laser_frame: + {} + left_wheel: + {} + right_wheel: + {} + Update Interval: 0 + Value: true + - Alpha: 1 + Class: rviz_default_plugins/RobotModel + Collision Enabled: false + Description File: "" + Description Source: Topic + Description Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /robot_description + Enabled: true + Links: + All Links Enabled: true + Expand Joint Details: false + Expand Link Details: false + Expand Tree: false + Link Tree Style: Links in Alphabetic Order + back_caster_wheel_one: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + base_footprint: + Alpha: 1 + Show Axes: false + Show Trail: false + base_link: + Alpha: 1 + Show Axes: false + Show Trail: false + camera_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + camera_link_optical: + Alpha: 1 + Show Axes: false + Show Trail: false + chassis: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + front_caster_wheel_one: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + laser_frame: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + left_wheel: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + right_wheel: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + Mass Properties: + Inertia: false + Mass: false + Name: RobotModel + TF Prefix: "" + Update Interval: 0 + Value: true + Visual Enabled: true + - Class: rviz_default_plugins/Camera + Enabled: true + Far Plane Distance: 100 + Image Rendering: background and overlay + Name: Camera + Overlay Alpha: 0.5 + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /camera/image_raw + Value: true + Visibility: + Grid: true + LaserScan: true + Map: true + RobotModel: true + TF: true + Value: true + Zoom Factor: 1 + - Alpha: 1 + Autocompute Intensity Bounds: true + Autocompute Value Bounds: + Max Value: 10 + Min Value: -10 + Value: true + Axis: Z + Channel Name: intensity + Class: rviz_default_plugins/LaserScan + Color: 255; 255; 255 + Color Transformer: Intensity + Decay Time: 0 + Enabled: true + Invert Rainbow: false + Max Color: 255; 255; 255 + Max Intensity: 0 + Min Color: 0; 0; 0 + Min Intensity: 0 + Name: LaserScan + Position Transformer: XYZ + Selectable: true + Size (Pixels): 5 + Size (m): 0.05000000074505806 + Style: Points + Topic: + Depth: 5 + Durability Policy: Volatile + Filter size: 10 + History Policy: Keep Last + Reliability Policy: Reliable + Value: /scan + Use Fixed Frame: true + Use rainbow: true + Value: true + - Alpha: 0.699999988079071 + Binary representation: false + Binary threshold: 100 + Class: rviz_default_plugins/Map + Color Scheme: map + Draw Behind: false + Enabled: true + Name: Map + Topic: + Depth: 5 + Durability Policy: Volatile + Filter size: 10 + History Policy: Keep Last + Reliability Policy: Reliable + Value: /map + Update Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /map_updates + Use Timestamp: false + Value: true + Enabled: true + Global Options: + Background Color: 48; 48; 48 + Fixed Frame: map + Frame Rate: 30 + Name: root + Tools: + - Class: rviz_default_plugins/Interact + Hide Inactive Objects: true + - Class: rviz_default_plugins/MoveCamera + - Class: rviz_default_plugins/Select + - Class: rviz_default_plugins/FocusCamera + - Class: rviz_default_plugins/Measure + Line color: 128; 128; 0 + - Class: rviz_default_plugins/SetInitialPose + Covariance x: 0.25 + Covariance y: 0.25 + Covariance yaw: 0.06853891909122467 + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /initialpose + - Class: rviz_default_plugins/SetGoal + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /goal_pose + - Class: rviz_default_plugins/PublishPoint + Single click: true + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /clicked_point + Transformation: + Current: + Class: rviz_default_plugins/TF + Value: true + Views: + Current: + Angle: -1.634999394416809 + Class: rviz_default_plugins/TopDownOrtho + Enable Stereo Rendering: + Stereo Eye Separation: 0.05999999865889549 + Stereo Focal Distance: 1 + Swap Stereo Eyes: false + Value: false + Invert Z Axis: false + Name: Current View + Near Clip Distance: 0.009999999776482582 + Scale: 96.46293640136719 + Target Frame: + Value: TopDownOrtho (rviz_default_plugins) + X: -0.37073683738708496 + Y: -0.9538456797599792 + Saved: ~ +Window Geometry: + Camera: + collapsed: false + Displays: + collapsed: false + Height: 1011 + Hide Left Dock: false + Hide Right Dock: false + QMainWindow State: 000000ff00000000fd00000004000000000000019000000351fc0200000009fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005d00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003f00000262000000cc00fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb0000000c00430061006d00650072006101000002a7000000e90000001700ffffff000000010000010f00000351fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000003f00000351000000a900fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e100000197000000030000073a0000003efc0100000002fb0000000800540069006d006501000000000000073a0000026f00fffffffb0000000800540069006d006501000000000000045000000000000000000000048f0000035100000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 + Selection: + collapsed: false + Time: + collapsed: false + Tool Properties: + collapsed: false + Views: + collapsed: false + Width: 1850 + X: 70 + Y: 32 diff --git a/config/mapper_params_online_async.yaml b/config/mapper_params_online_async.yaml new file mode 100644 index 0000000..0a86719 --- /dev/null +++ b/config/mapper_params_online_async.yaml @@ -0,0 +1,73 @@ +slam_toolbox: + ros__parameters: + + # Plugin params + solver_plugin: solver_plugins::CeresSolver + ceres_linear_solver: SPARSE_NORMAL_CHOLESKY + ceres_preconditioner: SCHUR_JACOBI + ceres_trust_strategy: LEVENBERG_MARQUARDT + ceres_dogleg_type: TRADITIONAL_DOGLEG + ceres_loss_function: None + + # ROS Parameters + odom_frame: odom + map_frame: map + base_frame: base_link + scan_topic: /scan + mode: mapping + + # if you'd like to immediately start continuing a map at a given pose + # or at the dock, but they are mutually exclusive, if pose is given + # will use pose + map_file_name: /home/atharv/Desktop/dev_Ws/my_map_serial + # map_start_pose: [0.0, 0.0, 0.0] + map_start_at_dock: true + + debug_logging: false + throttle_scans: 1 + transform_publish_period: 0.02 #if 0 never publishes odometry + map_update_interval: 5.0 + resolution: 0.05 + max_laser_range: 20.0 #for rastering images + minimum_time_interval: 0.5 + transform_timeout: 0.2 + tf_buffer_duration: 30. + stack_size_to_use: 40000000 #// program needs a larger stack size to serialize large maps + enable_interactive_mode: true + + # General Parameters + use_scan_matching: true + use_scan_barycenter: true + minimum_travel_distance: 0.5 + minimum_travel_heading: 0.5 + scan_buffer_size: 10 + scan_buffer_maximum_scan_distance: 10.0 + link_match_minimum_response_fine: 0.1 + link_scan_maximum_distance: 1.5 + loop_search_maximum_distance: 3.0 + do_loop_closing: true + loop_match_minimum_chain_size: 10 + loop_match_maximum_variance_coarse: 3.0 + loop_match_minimum_response_coarse: 0.35 + loop_match_minimum_response_fine: 0.45 + + # Correlation Parameters - Correlation Parameters + correlation_search_space_dimension: 0.5 + correlation_search_space_resolution: 0.01 + correlation_search_space_smear_deviation: 0.1 + + # Correlation Parameters - Loop Closure Parameters + loop_search_space_dimension: 8.0 + loop_search_space_resolution: 0.05 + loop_search_space_smear_deviation: 0.03 + + # Scan Matcher Parameters + distance_variance_penalty: 0.5 + angle_variance_penalty: 1.0 + + fine_search_angle_offset: 0.00349 + coarse_search_angle_offset: 0.349 + coarse_angle_resolution: 0.0349 + minimum_angle_penalty: 0.9 + minimum_distance_penalty: 0.5 + use_response_expansion: true diff --git a/config/nav.rviz b/config/nav.rviz new file mode 100644 index 0000000..90cb2f9 --- /dev/null +++ b/config/nav.rviz @@ -0,0 +1,361 @@ +Panels: + - Class: rviz_common/Displays + Help Height: 78 + Name: Displays + Property Tree Widget: + Expanded: + - /Map2 + Splitter Ratio: 0.5 + Tree Height: 468 + - Class: rviz_common/Selection + Name: Selection + - Class: rviz_common/Tool Properties + Expanded: + - /2D Goal Pose1 + - /Publish Point1 + Name: Tool Properties + Splitter Ratio: 0.5886790156364441 + - Class: rviz_common/Views + Expanded: + - /Current View1 + Name: Views + Splitter Ratio: 0.5 + - Class: rviz_common/Time + Experimental: false + Name: Time + SyncMode: 0 + SyncSource: LaserScan +Visualization Manager: + Class: "" + Displays: + - Alpha: 0.5 + Cell Size: 1 + Class: rviz_default_plugins/Grid + Color: 160; 160; 164 + Enabled: true + Line Style: + Line Width: 0.029999999329447746 + Value: Lines + Name: Grid + Normal Cell Count: 0 + Offset: + X: 0 + Y: 0 + Z: 0 + Plane: XY + Plane Cell Count: 10 + Reference Frame: + Value: true + - Class: rviz_default_plugins/TF + Enabled: true + Filter (blacklist): "" + Filter (whitelist): "" + Frame Timeout: 15 + Frames: + All Enabled: true + back_caster_wheel_one: + Value: true + base_footprint: + Value: true + base_link: + Value: true + camera_link: + Value: true + camera_link_optical: + Value: true + chassis: + Value: true + front_caster_wheel_one: + Value: true + laser_frame: + Value: true + left_wheel: + Value: true + map: + Value: true + odom: + Value: true + right_wheel: + Value: true + Marker Scale: 1 + Name: TF + Show Arrows: true + Show Axes: true + Show Names: false + Tree: + map: + odom: + base_link: + base_footprint: + {} + chassis: + back_caster_wheel_one: + {} + camera_link: + camera_link_optical: + {} + front_caster_wheel_one: + {} + laser_frame: + {} + left_wheel: + {} + right_wheel: + {} + Update Interval: 0 + Value: true + - Alpha: 1 + Class: rviz_default_plugins/RobotModel + Collision Enabled: false + Description File: "" + Description Source: Topic + Description Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /robot_description + Enabled: true + Links: + All Links Enabled: true + Expand Joint Details: false + Expand Link Details: false + Expand Tree: false + Link Tree Style: Links in Alphabetic Order + back_caster_wheel_one: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + base_footprint: + Alpha: 1 + Show Axes: false + Show Trail: false + base_link: + Alpha: 1 + Show Axes: false + Show Trail: false + camera_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + camera_link_optical: + Alpha: 1 + Show Axes: false + Show Trail: false + chassis: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + front_caster_wheel_one: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + laser_frame: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + left_wheel: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + right_wheel: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + Mass Properties: + Inertia: false + Mass: false + Name: RobotModel + TF Prefix: "" + Update Interval: 0 + Value: true + Visual Enabled: true + - Class: rviz_default_plugins/Camera + Enabled: true + Far Plane Distance: 100 + Image Rendering: background and overlay + Name: Camera + Overlay Alpha: 0.5 + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /camera/image_raw + Value: true + Visibility: + Grid: true + LaserScan: true + Map: true + RobotModel: true + TF: true + Value: true + Zoom Factor: 1 + - Alpha: 1 + Autocompute Intensity Bounds: true + Autocompute Value Bounds: + Max Value: 10 + Min Value: -10 + Value: true + Axis: Z + Channel Name: intensity + Class: rviz_default_plugins/LaserScan + Color: 255; 255; 255 + Color Transformer: Intensity + Decay Time: 0 + Enabled: true + Invert Rainbow: false + Max Color: 255; 255; 255 + Max Intensity: 0 + Min Color: 0; 0; 0 + Min Intensity: 0 + Name: LaserScan + Position Transformer: XYZ + Selectable: true + Size (Pixels): 5 + Size (m): 0.05000000074505806 + Style: Points + Topic: + Depth: 5 + Durability Policy: Volatile + Filter size: 10 + History Policy: Keep Last + Reliability Policy: Reliable + Value: /scan + Use Fixed Frame: true + Use rainbow: true + Value: true + - Alpha: 0.699999988079071 + Binary representation: false + Binary threshold: 100 + Class: rviz_default_plugins/Map + Color Scheme: map + Draw Behind: false + Enabled: true + Name: Map + Topic: + Depth: 5 + Durability Policy: Volatile + Filter size: 10 + History Policy: Keep Last + Reliability Policy: Reliable + Value: /map + Update Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /map_updates + Use Timestamp: false + Value: true + - Alpha: 0.699999988079071 + Binary representation: false + Binary threshold: 100 + Class: rviz_default_plugins/Map + Color Scheme: costmap + Draw Behind: false + Enabled: true + Name: Map + Topic: + Depth: 5 + Durability Policy: Volatile + Filter size: 10 + History Policy: Keep Last + Reliability Policy: Reliable + Value: /global_costmap/costmap + Update Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /global_costmap/costmap_updates + Use Timestamp: false + Value: true + Enabled: true + Global Options: + Background Color: 48; 48; 48 + Fixed Frame: map + Frame Rate: 30 + Name: root + Tools: + - Class: rviz_default_plugins/Interact + Hide Inactive Objects: true + - Class: rviz_default_plugins/MoveCamera + - Class: rviz_default_plugins/Select + - Class: rviz_default_plugins/FocusCamera + - Class: rviz_default_plugins/Measure + Line color: 128; 128; 0 + - Class: rviz_default_plugins/SetInitialPose + Covariance x: 0.25 + Covariance y: 0.25 + Covariance yaw: 0.06853891909122467 + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /initialpose + - Class: rviz_default_plugins/SetGoal + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /goal_pose + - Class: rviz_default_plugins/PublishPoint + Single click: true + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /clicked_point + Transformation: + Current: + Class: rviz_default_plugins/TF + Value: true + Views: + Current: + Angle: -1.4450000524520874 + Class: rviz_default_plugins/TopDownOrtho + Enable Stereo Rendering: + Stereo Eye Separation: 0.05999999865889549 + Stereo Focal Distance: 1 + Swap Stereo Eyes: false + Value: false + Invert Z Axis: false + Name: Current View + Near Clip Distance: 0.009999999776482582 + Scale: 104.19364929199219 + Target Frame: + Value: TopDownOrtho (rviz_default_plugins) + X: 1.3529088497161865 + Y: -1.6902755498886108 + Saved: ~ +Window Geometry: + Camera: + collapsed: false + Displays: + collapsed: false + Height: 1011 + Hide Left Dock: false + Hide Right Dock: false + QMainWindow State: 000000ff00000000fd00000004000000000000019000000351fc0200000009fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005d00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003f00000262000000cc00fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb0000000c00430061006d00650072006101000002a7000000e90000001700ffffff000000010000010f00000351fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000003f00000351000000a900fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e100000197000000030000073a0000003efc0100000002fb0000000800540069006d006501000000000000073a0000026f00fffffffb0000000800540069006d006501000000000000045000000000000000000000048f0000035100000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 + Selection: + collapsed: false + Time: + collapsed: false + Tool Properties: + collapsed: false + Views: + collapsed: false + Width: 1850 + X: 70 + Y: 32 diff --git a/config/nav2_params_clean.yaml b/config/nav2_params_clean.yaml new file mode 100644 index 0000000..8d3edcb --- /dev/null +++ b/config/nav2_params_clean.yaml @@ -0,0 +1,470 @@ +amcl: + ros__parameters: + alpha1: 0.2 + alpha2: 0.2 + alpha3: 0.2 + alpha4: 0.2 + alpha5: 0.2 + base_frame_id: "base_link" + beam_skip_distance: 0.5 + beam_skip_error_threshold: 0.9 + beam_skip_threshold: 0.3 + do_beamskip: false + global_frame_id: "map" + lambda_short: 0.1 + laser_likelihood_max_dist: 2.0 + laser_max_range: 100.0 + laser_min_range: -1.0 + laser_model_type: "likelihood_field" + max_beams: 60 + max_particles: 2000 + min_particles: 500 + odom_frame_id: "odom" + pf_err: 0.05 + pf_z: 0.99 + recovery_alpha_fast: 0.0 + recovery_alpha_slow: 0.0 + resample_interval: 1 + robot_model_type: "nav2_amcl::DifferentialMotionModel" + save_pose_rate: 0.5 + sigma_hit: 0.2 + tf_broadcast: true + transform_tolerance: 1.0 + update_min_a: 0.2 + update_min_d: 0.25 + z_hit: 0.5 + z_max: 0.05 + z_rand: 0.5 + z_short: 0.05 + scan_topic: scan + +bt_navigator: + ros__parameters: + global_frame: map + robot_base_frame: base_link + odom_topic: /odom + bt_loop_duration: 10 + default_server_timeout: 20 + wait_for_service_timeout: 1000 + action_server_result_timeout: 900.0 + navigators: ["navigate_to_pose", "navigate_through_poses"] + navigate_to_pose: + plugin: "nav2_bt_navigator::NavigateToPoseNavigator" + navigate_through_poses: + plugin: "nav2_bt_navigator::NavigateThroughPosesNavigator" + # 'default_nav_through_poses_bt_xml' and 'default_nav_to_pose_bt_xml' are use defaults: + # nav2_bt_navigator/navigate_to_pose_w_replanning_and_recovery.xml + # nav2_bt_navigator/navigate_through_poses_w_replanning_and_recovery.xml + # They can be set here or via a RewrittenYaml remap from a parent launch file to Nav2. + + # plugin_lib_names is used to add custom BT plugins to the executor (vector of strings). + # Built-in plugins are added automatically + # plugin_lib_names: [] + + error_code_names: + - compute_path_error_code + - follow_path_error_code + +controller_server: + ros__parameters: + controller_frequency: 20.0 + costmap_update_timeout: 0.30 + min_x_velocity_threshold: 0.001 + min_y_velocity_threshold: 0.5 + min_theta_velocity_threshold: 0.001 + failure_tolerance: 0.3 + progress_checker_plugins: ["progress_checker"] + goal_checker_plugins: ["general_goal_checker"] # "precise_goal_checker" + controller_plugins: ["FollowPath"] + use_realtime_priority: false + + # Progress checker parameters + progress_checker: + plugin: "nav2_controller::SimpleProgressChecker" + required_movement_radius: 0.5 + movement_time_allowance: 10.0 + # Goal checker parameters + #precise_goal_checker: + # plugin: "nav2_controller::SimpleGoalChecker" + # xy_goal_tolerance: 0.25 + # yaw_goal_tolerance: 0.25 + # stateful: True + general_goal_checker: + stateful: True + plugin: "nav2_controller::SimpleGoalChecker" + xy_goal_tolerance: 0.25 + yaw_goal_tolerance: 0.25 + FollowPath: + plugin: "nav2_mppi_controller::MPPIController" + time_steps: 56 + model_dt: 0.05 + batch_size: 2000 + ax_max: 3.0 + ax_min: -3.0 + ay_max: 3.0 + ay_min: -3.0 + az_max: 3.5 + vx_std: 0.2 + vy_std: 0.2 + wz_std: 0.4 + vx_max: 0.5 + vx_min: -0.35 + vy_max: 0.5 + wz_max: 1.9 + iteration_count: 1 + prune_distance: 1.7 + transform_tolerance: 0.1 + temperature: 0.3 + gamma: 0.015 + motion_model: "DiffDrive" + visualize: true + regenerate_noises: true + TrajectoryVisualizer: + trajectory_step: 5 + time_step: 3 + AckermannConstraints: + min_turning_r: 0.2 + critics: [ + "ConstraintCritic", "CostCritic", "GoalCritic", + "GoalAngleCritic", "PathAlignCritic", "PathFollowCritic", + "PathAngleCritic", "PreferForwardCritic"] + ConstraintCritic: + enabled: true + cost_power: 1 + cost_weight: 4.0 + GoalCritic: + enabled: true + cost_power: 1 + cost_weight: 5.0 + threshold_to_consider: 1.4 + GoalAngleCritic: + enabled: true + cost_power: 1 + cost_weight: 3.0 + threshold_to_consider: 0.5 + PreferForwardCritic: + enabled: true + cost_power: 1 + cost_weight: 5.0 + threshold_to_consider: 0.5 + CostCritic: + enabled: true + cost_power: 1 + cost_weight: 3.81 + near_collision_cost: 253 + critical_cost: 300.0 + consider_footprint: false + collision_cost: 1000000.0 + near_goal_distance: 1.0 + trajectory_point_step: 2 + PathAlignCritic: + enabled: true + cost_power: 1 + cost_weight: 14.0 + max_path_occupancy_ratio: 0.05 + trajectory_point_step: 4 + threshold_to_consider: 0.5 + offset_from_furthest: 20 + use_path_orientations: false + PathFollowCritic: + enabled: true + cost_power: 1 + cost_weight: 5.0 + offset_from_furthest: 5 + threshold_to_consider: 1.4 + PathAngleCritic: + enabled: true + cost_power: 1 + cost_weight: 2.0 + offset_from_furthest: 4 + threshold_to_consider: 0.5 + max_angle_to_furthest: 1.0 + mode: 0 + # TwirlingCritic: + # enabled: true + # twirling_cost_power: 1 + # twirling_cost_weight: 10.0 + +local_costmap: + local_costmap: + ros__parameters: + update_frequency: 5.0 + publish_frequency: 2.0 + global_frame: odom + robot_base_frame: base_link + rolling_window: true + width: 3 + height: 3 + resolution: 0.05 + robot_radius: 0.22 + plugins: ["voxel_layer", "inflation_layer"] + inflation_layer: + plugin: "nav2_costmap_2d::InflationLayer" + cost_scaling_factor: 3.0 + inflation_radius: 0.70 + voxel_layer: + plugin: "nav2_costmap_2d::VoxelLayer" + enabled: True + publish_voxel_map: True + origin_z: 0.0 + z_resolution: 0.05 + z_voxels: 16 + max_obstacle_height: 2.0 + mark_threshold: 0 + observation_sources: scan + scan: + topic: /scan + max_obstacle_height: 2.0 + clearing: True + marking: True + data_type: "LaserScan" + raytrace_max_range: 3.0 + raytrace_min_range: 0.0 + obstacle_max_range: 2.5 + obstacle_min_range: 0.0 + static_layer: + plugin: "nav2_costmap_2d::StaticLayer" + map_subscribe_transient_local: True + always_send_full_costmap: True + +global_costmap: + global_costmap: + ros__parameters: + update_frequency: 1.0 + publish_frequency: 1.0 + global_frame: map + robot_base_frame: base_link + robot_radius: 0.22 + resolution: 0.05 + track_unknown_space: true + plugins: ["static_layer", "obstacle_layer", "inflation_layer"] + obstacle_layer: + plugin: "nav2_costmap_2d::ObstacleLayer" + enabled: True + observation_sources: scan + scan: + topic: /scan + max_obstacle_height: 2.0 + clearing: True + marking: True + data_type: "LaserScan" + raytrace_max_range: 3.0 + raytrace_min_range: 0.0 + obstacle_max_range: 2.5 + obstacle_min_range: 0.0 + static_layer: + plugin: "nav2_costmap_2d::StaticLayer" + map_subscribe_transient_local: True + inflation_layer: + plugin: "nav2_costmap_2d::InflationLayer" + cost_scaling_factor: 3.0 + inflation_radius: 0.7 + always_send_full_costmap: True + +# The yaml_filename does not need to be specified since it going to be set by defaults in launch. +# If you'd rather set it in the yaml, remove the default "map" value in the tb3_simulation_launch.py +# file & provide full path to map below. If CLI map configuration or launch default is provided, that will be used. +# map_server: +# ros__parameters: +# yaml_filename: "" + +map_saver: + ros__parameters: + save_map_timeout: 5.0 + free_thresh_default: 0.25 + occupied_thresh_default: 0.65 + map_subscribe_transient_local: True + +planner_server: + ros__parameters: + expected_planner_frequency: 20.0 + planner_plugins: ["GridBased"] + costmap_update_timeout: 1.0 + GridBased: + plugin: "nav2_navfn_planner::NavfnPlanner" + tolerance: 0.5 + use_astar: false + allow_unknown: true + +smoother_server: + ros__parameters: + smoother_plugins: ["simple_smoother"] + simple_smoother: + plugin: "nav2_smoother::SimpleSmoother" + tolerance: 1.0e-10 + max_its: 1000 + do_refinement: True + +behavior_server: + ros__parameters: + local_costmap_topic: local_costmap/costmap_raw + global_costmap_topic: global_costmap/costmap_raw + local_footprint_topic: local_costmap/published_footprint + global_footprint_topic: global_costmap/published_footprint + cycle_frequency: 10.0 + behavior_plugins: ["spin", "backup", "drive_on_heading", "assisted_teleop", "wait"] + spin: + plugin: "nav2_behaviors::Spin" + backup: + plugin: "nav2_behaviors::BackUp" + drive_on_heading: + plugin: "nav2_behaviors::DriveOnHeading" + wait: + plugin: "nav2_behaviors::Wait" + assisted_teleop: + plugin: "nav2_behaviors::AssistedTeleop" + local_frame: odom + global_frame: map + robot_base_frame: base_link + transform_tolerance: 0.1 + simulate_ahead_time: 2.0 + max_rotational_vel: 1.0 + min_rotational_vel: 0.4 + rotational_acc_lim: 3.2 + +waypoint_follower: + ros__parameters: + loop_rate: 20 + stop_on_failure: false + action_server_result_timeout: 900.0 + waypoint_task_executor_plugin: "wait_at_waypoint" + wait_at_waypoint: + plugin: "nav2_waypoint_follower::WaitAtWaypoint" + enabled: True + waypoint_pause_duration: 200 + +route_server: + ros__parameters: + # The graph_filepath does not need to be specified since it going to be set by defaults in launch. + # If you'd rather set it in the yaml, remove the default "graph" value in the launch file(s). + # file & provide full path to map below. If graph config or launch default is provided, it is used + # graph_filepath: $(find-pkg-share nav2_route)/graphs/aws_graph.geojson + boundary_radius_to_achieve_node: 1.0 + radius_to_achieve_node: 2.0 + smooth_corners: true + operations: ["AdjustSpeedLimit", "ReroutingService", "CollisionMonitor"] + ReroutingService: + plugin: "nav2_route::ReroutingService" + AdjustSpeedLimit: + plugin: "nav2_route::AdjustSpeedLimit" + CollisionMonitor: + plugin: "nav2_route::CollisionMonitor" + max_collision_dist: 3.0 + edge_cost_functions: ["DistanceScorer", "CostmapScorer"] + DistanceScorer: + plugin: "nav2_route::DistanceScorer" + CostmapScorer: + plugin: "nav2_route::CostmapScorer" + +velocity_smoother: + ros__parameters: + smoothing_frequency: 20.0 + stamp_smoothed_velocity_with_smoothing_time: False + scale_velocities: False + feedback: "OPEN_LOOP" + max_velocity: [0.5, 0.0, 2.0] + min_velocity: [-0.5, 0.0, -2.0] + max_accel: [2.5, 0.0, 3.2] + max_decel: [-2.5, 0.0, -3.2] + odom_topic: "odom" + odom_duration: 0.1 + deadband_velocity: [0.0, 0.0, 0.0] + velocity_timeout: 1.0 + +collision_monitor: + ros__parameters: + base_frame_id: "base_link" + odom_frame_id: "odom" + cmd_vel_in_topic: "cmd_vel_smoothed" + cmd_vel_out_topic: "cmd_vel" + state_topic: "collision_monitor_state" + transform_tolerance: 0.2 + source_timeout: 1.0 + base_shift_correction: True + stop_pub_timeout: 2.0 + # Polygons represent zone around the robot for "stop", "slowdown" and "limit" action types, + # and robot footprint for "approach" action type. + polygons: ["FootprintApproach"] + FootprintApproach: + type: "polygon" + action_type: "approach" + footprint_topic: "/local_costmap/published_footprint" + time_before_collision: 1.2 + simulation_time_step: 0.1 + min_points: 6 + visualize: False + enabled: True + observation_sources: ["scan"] + scan: + type: "scan" + topic: "scan" + min_height: 0.15 + max_height: 2.0 + enabled: True + +docking_server: + ros__parameters: + controller_frequency: 50.0 + initial_perception_timeout: 5.0 + wait_charge_timeout: 5.0 + dock_approach_timeout: 30.0 + undock_linear_tolerance: 0.05 + undock_angular_tolerance: 0.1 + max_retries: 3 + base_frame: "base_link" + fixed_frame: "odom" + dock_backwards: false + dock_prestaging_tolerance: 0.5 + + # Types of docks + dock_plugins: ['simple_charging_dock'] + simple_charging_dock: + plugin: 'opennav_docking::SimpleChargingDock' + docking_threshold: 0.05 + staging_x_offset: -0.7 + use_external_detection_pose: true + use_battery_status: false # true + use_stall_detection: false # true + + external_detection_timeout: 1.0 + external_detection_translation_x: -0.18 + external_detection_translation_y: 0.0 + external_detection_rotation_roll: -1.57 + external_detection_rotation_pitch: -1.57 + external_detection_rotation_yaw: 0.0 + filter_coef: 0.1 + + # Dock instances + # The following example illustrates configuring dock instances. + # docks: ['home_dock'] # Input your docks here + # home_dock: + # type: 'simple_charging_dock' + # frame: map + # pose: [0.0, 0.0, 0.0] + + controller: + k_phi: 3.0 + k_delta: 2.0 + v_linear_min: 0.15 + v_linear_max: 0.15 + use_collision_detection: true + costmap_topic: "local_costmap/costmap_raw" + footprint_topic: "local_costmap/published_footprint" + transform_tolerance: 0.1 + projection_time: 5.0 + simulation_step: 0.1 + dock_collision_threshold: 0.3 + +loopback_simulator: + ros__parameters: + base_frame_id: "base_link" + odom_frame_id: "odom" + map_frame_id: "map" + scan_frame_id: "base_scan" # tb4_loopback_simulator.launch.py remaps to 'rplidar_link' + update_duration: 0.02 + scan_range_min: 0.05 + scan_range_max: 30.0 + scan_angle_min: -3.1415 + scan_angle_max: 3.1415 + scan_angle_increment: 0.02617 + scan_use_inf: true diff --git a/config/twist_mux.yaml b/config/twist_mux.yaml new file mode 100644 index 0000000..97411fc --- /dev/null +++ b/config/twist_mux.yaml @@ -0,0 +1,15 @@ +twist_mux: + ros__parameters: + topics: + navigation: + topic : cmd_vel + timeout : 0.5 + priority: 10 + tracker: + topic : cmd_vel_tracker + timeout : 0.5 + priority: 20 + joystick: + topic : cmd_vel_joy + timeout : 0.5 + priority: 100 \ No newline at end of file diff --git a/description/camera.xacro b/description/camera.xacro index 59ac017..de4a397 100644 --- a/description/camera.xacro +++ b/description/camera.xacro @@ -28,7 +28,7 @@ - Gazebo/Black + Gazebo/Red 0 0 0 0 0 0 diff --git a/description/gazebo_control.xacro b/description/gazebo_control.xacro index 8df320f..2d5bd93 100644 --- a/description/gazebo_control.xacro +++ b/description/gazebo_control.xacro @@ -7,8 +7,8 @@ left_wheel_joint right_wheel_joint - 0.297 - 0.033 + 0.18 + 0.035 diff --git a/launch/joystick.launch.py b/launch/joystick.launch.py new file mode 100644 index 0000000..35bf401 --- /dev/null +++ b/launch/joystick.launch.py @@ -0,0 +1,45 @@ +from launch import LaunchDescription +from launch_ros.actions import Node +from launch.substitutions import LaunchConfiguration +from launch.actions import DeclareLaunchArgument + +import os +from ament_index_python.packages import get_package_share_directory + +def generate_launch_description(): + use_sim_time = LaunchConfiguration('use_sim_time') + + joy_params = os.path.join(get_package_share_directory('articubot_two'),'config','joystick.yaml') + + joy_node = Node( + package='joy', + executable='joy_node', + parameters=[joy_params, {'use_sim_time': use_sim_time}], + ) + + teleop_node = Node( + package='teleop_twist_joy', + executable='teleop_node', + name='teleop_node', + parameters=[joy_params, {'use_sim_time': use_sim_time}], + remappings=[('/cmd_vel','/cmd_vel_joy')] + ) + + twist_stamper = Node( + package='twist_stamper', + executable='twist_stamper', + parameters=[{'use_sim_time': use_sim_time}], + remappings=[('/cmd_vel_in','/diff_cont/cmd_vel_unstamped'), + ('/cmd_vel_out','/diff_cont/cmd_vel')] + ) + + + return LaunchDescription([ + DeclareLaunchArgument( + 'use_sim_time', + default_value='false', + description='Use sim time if true'), + joy_node, + teleop_node, + twist_stamper + ]) \ No newline at end of file diff --git a/launch/launch_sim.launch.py b/launch/launch_sim.launch.py index 399df0c..36ce82c 100644 --- a/launch/launch_sim.launch.py +++ b/launch/launch_sim.launch.py @@ -101,30 +101,11 @@ def generate_launch_description(): ) - - # Code for delaying a node (I haven't tested how effective it is) - # - # First add the below lines to imports - # from launch.actions import RegisterEventHandler - # from launch.event_handlers import OnProcessExit - # - # Then add the following below the current diff_drive_spawner - # delayed_diff_drive_spawner = RegisterEventHandler( - # event_handler=OnProcessExit( - # target_action=spawn_entity, - # on_exit=[diff_drive_spawner], - # ) - # ) - # - # Replace the diff_drive_spawner in the final return with delayed_diff_drive_spawner - - - # Launch them all! return LaunchDescription([ rsp, - #joystick, - #twist_mux, + joystick, + twist_mux, world_arg, gazebo, spawn_entity, diff --git a/launch/localization_launch.py b/launch/localization_launch.py new file mode 100644 index 0000000..558c5ec --- /dev/null +++ b/launch/localization_launch.py @@ -0,0 +1,107 @@ +# Copyright (c) 2018 Intel Corporation +# +# 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 ament_index_python.packages import get_package_share_directory + +from launch import LaunchDescription +from launch.actions import DeclareLaunchArgument, SetEnvironmentVariable +from launch.substitutions import LaunchConfiguration +from launch_ros.actions import Node +from nav2_common.launch import RewrittenYaml + + +def generate_launch_description(): + # Get the launch directory + bringup_dir = get_package_share_directory('articubot_two') + + namespace = LaunchConfiguration('namespace') + map_yaml_file = LaunchConfiguration('map') + use_sim_time = LaunchConfiguration('use_sim_time') + autostart = LaunchConfiguration('autostart') + params_file = LaunchConfiguration('params_file') + lifecycle_nodes = ['map_server', 'amcl'] + + # Map fully qualified names to relative ones so the node's namespace can be prepended. + # In case of the transforms (tf), currently, there doesn't seem to be a better alternative + # https://github.com/ros/geometry2/issues/32 + # https://github.com/ros/robot_state_publisher/pull/30 + # TODO(orduno) Substitute with `PushNodeRemapping` + # https://github.com/ros2/launch_ros/issues/56 + remappings = [('/tf', 'tf'), + ('/tf_static', 'tf_static')] + + # Create our own temporary YAML files that include substitutions + param_substitutions = { + 'use_sim_time': use_sim_time, + 'yaml_filename': map_yaml_file} + + configured_params = RewrittenYaml( + source_file=params_file, + root_key=namespace, + param_rewrites=param_substitutions, + convert_types=True) + + return LaunchDescription([ + # Set env var to print messages to stdout immediately + SetEnvironmentVariable('RCUTILS_LOGGING_BUFFERED_STREAM', '1'), + + DeclareLaunchArgument( + 'namespace', default_value='', + description='Top-level namespace'), + + DeclareLaunchArgument( + 'map', + default_value=os.path.join(bringup_dir, 'maps', 'turtlebot3_world.yaml'), + description='Full path to map yaml file to load'), + + DeclareLaunchArgument( + 'use_sim_time', default_value='false', + description='Use simulation (Gazebo) clock if true'), + + DeclareLaunchArgument( + 'autostart', default_value='true', + description='Automatically startup the nav2 stack'), + + DeclareLaunchArgument( + 'params_file', + default_value=os.path.join(bringup_dir, 'config', 'nav2_params.yaml'), + description='Full path to the ROS2 parameters file to use'), + + Node( + package='nav2_map_server', + executable='map_server', + name='map_server', + output='screen', + parameters=[configured_params], + remappings=remappings), + + Node( + package='nav2_amcl', + executable='amcl', + name='amcl', + output='screen', + parameters=[configured_params], + remappings=remappings), + + Node( + package='nav2_lifecycle_manager', + executable='lifecycle_manager', + name='lifecycle_manager_localization', + output='screen', + parameters=[{'use_sim_time': use_sim_time}, + {'autostart': autostart}, + {'node_names': lifecycle_nodes}]) + ]) diff --git a/launch/navigation_launch.py b/launch/navigation_launch.py new file mode 100644 index 0000000..2d6f93e --- /dev/null +++ b/launch/navigation_launch.py @@ -0,0 +1,367 @@ +# Copyright (c) 2018 Intel Corporation +# +# 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 ament_index_python.packages import get_package_share_directory + +from launch import LaunchDescription +from launch.actions import DeclareLaunchArgument, GroupAction, SetEnvironmentVariable +from launch.conditions import IfCondition +from launch.substitutions import LaunchConfiguration, PythonExpression +from launch_ros.actions import LoadComposableNodes, SetParameter +from launch_ros.actions import Node +from launch_ros.descriptions import ComposableNode, ParameterFile +from nav2_common.launch import RewrittenYaml + + +def generate_launch_description(): + # Get the launch directory + bringup_dir = get_package_share_directory('nav2_bringup') + + namespace = LaunchConfiguration('namespace') + use_sim_time = LaunchConfiguration('use_sim_time') + autostart = LaunchConfiguration('autostart') + params_file = LaunchConfiguration('params_file') + use_composition = LaunchConfiguration('use_composition') + container_name = LaunchConfiguration('container_name') + container_name_full = (namespace, '/', container_name) + use_respawn = LaunchConfiguration('use_respawn') + log_level = LaunchConfiguration('log_level') + + lifecycle_nodes = [ + 'controller_server', + 'smoother_server', + 'planner_server', + 'route_server', + 'behavior_server', + 'velocity_smoother', + 'collision_monitor', + 'bt_navigator', + 'waypoint_follower', + 'docking_server', + ] + + # Map fully qualified names to relative ones so the node's namespace can be prepended. + # In case of the transforms (tf), currently, there doesn't seem to be a better alternative + # https://github.com/ros/geometry2/issues/32 + # https://github.com/ros/robot_state_publisher/pull/30 + # TODO(orduno) Substitute with `PushNodeRemapping` + # https://github.com/ros2/launch_ros/issues/56 + remappings = [('/tf', 'tf'), ('/tf_static', 'tf_static')] + + # Create our own temporary YAML files that include substitutions + param_substitutions = {'autostart': autostart} + + configured_params = ParameterFile( + RewrittenYaml( + source_file=params_file, + root_key=namespace, + param_rewrites=param_substitutions, + convert_types=True, + ), + allow_substs=True, + ) + + stdout_linebuf_envvar = SetEnvironmentVariable( + 'RCUTILS_LOGGING_BUFFERED_STREAM', '1' + ) + + declare_namespace_cmd = DeclareLaunchArgument( + 'namespace', default_value='', description='Top-level namespace' + ) + + declare_use_sim_time_cmd = DeclareLaunchArgument( + 'use_sim_time', + default_value='false', + description='Use simulation (Gazebo) clock if true', + ) + + declare_params_file_cmd = DeclareLaunchArgument( + 'params_file', + default_value=os.path.join(bringup_dir, 'params', 'nav2_params.yaml'), + description='Full path to the ROS2 parameters file to use for all launched nodes', + ) + + declare_autostart_cmd = DeclareLaunchArgument( + 'autostart', + default_value='true', + description='Automatically startup the nav2 stack', + ) + + declare_use_composition_cmd = DeclareLaunchArgument( + 'use_composition', + default_value='False', + description='Use composed bringup if True', + ) + + declare_container_name_cmd = DeclareLaunchArgument( + 'container_name', + default_value='nav2_container', + description='the name of conatiner that nodes will load in if use composition', + ) + + declare_use_respawn_cmd = DeclareLaunchArgument( + 'use_respawn', + default_value='False', + description='Whether to respawn if a node crashes. Applied when composition is disabled.', + ) + + declare_log_level_cmd = DeclareLaunchArgument( + 'log_level', default_value='info', description='log level' + ) + + load_nodes = GroupAction( + condition=IfCondition(PythonExpression(['not ', use_composition])), + actions=[ + SetParameter('use_sim_time', use_sim_time), + Node( + package='nav2_controller', + executable='controller_server', + output='screen', + respawn=use_respawn, + respawn_delay=2.0, + parameters=[configured_params], + arguments=['--ros-args', '--log-level', log_level], + remappings=remappings + [('cmd_vel', 'cmd_vel_nav')], + ), + Node( + package='nav2_smoother', + executable='smoother_server', + name='smoother_server', + output='screen', + respawn=use_respawn, + respawn_delay=2.0, + parameters=[configured_params], + arguments=['--ros-args', '--log-level', log_level], + remappings=remappings, + ), + Node( + package='nav2_planner', + executable='planner_server', + name='planner_server', + output='screen', + respawn=use_respawn, + respawn_delay=2.0, + parameters=[configured_params], + arguments=['--ros-args', '--log-level', log_level], + remappings=remappings, + ), + Node( + package='nav2_route', + executable='route_server', + name='route_server', + output='screen', + respawn=use_respawn, + respawn_delay=2.0, + parameters=[configured_params], + arguments=['--ros-args', '--log-level', log_level], + remappings=remappings, + ), + Node( + package='nav2_behaviors', + executable='behavior_server', + name='behavior_server', + output='screen', + respawn=use_respawn, + respawn_delay=2.0, + parameters=[configured_params], + arguments=['--ros-args', '--log-level', log_level], + remappings=remappings + [('cmd_vel', 'cmd_vel_nav')], + ), + Node( + package='nav2_bt_navigator', + executable='bt_navigator', + name='bt_navigator', + output='screen', + respawn=use_respawn, + respawn_delay=2.0, + parameters=[configured_params], + arguments=['--ros-args', '--log-level', log_level], + remappings=remappings, + ), + Node( + package='nav2_waypoint_follower', + executable='waypoint_follower', + name='waypoint_follower', + output='screen', + respawn=use_respawn, + respawn_delay=2.0, + parameters=[configured_params], + arguments=['--ros-args', '--log-level', log_level], + remappings=remappings, + ), + Node( + package='nav2_velocity_smoother', + executable='velocity_smoother', + name='velocity_smoother', + output='screen', + respawn=use_respawn, + respawn_delay=2.0, + parameters=[configured_params], + arguments=['--ros-args', '--log-level', log_level], + remappings=remappings + + [('cmd_vel', 'cmd_vel_nav')], + ), + Node( + package='nav2_collision_monitor', + executable='collision_monitor', + name='collision_monitor', + output='screen', + respawn=use_respawn, + respawn_delay=2.0, + parameters=[configured_params], + arguments=['--ros-args', '--log-level', log_level], + remappings=remappings, + ), + Node( + package='opennav_docking', + executable='opennav_docking', + name='docking_server', + output='screen', + respawn=use_respawn, + respawn_delay=2.0, + parameters=[configured_params], + arguments=['--ros-args', '--log-level', log_level], + remappings=remappings, + ), + Node( + package='nav2_lifecycle_manager', + executable='lifecycle_manager', + name='lifecycle_manager_navigation', + output='screen', + arguments=['--ros-args', '--log-level', log_level], + parameters=[{'autostart': autostart}, {'node_names': lifecycle_nodes}], + ), + Node( + package='topic_tools', + executable='relay', + name='cmd_vel_relay', + output='screen', + arguments=['/cmd_vel', '/diff_cont/cmd_vel_unstamped'], + ), + ], + ) + + load_composable_nodes = GroupAction( + condition=IfCondition(use_composition), + actions=[ + SetParameter('use_sim_time', use_sim_time), + LoadComposableNodes( + target_container=container_name_full, + composable_node_descriptions=[ + ComposableNode( + package='nav2_controller', + plugin='nav2_controller::ControllerServer', + name='controller_server', + parameters=[configured_params], + remappings=remappings + [('cmd_vel', 'cmd_vel_nav')], + ), + ComposableNode( + package='nav2_smoother', + plugin='nav2_smoother::SmootherServer', + name='smoother_server', + parameters=[configured_params], + remappings=remappings, + ), + ComposableNode( + package='nav2_planner', + plugin='nav2_planner::PlannerServer', + name='planner_server', + parameters=[configured_params], + remappings=remappings, + ), + ComposableNode( + package='nav2_route', + plugin='nav2_route::RouteServer', + name='route_server', + parameters=[configured_params], + remappings=remappings, + ), + ComposableNode( + package='nav2_behaviors', + plugin='behavior_server::BehaviorServer', + name='behavior_server', + parameters=[configured_params], + remappings=remappings + [('cmd_vel', 'cmd_vel_nav')], + ), + ComposableNode( + package='nav2_bt_navigator', + plugin='nav2_bt_navigator::BtNavigator', + name='bt_navigator', + parameters=[configured_params], + remappings=remappings, + ), + ComposableNode( + package='nav2_waypoint_follower', + plugin='nav2_waypoint_follower::WaypointFollower', + name='waypoint_follower', + parameters=[configured_params], + remappings=remappings, + ), + ComposableNode( + package='nav2_velocity_smoother', + plugin='nav2_velocity_smoother::VelocitySmoother', + name='velocity_smoother', + parameters=[configured_params], + remappings=remappings + + [('cmd_vel', 'cmd_vel_nav')], + ), + ComposableNode( + package='nav2_collision_monitor', + plugin='nav2_collision_monitor::CollisionMonitor', + name='collision_monitor', + parameters=[configured_params], + remappings=remappings, + ), + ComposableNode( + package='opennav_docking', + plugin='opennav_docking::DockingServer', + name='docking_server', + parameters=[configured_params], + remappings=remappings, + ), + ComposableNode( + package='nav2_lifecycle_manager', + plugin='nav2_lifecycle_manager::LifecycleManager', + name='lifecycle_manager_navigation', + parameters=[ + {'autostart': autostart, 'node_names': lifecycle_nodes} + ], + ), + ], + ), + ], + ) + + # Create the launch description and populate + ld = LaunchDescription() + + # Set environment variables + ld.add_action(stdout_linebuf_envvar) + + # Declare the launch options + ld.add_action(declare_namespace_cmd) + ld.add_action(declare_use_sim_time_cmd) + ld.add_action(declare_params_file_cmd) + ld.add_action(declare_autostart_cmd) + ld.add_action(declare_use_composition_cmd) + ld.add_action(declare_container_name_cmd) + ld.add_action(declare_use_respawn_cmd) + ld.add_action(declare_log_level_cmd) + # Add the actions to launch all of the navigation nodes + ld.add_action(load_nodes) + ld.add_action(load_composable_nodes) + + return ld \ No newline at end of file diff --git a/launch/online_async_launch.py b/launch/online_async_launch.py new file mode 100644 index 0000000..d7dcf1a --- /dev/null +++ b/launch/online_async_launch.py @@ -0,0 +1,59 @@ +import os + +from launch import LaunchDescription +from launch.actions import DeclareLaunchArgument, LogInfo +from launch.conditions import UnlessCondition +from launch.substitutions import LaunchConfiguration, PythonExpression +from launch_ros.actions import Node +from ament_index_python.packages import get_package_share_directory +from nav2_common.launch import HasNodeParams + + +def generate_launch_description(): + use_sim_time = LaunchConfiguration('use_sim_time') + params_file = LaunchConfiguration('params_file') + default_params_file = os.path.join(get_package_share_directory("articubot_two"), + 'config', 'mapper_params_online_async.yaml') + + declare_use_sim_time_argument = DeclareLaunchArgument( + 'use_sim_time', + default_value='true', + description='Use simulation/Gazebo clock') + declare_params_file_cmd = DeclareLaunchArgument( + 'params_file', + default_value=default_params_file, + description='Full path to the ROS2 parameters file to use for the slam_toolbox node') + + # If the provided param file doesn't have slam_toolbox params, we must pass the + # default_params_file instead. This could happen due to automatic propagation of + # LaunchArguments. See: + # https://github.com/ros-planning/navigation2/pull/2243#issuecomment-800479866 + has_node_params = HasNodeParams(source_file=params_file, + node_name='slam_toolbox') + + actual_params_file = PythonExpression(['"', params_file, '" if ', has_node_params, + ' else "', default_params_file, '"']) + + log_param_change = LogInfo(msg=['provided params_file ', params_file, + ' does not contain slam_toolbox parameters. Using default: ', + default_params_file], + condition=UnlessCondition(has_node_params)) + + start_async_slam_toolbox_node = Node( + parameters=[ + actual_params_file, + {'use_sim_time': use_sim_time} + ], + package='slam_toolbox', + executable='async_slam_toolbox_node', + name='slam_toolbox', + output='screen') + + ld = LaunchDescription() + + ld.add_action(declare_use_sim_time_argument) + ld.add_action(declare_params_file_cmd) + ld.add_action(log_param_change) + ld.add_action(start_async_slam_toolbox_node) + + return ld diff --git a/worlds/obstacle.sdf b/worlds/obstacle.world similarity index 100% rename from worlds/obstacle.sdf rename to worlds/obstacle.world From c15ce5d16a744cdd55a2d842d7d97e24ccd40baa Mon Sep 17 00:00:00 2001 From: attu0 Date: Fri, 19 Jun 2026 10:52:03 +0530 Subject: [PATCH 12/16] need to work on slam and localizatoin launch files currently use the default one --- README.md | 27 +++++++++++-- config/main.rviz | 103 +++++++++++++++++++++++++++++++++++++---------- config/nav.rviz | 19 +++++---- 3 files changed, 118 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 17c83c1..278517e 100644 --- a/README.md +++ b/README.md @@ -55,12 +55,17 @@ ros2 launch articubot_one launch_sim.launch.py ##### ROS Gazebo run with My World ```bash -ros2 launch articubot_one launch_sim.launch.py world:=src/articubot_one/worlds/world.world +ros2 launch articubot_one launch_sim.launch.py use_sim_time:=true +``` +##### Launch rviz for noraml +```bash +rviz2 -d src/articubot_one/config/map.rviz ``` -##### Launch rviz + +##### Launch rviz for navigation ```bash -rviz2 -d src/articubot_one/config/main.rviz +rviz2 -d src/articubot_one/config/nav.rviz ``` ##### Control the Robot @@ -78,6 +83,22 @@ ros2 run rqt_image_view rqt_image_view ros2 launch articubot_one rplidar.launch.py ``` +##### for slam +```bash +ros2 launch slam_toolbox online_async_launch.py slam_params_file:=/home/atharv/Desktop/dev_Ws/src/articubot_two/config/mapper_params_online_async.yaml +``` + +##### for localization +```bash +ros2 launch nav2_bringup localization_launch.py map:=/home/atharv/Desktop/dev_Ws/map_save.yaml params_file:=/home/atharv/Desktop/dev_Ws/src/articubot_two/config/nav2_params_clean.yaml use_sim_time:=true +``` + +##### for navigation +```bash +ros2 launch articubot_two navigation_launch.py params_file:=/home/atharv/Desktop/dev_Ws/src/articubot_two/config/nav2_params_clean.yaml use_sim_time:=true +``` + + ## Run the Real Robot ##### Source it diff --git a/config/main.rviz b/config/main.rviz index 85841c8..0af55c1 100644 --- a/config/main.rviz +++ b/config/main.rviz @@ -3,9 +3,10 @@ Panels: Help Height: 78 Name: Displays Property Tree Widget: - Expanded: ~ + Expanded: + - /Global Options1 Splitter Ratio: 0.5 - Tree Height: 478 + Tree Height: 468 - Class: rviz_common/Selection Name: Selection - Class: rviz_common/Tool Properties @@ -47,11 +48,15 @@ Visualization Manager: Value: true - Class: rviz_default_plugins/TF Enabled: true + Filter (blacklist): "" + Filter (whitelist): "" Frame Timeout: 15 Frames: All Enabled: true back_caster_wheel_one: Value: true + base_footprint: + Value: true base_link: Value: true camera_link: @@ -66,6 +71,8 @@ Visualization Manager: Value: true left_wheel: Value: true + map: + Value: true odom: Value: true right_wheel: @@ -76,22 +83,25 @@ Visualization Manager: Show Axes: true Show Names: false Tree: - odom: - base_link: - chassis: - back_caster_wheel_one: + map: + odom: + base_link: + base_footprint: {} - camera_link: - camera_link_optical: + chassis: + back_caster_wheel_one: + {} + camera_link: + camera_link_optical: + {} + front_caster_wheel_one: + {} + laser_frame: {} - front_caster_wheel_one: + left_wheel: + {} + right_wheel: {} - laser_frame: - {} - left_wheel: - {} - right_wheel: - {} Update Interval: 0 Value: true - Alpha: 1 @@ -117,6 +127,10 @@ Visualization Manager: Show Axes: false Show Trail: false Value: true + base_footprint: + Alpha: 1 + Show Axes: false + Show Trail: false base_link: Alpha: 1 Show Axes: false @@ -179,6 +193,7 @@ Visualization Manager: Visibility: Grid: true LaserScan: true + Map: true RobotModel: true TF: true Value: true @@ -217,10 +232,56 @@ Visualization Manager: Use Fixed Frame: true Use rainbow: true Value: true + - Alpha: 0.699999988079071 + Binary representation: false + Binary threshold: 100 + Class: rviz_default_plugins/Map + Color Scheme: map + Draw Behind: false + Enabled: true + Name: Map + Topic: + Depth: 5 + Durability Policy: Volatile + Filter size: 10 + History Policy: Keep Last + Reliability Policy: Reliable + Value: /map + Update Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /map_updates + Use Timestamp: false + Value: true + - Alpha: 0.699999988079071 + Binary representation: false + Binary threshold: 100 + Class: rviz_default_plugins/Map + Color Scheme: costmap + Draw Behind: false + Enabled: true + Name: Map + Topic: + Depth: 5 + Durability Policy: Volatile + Filter size: 10 + History Policy: Keep Last + Reliability Policy: Reliable + Value: /global_costmap/costmap + Update Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /global_costmap/costmap_updates + Use Timestamp: false + Value: true Enabled: true Global Options: Background Color: 48; 48; 48 - Fixed Frame: odom + Fixed Frame: map Frame Rate: 30 Name: root Tools: @@ -263,7 +324,7 @@ Visualization Manager: Views: Current: Class: rviz_default_plugins/Orbit - Distance: 5.644542694091797 + Distance: 13.372947692871094 Enable Stereo Rendering: Stereo Eye Separation: 0.05999999865889549 Stereo Focal Distance: 1 @@ -281,17 +342,17 @@ Visualization Manager: Pitch: 1.5697963237762451 Target Frame: Value: Orbit (rviz) - Yaw: 3.1236116886138916 + Yaw: 3.0736117362976074 Saved: ~ Window Geometry: Camera: collapsed: false Displays: collapsed: false - Height: 1016 + Height: 1011 Hide Left Dock: false Hide Right Dock: false - QMainWindow State: 000000ff00000000fd0000000400000000000001900000035afc0200000009fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003d00000269000000c900fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb0000000c00430061006d00650072006101000002ac000000eb0000002800ffffff000000010000010f0000035afc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000003d0000035a000000a400fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e100000197000000030000073a0000003efc0100000002fb0000000800540069006d006501000000000000073a000002fb00fffffffb0000000800540069006d006501000000000000045000000000000000000000048f0000035a00000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 + QMainWindow State: 000000ff00000000fd00000004000000000000019000000351fc0200000009fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005d00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003f00000262000000cc00fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb0000000c00430061006d00650072006101000002a7000000e90000001700ffffff000000010000010f00000351fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000003f00000351000000a900fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e100000197000000030000073a0000003efc0100000002fb0000000800540069006d006501000000000000073a0000026f00fffffffb0000000800540069006d006501000000000000045000000000000000000000048f0000035100000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 Selection: collapsed: false Time: @@ -302,4 +363,4 @@ Window Geometry: collapsed: false Width: 1850 X: 70 - Y: 27 + Y: 32 diff --git a/config/nav.rviz b/config/nav.rviz index 90cb2f9..0af55c1 100644 --- a/config/nav.rviz +++ b/config/nav.rviz @@ -4,7 +4,7 @@ Panels: Name: Displays Property Tree Widget: Expanded: - - /Map2 + - /Global Options1 Splitter Ratio: 0.5 Tree Height: 468 - Class: rviz_common/Selection @@ -323,21 +323,26 @@ Visualization Manager: Value: true Views: Current: - Angle: -1.4450000524520874 - Class: rviz_default_plugins/TopDownOrtho + Class: rviz_default_plugins/Orbit + Distance: 13.372947692871094 Enable Stereo Rendering: Stereo Eye Separation: 0.05999999865889549 Stereo Focal Distance: 1 Swap Stereo Eyes: false Value: false + Focal Point: + X: -0.00014779961202293634 + Y: -0.000715168658643961 + Z: -0.005384792108088732 + Focal Shape Fixed Size: true + Focal Shape Size: 0.05000000074505806 Invert Z Axis: false Name: Current View Near Clip Distance: 0.009999999776482582 - Scale: 104.19364929199219 + Pitch: 1.5697963237762451 Target Frame: - Value: TopDownOrtho (rviz_default_plugins) - X: 1.3529088497161865 - Y: -1.6902755498886108 + Value: Orbit (rviz) + Yaw: 3.0736117362976074 Saved: ~ Window Geometry: Camera: From b89f232252768172625d7187bcf1376b05491beb Mon Sep 17 00:00:00 2001 From: attu0 Date: Fri, 19 Jun 2026 23:55:04 +0530 Subject: [PATCH 13/16] Final --- README.md | 4 +- launch/launch_sim.launch.py | 2 +- launch/localization_launch.py | 287 +++++++-- launch/online_async_launch.py | 96 ++- worlds/empty.world | 70 --- worlds/obs.sdf | 393 ++++++++++++ worlds/obs.world | 1120 --------------------------------- worlds/obstacle.world | 669 -------------------- worlds/world.world | 716 --------------------- 9 files changed, 678 insertions(+), 2679 deletions(-) delete mode 100644 worlds/empty.world create mode 100644 worlds/obs.sdf delete mode 100644 worlds/obs.world delete mode 100644 worlds/obstacle.world delete mode 100644 worlds/world.world diff --git a/README.md b/README.md index 278517e..ca62e8c 100644 --- a/README.md +++ b/README.md @@ -85,12 +85,12 @@ ros2 launch articubot_one rplidar.launch.py ##### for slam ```bash -ros2 launch slam_toolbox online_async_launch.py slam_params_file:=/home/atharv/Desktop/dev_Ws/src/articubot_two/config/mapper_params_online_async.yaml +ros2 launch articubot_two online_async_launch.py slam_params_file:=/home/atharv/Desktop/dev_Ws/src/articubot_two/config/mapper_params_online_async.yaml ``` ##### for localization ```bash -ros2 launch nav2_bringup localization_launch.py map:=/home/atharv/Desktop/dev_Ws/map_save.yaml params_file:=/home/atharv/Desktop/dev_Ws/src/articubot_two/config/nav2_params_clean.yaml use_sim_time:=true +ros2 launch articubot_two localization_launch.py map:=/home/atharv/Desktop/dev_Ws/map_save.yaml params_file:=/home/atharv/Desktop/dev_Ws/src/articubot_two/config/nav2_params_clean.yaml use_sim_time:=true ``` ##### for navigation diff --git a/launch/launch_sim.launch.py b/launch/launch_sim.launch.py index 36ce82c..19052d3 100644 --- a/launch/launch_sim.launch.py +++ b/launch/launch_sim.launch.py @@ -44,7 +44,7 @@ def generate_launch_description(): default_world = os.path.join( get_package_share_directory(package_name), 'worlds', - 'empty.world' + 'obs.sdf' ) world = LaunchConfiguration('world') diff --git a/launch/localization_launch.py b/launch/localization_launch.py index 558c5ec..42afb5c 100644 --- a/launch/localization_launch.py +++ b/launch/localization_launch.py @@ -17,21 +17,33 @@ from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription -from launch.actions import DeclareLaunchArgument, SetEnvironmentVariable -from launch.substitutions import LaunchConfiguration +from launch.actions import DeclareLaunchArgument, GroupAction +from launch.actions import SetEnvironmentVariable +from launch.conditions import IfCondition +from launch.substitutions import EqualsSubstitution +from launch.substitutions import LaunchConfiguration, PythonExpression +from launch.substitutions import NotEqualsSubstitution +from launch_ros.actions import LoadComposableNodes, SetParameter from launch_ros.actions import Node +from launch_ros.descriptions import ComposableNode, ParameterFile from nav2_common.launch import RewrittenYaml def generate_launch_description(): # Get the launch directory - bringup_dir = get_package_share_directory('articubot_two') + bringup_dir = get_package_share_directory('nav2_bringup') namespace = LaunchConfiguration('namespace') map_yaml_file = LaunchConfiguration('map') use_sim_time = LaunchConfiguration('use_sim_time') autostart = LaunchConfiguration('autostart') params_file = LaunchConfiguration('params_file') + use_composition = LaunchConfiguration('use_composition') + container_name = LaunchConfiguration('container_name') + container_name_full = (namespace, '/', container_name) + use_respawn = LaunchConfiguration('use_respawn') + log_level = LaunchConfiguration('log_level') + lifecycle_nodes = ['map_server', 'amcl'] # Map fully qualified names to relative ones so the node's namespace can be prepended. @@ -40,68 +52,207 @@ def generate_launch_description(): # https://github.com/ros/robot_state_publisher/pull/30 # TODO(orduno) Substitute with `PushNodeRemapping` # https://github.com/ros2/launch_ros/issues/56 - remappings = [('/tf', 'tf'), - ('/tf_static', 'tf_static')] - - # Create our own temporary YAML files that include substitutions - param_substitutions = { - 'use_sim_time': use_sim_time, - 'yaml_filename': map_yaml_file} - - configured_params = RewrittenYaml( - source_file=params_file, - root_key=namespace, - param_rewrites=param_substitutions, - convert_types=True) - - return LaunchDescription([ - # Set env var to print messages to stdout immediately - SetEnvironmentVariable('RCUTILS_LOGGING_BUFFERED_STREAM', '1'), - - DeclareLaunchArgument( - 'namespace', default_value='', - description='Top-level namespace'), - - DeclareLaunchArgument( - 'map', - default_value=os.path.join(bringup_dir, 'maps', 'turtlebot3_world.yaml'), - description='Full path to map yaml file to load'), - - DeclareLaunchArgument( - 'use_sim_time', default_value='false', - description='Use simulation (Gazebo) clock if true'), - - DeclareLaunchArgument( - 'autostart', default_value='true', - description='Automatically startup the nav2 stack'), - - DeclareLaunchArgument( - 'params_file', - default_value=os.path.join(bringup_dir, 'config', 'nav2_params.yaml'), - description='Full path to the ROS2 parameters file to use'), - - Node( - package='nav2_map_server', - executable='map_server', - name='map_server', - output='screen', - parameters=[configured_params], - remappings=remappings), - - Node( - package='nav2_amcl', - executable='amcl', - name='amcl', - output='screen', - parameters=[configured_params], - remappings=remappings), - - Node( - package='nav2_lifecycle_manager', - executable='lifecycle_manager', - name='lifecycle_manager_localization', - output='screen', - parameters=[{'use_sim_time': use_sim_time}, - {'autostart': autostart}, - {'node_names': lifecycle_nodes}]) - ]) + remappings = [('/tf', 'tf'), ('/tf_static', 'tf_static')] + + configured_params = ParameterFile( + RewrittenYaml( + source_file=params_file, + root_key=namespace, + param_rewrites={}, + convert_types=True, + ), + allow_substs=True, + ) + + stdout_linebuf_envvar = SetEnvironmentVariable( + 'RCUTILS_LOGGING_BUFFERED_STREAM', '1' + ) + + declare_namespace_cmd = DeclareLaunchArgument( + 'namespace', default_value='', description='Top-level namespace' + ) + + declare_map_yaml_cmd = DeclareLaunchArgument( + 'map', default_value='', description='Full path to map yaml file to load' + ) + + declare_use_sim_time_cmd = DeclareLaunchArgument( + 'use_sim_time', + default_value='false', + description='Use simulation (Gazebo) clock if true', + ) + + declare_params_file_cmd = DeclareLaunchArgument( + 'params_file', + default_value=os.path.join(bringup_dir, 'params', 'nav2_params.yaml'), + description='Full path to the ROS2 parameters file to use for all launched nodes', + ) + + declare_autostart_cmd = DeclareLaunchArgument( + 'autostart', + default_value='true', + description='Automatically startup the nav2 stack', + ) + + declare_use_composition_cmd = DeclareLaunchArgument( + 'use_composition', + default_value='False', + description='Use composed bringup if True', + ) + + declare_container_name_cmd = DeclareLaunchArgument( + 'container_name', + default_value='nav2_container', + description='the name of conatiner that nodes will load in if use composition', + ) + + declare_use_respawn_cmd = DeclareLaunchArgument( + 'use_respawn', + default_value='False', + description='Whether to respawn if a node crashes. Applied when composition is disabled.', + ) + + declare_log_level_cmd = DeclareLaunchArgument( + 'log_level', default_value='info', description='log level' + ) + + load_nodes = GroupAction( + condition=IfCondition(PythonExpression(['not ', use_composition])), + actions=[ + SetParameter('use_sim_time', use_sim_time), + Node( + condition=IfCondition( + EqualsSubstitution(LaunchConfiguration('map'), '') + ), + package='nav2_map_server', + executable='map_server', + name='map_server', + output='screen', + respawn=use_respawn, + respawn_delay=2.0, + parameters=[configured_params], + arguments=['--ros-args', '--log-level', log_level], + remappings=remappings, + ), + Node( + condition=IfCondition( + NotEqualsSubstitution(LaunchConfiguration('map'), '') + ), + package='nav2_map_server', + executable='map_server', + name='map_server', + output='screen', + respawn=use_respawn, + respawn_delay=2.0, + parameters=[configured_params, {'yaml_filename': map_yaml_file}], + arguments=['--ros-args', '--log-level', log_level], + remappings=remappings, + ), + Node( + package='nav2_amcl', + executable='amcl', + name='amcl', + output='screen', + respawn=use_respawn, + respawn_delay=2.0, + parameters=[configured_params], + arguments=['--ros-args', '--log-level', log_level], + remappings=remappings, + ), + Node( + package='nav2_lifecycle_manager', + executable='lifecycle_manager', + name='lifecycle_manager_localization', + output='screen', + arguments=['--ros-args', '--log-level', log_level], + parameters=[{'autostart': autostart}, {'node_names': lifecycle_nodes}], + ), + ], + ) + # LoadComposableNode for map server twice depending if we should use the + # value of map from a CLI or launch default or user defined value in the + # yaml configuration file. They are separated since the conditions + # currently only work on the LoadComposableNodes commands and not on the + # ComposableNode node function itself + load_composable_nodes = GroupAction( + condition=IfCondition(use_composition), + actions=[ + SetParameter('use_sim_time', use_sim_time), + LoadComposableNodes( + target_container=container_name_full, + condition=IfCondition( + EqualsSubstitution(LaunchConfiguration('map'), '') + ), + composable_node_descriptions=[ + ComposableNode( + package='nav2_map_server', + plugin='nav2_map_server::MapServer', + name='map_server', + parameters=[configured_params], + remappings=remappings, + ), + ], + ), + LoadComposableNodes( + target_container=container_name_full, + condition=IfCondition( + NotEqualsSubstitution(LaunchConfiguration('map'), '') + ), + composable_node_descriptions=[ + ComposableNode( + package='nav2_map_server', + plugin='nav2_map_server::MapServer', + name='map_server', + parameters=[ + configured_params, + {'yaml_filename': map_yaml_file}, + ], + remappings=remappings, + ), + ], + ), + LoadComposableNodes( + target_container=container_name_full, + composable_node_descriptions=[ + ComposableNode( + package='nav2_amcl', + plugin='nav2_amcl::AmclNode', + name='amcl', + parameters=[configured_params], + remappings=remappings, + ), + ComposableNode( + package='nav2_lifecycle_manager', + plugin='nav2_lifecycle_manager::LifecycleManager', + name='lifecycle_manager_localization', + parameters=[ + {'autostart': autostart, 'node_names': lifecycle_nodes} + ], + ), + ], + ), + ], + ) + + # Create the launch description and populate + ld = LaunchDescription() + + # Set environment variables + ld.add_action(stdout_linebuf_envvar) + + # Declare the launch options + ld.add_action(declare_namespace_cmd) + ld.add_action(declare_map_yaml_cmd) + ld.add_action(declare_use_sim_time_cmd) + ld.add_action(declare_params_file_cmd) + ld.add_action(declare_autostart_cmd) + ld.add_action(declare_use_composition_cmd) + ld.add_action(declare_container_name_cmd) + ld.add_action(declare_use_respawn_cmd) + ld.add_action(declare_log_level_cmd) + + # Add the actions to launch all of the localiztion nodes + ld.add_action(load_nodes) + ld.add_action(load_composable_nodes) + + return ld diff --git a/launch/online_async_launch.py b/launch/online_async_launch.py index d7dcf1a..3a54f4e 100644 --- a/launch/online_async_launch.py +++ b/launch/online_async_launch.py @@ -1,59 +1,89 @@ import os -from launch import LaunchDescription -from launch.actions import DeclareLaunchArgument, LogInfo -from launch.conditions import UnlessCondition -from launch.substitutions import LaunchConfiguration, PythonExpression -from launch_ros.actions import Node from ament_index_python.packages import get_package_share_directory -from nav2_common.launch import HasNodeParams +from launch import LaunchDescription +from launch.actions import (DeclareLaunchArgument, EmitEvent, LogInfo, + RegisterEventHandler) +from launch.conditions import IfCondition +from launch.events import matches_action +from launch.substitutions import (AndSubstitution, LaunchConfiguration, + NotSubstitution) +from launch_ros.actions import LifecycleNode +from launch_ros.event_handlers import OnStateTransition +from launch_ros.events.lifecycle import ChangeState +from lifecycle_msgs.msg import Transition def generate_launch_description(): + autostart = LaunchConfiguration('autostart') + use_lifecycle_manager = LaunchConfiguration("use_lifecycle_manager") use_sim_time = LaunchConfiguration('use_sim_time') - params_file = LaunchConfiguration('params_file') - default_params_file = os.path.join(get_package_share_directory("articubot_two"), - 'config', 'mapper_params_online_async.yaml') + slam_params_file = LaunchConfiguration('slam_params_file') + declare_autostart_cmd = DeclareLaunchArgument( + 'autostart', default_value='true', + description='Automatically startup the slamtoolbox. ' + 'Ignored when use_lifecycle_manager is true.') + declare_use_lifecycle_manager = DeclareLaunchArgument( + 'use_lifecycle_manager', default_value='false', + description='Enable bond connection during node activation') declare_use_sim_time_argument = DeclareLaunchArgument( 'use_sim_time', default_value='true', description='Use simulation/Gazebo clock') - declare_params_file_cmd = DeclareLaunchArgument( - 'params_file', - default_value=default_params_file, + declare_slam_params_file_cmd = DeclareLaunchArgument( + 'slam_params_file', + default_value=os.path.join(get_package_share_directory("slam_toolbox"), + 'config', 'mapper_params_online_async.yaml'), description='Full path to the ROS2 parameters file to use for the slam_toolbox node') - # If the provided param file doesn't have slam_toolbox params, we must pass the - # default_params_file instead. This could happen due to automatic propagation of - # LaunchArguments. See: - # https://github.com/ros-planning/navigation2/pull/2243#issuecomment-800479866 - has_node_params = HasNodeParams(source_file=params_file, - node_name='slam_toolbox') - - actual_params_file = PythonExpression(['"', params_file, '" if ', has_node_params, - ' else "', default_params_file, '"']) - - log_param_change = LogInfo(msg=['provided params_file ', params_file, - ' does not contain slam_toolbox parameters. Using default: ', - default_params_file], - condition=UnlessCondition(has_node_params)) - - start_async_slam_toolbox_node = Node( + start_async_slam_toolbox_node = LifecycleNode( parameters=[ - actual_params_file, - {'use_sim_time': use_sim_time} + slam_params_file, + { + 'use_lifecycle_manager': use_lifecycle_manager, + 'use_sim_time': use_sim_time + } ], package='slam_toolbox', executable='async_slam_toolbox_node', name='slam_toolbox', - output='screen') + output='screen', + namespace='' + ) + + configure_event = EmitEvent( + event=ChangeState( + lifecycle_node_matcher=matches_action(start_async_slam_toolbox_node), + transition_id=Transition.TRANSITION_CONFIGURE + ), + condition=IfCondition(AndSubstitution(autostart, NotSubstitution(use_lifecycle_manager))) + ) + + activate_event = RegisterEventHandler( + OnStateTransition( + target_lifecycle_node=start_async_slam_toolbox_node, + start_state="configuring", + goal_state="inactive", + entities=[ + LogInfo(msg="[LifecycleLaunch] Slamtoolbox node is activating."), + EmitEvent(event=ChangeState( + lifecycle_node_matcher=matches_action(start_async_slam_toolbox_node), + transition_id=Transition.TRANSITION_ACTIVATE + )) + ] + ), + condition=IfCondition(AndSubstitution(autostart, NotSubstitution(use_lifecycle_manager))) + ) ld = LaunchDescription() + ld.add_action(declare_autostart_cmd) + ld.add_action(declare_use_lifecycle_manager) ld.add_action(declare_use_sim_time_argument) - ld.add_action(declare_params_file_cmd) - ld.add_action(log_param_change) + ld.add_action(declare_slam_params_file_cmd) ld.add_action(start_async_slam_toolbox_node) + ld.add_action(configure_event) + ld.add_action(activate_event) return ld diff --git a/worlds/empty.world b/worlds/empty.world deleted file mode 100644 index 61f365f..0000000 --- a/worlds/empty.world +++ /dev/null @@ -1,70 +0,0 @@ - - - - 0.001 - 1.0 - - - - - - - - - ogre2 - - - - - - true - 0 0 10 0 0 0 - 0.8 0.8 0.8 1 - 0.2 0.2 0.2 1 - - 1000 - 0.9 - 0.01 - 0.001 - - -0.5 0.1 -0.9 - - - - true - - - - - 0 0 1 - 100 100 - - - - - - - 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 - - - - - - \ No newline at end of file diff --git a/worlds/obs.sdf b/worlds/obs.sdf new file mode 100644 index 0000000..b4fcc6d --- /dev/null +++ b/worlds/obs.sdf @@ -0,0 +1,393 @@ + + + + + + + + + + + + + + + + + + + + + + + ogre + + + + + + https://fuel.gazebosim.org/1.0/OpenRobotics/models/Sun + + + + + true + 0 0 0 0 0 0 + + + + + + + 0 0 1 + 40 40 + + + + + + + + 0 0 1 + 40 40 + + + + + 1 1 1 1 + 1 1 1 1 + 0.1 0.1 0.1 1 + + + + + + + + + + + + true + 0 12 1 0 0 0 + + + 30 0.2 2 + + + 30 0.2 2 + + + + + + true + 0 -12 1 0 0 0 + + + 30 0.2 2 + + + 30 0.2 2 + + + + + + true + 15 0 1 0 0 0 + + + 0.2 24 2 + + + 0.2 24 2 + + + + + + true + -15 0 1 0 0 0 + + + 0.2 24 2 + + + 0.2 24 2 + + + + + + + + + + + true + -8.5 0 1 0 0 0 + + + 13 0.2 2 + + + 13 0.2 2 + + 0.7 0.7 0.7 1 + 0.7 0.7 0.7 1 + + + + + + + true + 8.5 0 1 0 0 0 + + + 13 0.2 2 + + + 13 0.2 2 + + 0.7 0.7 0.7 1 + 0.7 0.7 0.7 1 + + + + + + + + + true + 0 10 1 0 0 0 + + + 0.2 4 2 + + + 0.2 4 2 + + 0.7 0.7 0.7 1 + 0.7 0.7 0.7 1 + + + + + + + + true + 0 3.5 1 0 0 0 + + + 0.2 5 2 + + + 0.2 5 2 + + 0.7 0.7 0.7 1 + 0.7 0.7 0.7 1 + + + + + + + + true + 0 -3.5 1 0 0 0 + + + 0.2 5 2 + + + 0.2 5 2 + + 0.7 0.7 0.7 1 + 0.7 0.7 0.7 1 + + + + + + + + true + 0 -10 1 0 0 0 + + + 0.2 4 2 + + + 0.2 4 2 + + 0.7 0.7 0.7 1 + 0.7 0.7 0.7 1 + + + + + + + + + + + + true + -7 5.5 0.75 0 0 0 + + + 5 0.2 1.5 + + + 5 0.2 1.5 + + 0.4 0.4 0.4 1 + 0.4 0.4 0.4 1 + + + + + + + + true + 7 8.8 0.75 0 0 0 + + + 5 0.2 1.5 + + + 5 0.2 1.5 + + 0.4 0.4 0.4 1 + 0.4 0.4 0.4 1 + + + + + + + + true + -7 -8.8 0.75 0 0 0 + + + 5 0.2 1.5 + + + 5 0.2 1.5 + + 0.4 0.4 0.4 1 + 0.4 0.4 0.4 1 + + + + + + + + true + 7 -5.5 0.75 0 0 0 + + + 5 0.2 1.5 + + + 5 0.2 1.5 + + 0.4 0.4 0.4 1 + 0.4 0.4 0.4 1 + + + + + + + + + + + true + -10 8 0.5 0 0 0 + + + 2 1 1 + + + 2 1 1 + + 1 0 0 1 + 1 0 0 1 + + + + + + + true + 10 8 0.5 0 0 0 + + + 2 1 1 + + + 2 1 1 + + 0 0 1 1 + 0 0 1 1 + + + + + + + true + -10 -8 0.5 0 0 0 + + + 2 1 1 + + + 2 1 1 + + 0 1 0 1 + 0 1 0 1 + + + + + + + true + 10 -8 0.5 0 0 0 + + + 2 1 1 + + + 2 1 1 + + 1 1 0 1 + 1 1 0 1 + + + + + + + \ No newline at end of file diff --git a/worlds/obs.world b/worlds/obs.world deleted file mode 100644 index 01fa598..0000000 --- a/worlds/obs.world +++ /dev/null @@ -1,1120 +0,0 @@ - - - - 1 - 0 0 10 0 -0 0 - 0.8 0.8 0.8 1 - 0.2 0.2 0.2 1 - - 1000 - 0.9 - 0.01 - 0.001 - - -0.5 0.1 -0.9 - - 0 - 0 - 0 - - - - 1 - - - - - 0 0 1 - 100 100 - - - - - 65535 - - - - - 100 - 50 - - - - - - - - 10 - - - 0 - - - 0 0 1 - 100 100 - - - - - - - 0 - 0 - 0 - - - 0 0 -9.8 - 6e-06 2.3e-05 -4.2e-05 - - - 0.001 - 1 - 1000 - - - 0.4 0.4 0.4 1 - 0.7 0.7 0.7 1 - 1 - - - - - EARTH_WGS84 - 0 - 0 - 0 - 0 - - - 1 - - - - - model://fire_hydrant/meshes/fire_hydrant.dae - - - 10 - - - - - - - - - - - - - - - - - model://fire_hydrant/meshes/fire_hydrant.dae - - - - 0 - 0 - 0 - - -3.49613 -0.81055 0 0 -0 0 - - - - - - - 10 10 10 - model://construction_cone/meshes/construction_cone.dae - - - 10 - - - - - - - - - - - - - - - - - 10 10 10 - model://construction_cone/meshes/construction_cone.dae - - - - 0 - - 0 0 0 0 -0 0 - - 1 - 0 - 0 - 1 - 0 - 1 - - 1 - - 0 - 0 - - -0.72152 5.66296 0 0 -0 0 - - - - - 0 0 0.4 0 -0 0 - 500 - - 51.2096 - 51.2096 - 25 - 0 - 0 - 0 - - - - - - model://construction_barrel/meshes/construction_barrel.dae - - - 10 - - - - - - - - - - - - - - - - - model://construction_barrel/meshes/construction_barrel.dae - - - - 0 - 0 - 0 - - 4.40542 -4.11853 0 0 -0 0 - - - - - 0 0 0.4 0 -0 0 - 500 - - 51.2096 - 51.2096 - 25 - 0 - 0 - 0 - - - - - - model://construction_barrel/meshes/construction_barrel.dae - - - 10 - - - - - - - - - - - - - - - - - model://construction_barrel/meshes/construction_barrel.dae - - - - 0 - 0 - 0 - - 6.80235 4.75148 0 0 -0 0 - - - - - - - 10 10 10 - model://construction_cone/meshes/construction_cone.dae - - - 10 - - - - - - - - - - - - - - - - - 10 10 10 - model://construction_cone/meshes/construction_cone.dae - - - - 0 - - 0 0 0 0 -0 0 - - 1 - 0 - 0 - 1 - 0 - 1 - - 1 - - 0 - 0 - - -3.25974 -7.2802 0 0 -0 0 - - - - - 0 0 0.4 0 -0 0 - 500 - - 51.2096 - 51.2096 - 25 - 0 - 0 - 0 - - - - - - model://construction_barrel/meshes/construction_barrel.dae - - - 10 - - - - - - - - - - - - - - - - - model://construction_barrel/meshes/construction_barrel.dae - - - - 0 - 0 - 0 - - -6.17225 5.38454 0 0 -0 0 - - - - - - - 10 10 10 - model://construction_cone/meshes/construction_cone.dae - - - 10 - - - - - - - - - - - - - - - - - 10 10 10 - model://construction_cone/meshes/construction_cone.dae - - - - 0 - - 0 0 0 0 -0 0 - - 1 - 0 - 0 - 1 - 0 - 1 - - 1 - - 0 - 0 - - -7.19099 -4.03326 0 0 -0 0 - - - - - - - 10 10 10 - model://construction_cone/meshes/construction_cone.dae - - - 10 - - - - - - - - - - - - - - - - - 10 10 10 - model://construction_cone/meshes/construction_cone.dae - - - - 0 - - 0 0 0 0 -0 0 - - 1 - 0 - 0 - 1 - 0 - 1 - - 1 - - 0 - 0 - - -7.02109 1.5937 0 0 -0 0 - - - - - 0 0 0.4 0 -0 0 - 500 - - 51.2096 - 51.2096 - 25 - 0 - 0 - 0 - - - - - - model://construction_barrel/meshes/construction_barrel.dae - - - 10 - - - - - - - - - - - - - - - - - model://construction_barrel/meshes/construction_barrel.dae - - - - 0 - 0 - 0 - - 1.14874 -6.3498 0 0 -0 0 - - - - - - - 10 10 10 - model://construction_cone/meshes/construction_cone.dae - - - 10 - - - - - - - - - - - - - - - - - 10 10 10 - model://construction_cone/meshes/construction_cone.dae - - - - 0 - - 0 0 0 0 -0 0 - - 1 - 0 - 0 - 1 - 0 - 1 - - 1 - - 0 - 0 - - 4.90241 8.14393 0 0 -0 0 - - - - - 0 0 0.4 0 -0 0 - 500 - - 51.2096 - 51.2096 - 25 - 0 - 0 - 0 - - - - - - model://construction_barrel/meshes/construction_barrel.dae - - - 10 - - - - - - - - - - - - - - - - - model://construction_barrel/meshes/construction_barrel.dae - - - - 0 - 0 - 0 - - 10.6326 -2.1092 0 0 -0 0 - - - - - 0.6096 0.00476 1.2192 0 -0 0 - 2.5 - - 1.23873 - 0 - 0 - 1.54838 - 0 - 0.309696 - - - - 0.6096 0.00476 1.2192 0 -0 0 - - - 1.2192 0.00952 2.4384 - - - 10 - - - - - - - - - - - - - - - -0.004536 -0.003572 0 0 -0 0 - - - model://drc_practice_valve_wall/meshes/five_dice_wall.dae - - - - 0 - 0 - 0 - - -1.19166 -3.2503 0 0 -0 0 - - - 1 - - - - - 0.0254 0.0254 0.0254 - model://ambulance/meshes/ambulance.obj - - - 10 - - - - - - - - - - - - - - - - - 0.0254 0.0254 0.0254 - model://ambulance/meshes/ambulance.obj - - - - 0 - 0 - 0 - - 14.1275 8.249 0 0 -0 0 - - - 1 - - - 1 - - - 0 0.005 0.6 0 -0 0 - - - 0.9 0.01 1.2 - - - 10 - - - - - - - - - - - - - - - 0 0.005 0.6 0 -0 0 - - - 0.9 0.01 1.2 - - - - - - - - 0.45 -0.195 0.6 0 -0 0 - - - 0.02 0.4 1.2 - - - 10 - - - - - - - - - - - - - - - 0.45 -0.195 0.6 0 -0 0 - - - 0.02 0.4 1.2 - - - - - - - - -0.45 -0.195 0.6 0 -0 0 - - - 0.02 0.4 1.2 - - - 10 - - - - - - - - - - - - - - - -0.45 -0.195 0.6 0 -0 0 - - - 0.02 0.4 1.2 - - - - - - - - 0 -0.195 0.03 0 -0 0 - - - 0.88 0.4 0.06 - - - 10 - - - - - - - - - - - - - - - 0 -0.195 0.03 0 -0 0 - - - 0.88 0.4 0.06 - - - - - - - - 0 -0.195 1.19 0 -0 0 - - - 0.88 0.4 0.02 - - - 10 - - - - - - - - - - - - - - - 0 -0.195 1.19 0 -0 0 - - - 0.88 0.4 0.02 - - - - - - - - 0 -0.195 0.43 0 -0 0 - - - 0.88 0.4 0.02 - - - 10 - - - - - - - - - - - - - - - 0 -0.195 0.43 0 -0 0 - - - 0.88 0.4 0.02 - - - - - - - - 0 -0.195 0.8 0 -0 0 - - - 0.88 0.4 0.02 - - - 10 - - - - - - - - - - - - - - - 0 -0.195 0.8 0 -0 0 - - - 0.88 0.4 0.02 - - - - - - - 0 - 0 - 0 - - -7.22045 -6.88447 0 0 -0 0 - - - 421 600000000 - 46 691007731 - 1772283453 873493489 - 46377 - - 4.40533 -4.11857 0 1e-06 1e-06 -2.7e-05 - 1 1 1 - - 4.40533 -4.11857 0 1e-06 1e-06 -2.7e-05 - 0 0 0 0 -0 0 - -0.447659 4.86285 0.318844 0.406486 -1.12769 0.008322 - -223.83 2431.43 159.422 0 -0 0 - - - - 6.80226 4.75144 -1e-06 3e-06 7e-06 -2.7e-05 - 1 1 1 - - 6.80226 4.75144 -1e-06 3e-06 7e-06 -2.7e-05 - 0 0 0 0 -0 0 - 3.8535 6.67453 0.119732 -0.995536 -0.220731 3.1389 - 1926.75 3337.27 59.8658 0 -0 0 - - - - -6.17237 5.38451 -0 0 0 -2.6e-05 - 1 1 1 - - -6.17237 5.38451 -0 0 0 -2.6e-05 - 0 0 0 0 -0 0 - -5.53552 -1.68222 1.28212 -2.01278 -1.26947 0.024313 - -2767.76 -841.111 641.058 0 -0 0 - - - - 1.14866 -6.34983 -2e-06 -8e-06 -2e-06 -2.1e-05 - 1 1 1 - - 1.14866 -6.34983 -2e-06 -8e-06 -2e-06 -2.1e-05 - 0 0 0 0 -0 0 - -0.739421 2.63607 -2.75588 2.83461 -1.29299 3.14155 - -369.711 1318.03 -1377.94 0 -0 0 - - - - 10.6326 -2.10922 0 0 0 -1.6e-05 - 1 1 1 - - 10.6326 -2.10922 0 0 0 -1.6e-05 - 0 0 0 0 -0 0 - -4.92361 1.97106 -0.918541 1.33817 0.218838 0.031724 - -2461.81 985.529 -459.271 0 -0 0 - - - - -0.72152 5.66296 -0 0 -1e-06 0 - 1 1 1 - - -0.72152 5.66296 -0 0 -1e-06 0 - 0 0 0 0 -0 0 - -0 0 0.008512 2.58585 -1.13682 -3.14159 - -0 0 0.008512 0 -0 0 - - - - -3.25974 -7.2802 -0 1e-06 -0 0 - 1 1 1 - - -3.25974 -7.2802 -0 1e-06 -0 0 - 0 0 0 0 -0 0 - -0 -0 -9.79994 1.5e-05 1e-05 0 - -0 -0 -9.79994 0 -0 0 - - - - -7.19099 -4.03326 -0 0 -1e-06 0 - 1 1 1 - - -7.19099 -4.03326 -0 0 -1e-06 0 - 0 0 0 0 -0 0 - -0 0 0.008512 2.58585 -1.13682 -3.14159 - -0 0 0.008512 0 -0 0 - - - - -7.02109 1.5937 -1e-05 0 -0 0 - 1 1 1 - - -7.02109 1.5937 -1e-05 0 -0 0 - 0 0 0 0 -0 0 - 0 0 -9.8 0 -0 0 - 0 0 -9.8 0 -0 0 - - - - 4.90241 8.14393 -1e-05 0 -0 0 - 1 1 1 - - 4.90241 8.14393 -1e-05 0 -0 0 - 0 0 0 0 -0 0 - 0 0 -9.8 0 -0 0 - 0 0 -9.8 0 -0 0 - - - - 14.1275 8.249 0 0 -0 0 - 1 1 1 - - 14.1275 8.249 0 0 -0 0 - 0 0 0 0 -0 0 - 0 0 0 0 -0 0 - 0 0 0 0 -0 0 - - - - -7.22045 -6.88447 0 0 -0 2.02838 - 1 1 1 - - -7.22045 -6.88447 0 0 -0 2.02838 - 0 0 0 0 -0 0 - 0 0 0 0 -0 0 - 0 0 0 0 -0 0 - - - - -3.49613 -0.81055 0 0 -0 0 - 1 1 1 - - -3.49613 -0.81055 0 0 -0 0 - 0 0 0 0 -0 0 - 0 0 0 0 -0 0 - 0 0 0 0 -0 0 - - - - 0 0 0 0 -0 0 - 1 1 1 - - 0 0 0 0 -0 0 - 0 0 0 0 -0 0 - 0 0 0 0 -0 0 - 0 0 0 0 -0 0 - - - - -1.19166 -3.2503 -0 -1e-06 -0 0 - 1 1 1 - - -1.19166 -3.2503 -0 -1e-06 -0 0 - 0 0 0 0 -0 0 - 0.000256 -0.023002 3.8e-05 0.018866 0.00021 0 - 0.000641 -0.057505 9.6e-05 0 -0 0 - - - - 0 0 10 0 -0 0 - - - - - 10.5752 -16.0571 5.77335 -0 0.403643 2.51377 - orbit - perspective - - - - diff --git a/worlds/obstacle.world b/worlds/obstacle.world deleted file mode 100644 index d012bbd..0000000 --- a/worlds/obstacle.world +++ /dev/null @@ -1,669 +0,0 @@ - - - - 0.001 - 1 - 1000 - - - - - - 0 0 -9.8000000000000007 - 5.5644999999999998e-06 2.2875799999999999e-05 -4.2388400000000002e-05 - - - 0.400000006 0.400000006 0.400000006 1 - 0.699999988 0.699999988 0.699999988 1 - true - - - true - - - - - 0 0 1 - 100 100 - - - - - - - - - - - - - - 0 0 1 - 100 100 - - - - 0.800000012 0.800000012 0.800000012 1 - 0.800000012 0.800000012 0.800000012 1 - 0.800000012 0.800000012 0.800000012 1 - - - 0 0 0 0 0 0 - - 0 0 0 0 0 0 - 1 - - 1 - 0 - 0 - 1 - 0 - 1 - - - false - - 0 0 0 0 0 0 - false - - - 5.5894286916536018 6.3544884049254602 0.49999999990199806 6.2287739151293738e-22 9.3279666454713669e-22 -3.6315533669320137e-22 - - - - 0.16666 - 0 - 0 - 0.16666 - 0 - 0.16666 - - 1 - 0 0 0 0 0 0 - - - - - 1 1 1 - - - - - - - - - - - - - - 1 1 1 - - - - 0.300000012 0.300000012 0.300000012 1 - 0.699999988 0.699999988 0.699999988 1 - 1 1 1 1 - - - 0 0 0 0 0 0 - false - - false - false - - - 4.5887850280838904 -6.8070545031201179 0.49999999990199806 6.2287739151293738e-22 9.3279666454713669e-22 -3.6315533669320137e-22 - - - - 0.16666 - 0 - 0 - 0.16666 - 0 - 0.16666 - - 1 - 0 0 0 0 0 0 - - - - - 1 1 1 - - - - - - - - - - - - - - 1 1 1 - - - - 0.300000012 0.300000012 0.300000012 1 - 0.699999988 0.699999988 0.699999988 1 - 1 1 1 1 - - - 0 0 0 0 0 0 - false - - false - false - - - -4.1596935908624157 3.4553966257400903 0.49999999990199806 6.2287739151293738e-22 9.3279666454713669e-22 -3.6315533669320137e-22 - - - - 0.16666 - 0 - 0 - 0.16666 - 0 - 0.16666 - - 1 - 0 0 0 0 0 0 - - - - - 1 1 1 - - - - - - - - - - - - - - 1 1 1 - - - - 0.300000012 0.300000012 0.300000012 1 - 0.699999988 0.699999988 0.699999988 1 - 1 1 1 1 - - - 0 0 0 0 0 0 - false - - false - false - - - -2.098045030429577 -6.0188182638182255 0.49999999990199806 6.2287739151293738e-22 9.3279666454713669e-22 -3.6315533669320137e-22 - - - - 0.16666 - 0 - 0 - 0.16666 - 0 - 0.16666 - - 1 - 0 0 0 0 0 0 - - - - - 1 1 1 - - - - - - - - - - - - - - 1 1 1 - - - - 0.300000012 0.300000012 0.300000012 1 - 0.699999988 0.699999988 0.699999988 1 - 1 1 1 1 - - - 0 0 0 0 0 0 - false - - false - false - - - 4.849065764223452 1.301547479847297 0.49999942638036005 -3.234197451796803e-19 1.6873891088410844e-19 -8.6718542870722761e-21 - - - - 0.14580000000000001 - 0 - 0 - 0.14580000000000001 - 0 - 0.125 - - 1 - 0 0 0 0 0 0 - - - - - 0.5 - 1 - - - - - - - - - - - - - - 0.5 - 1 - - - - 0.300000012 0.300000012 0.300000012 1 - 0.699999988 0.699999988 0.699999988 1 - 1 1 1 1 - - - 0 0 0 0 0 0 - false - - false - false - - - 1.1419232346405686 -7.821728095094409 0.49999942638036005 2.6402521966221052e-19 3.329359840486923e-19 8.8426103357745432e-21 - - - - 0.14580000000000001 - 0 - 0 - 0.14580000000000001 - 0 - 0.125 - - 1 - 0 0 0 0 0 0 - - - - - 0.5 - 1 - - - - - - - - - - - - - - 0.5 - 1 - - - - 0.300000012 0.300000012 0.300000012 1 - 0.699999988 0.699999988 0.699999988 1 - 1 1 1 1 - - - 0 0 0 0 0 0 - false - - false - false - - - -5.9916297247377308 -4.8035849282983474 0.49999942638036005 -1.2325108630750125e-19 5.2332237750184956e-20 1.4519371047189128e-20 - - - - 0.14580000000000001 - 0 - 0 - 0.14580000000000001 - 0 - 0.125 - - 1 - 0 0 0 0 0 0 - - - - - 0.5 - 1 - - - - - - - - - - - - - - 0.5 - 1 - - - - 0.300000012 0.300000012 0.300000012 1 - 0.699999988 0.699999988 0.699999988 1 - 1 1 1 1 - - - 0 0 0 0 0 0 - false - - false - false - - - -1.2607789948470884 6.4899256913593222 0.49999942638036005 1.7878695869122041e-19 -9.7096515711216193e-20 8.5210264014226988e-21 - - - - 0.14580000000000001 - 0 - 0 - 0.14580000000000001 - 0 - 0.125 - - 1 - 0 0 0 0 0 0 - - - - - 0.5 - 1 - - - - - - - - - - - - - - 0.5 - 1 - - - - 0.300000012 0.300000012 0.300000012 1 - 0.699999988 0.699999988 0.699999988 1 - 1 1 1 1 - - - 0 0 0 0 0 0 - false - - false - false - - - -6.2595785317039949 -0.5709626899557172 0.499999999902001 0 0 0 - - - - 0.074153999999999998 - 0 - 0 - 0.074153999999999998 - 0 - 0.018769000000000001 - - 1 - 0 0 0 0 0 0 - - - - - 0.20000000000000001 - 0.59999999999999998 - - - - - - - - - - - - - - 0.20000000000000001 - 0.59999999999999998 - - - - 0.300000012 0.300000012 0.300000012 1 - 0.699999988 0.699999988 0.699999988 1 - 1 1 1 1 - - - 0 0 0 0 0 0 - false - - false - false - - - -8.3546134112281631 5.7117435524002271 0.5 0 0 0 - - - - 0.074999999999999997 - 0 - 0 - 0.074999999999999997 - 0 - 0.074999999999999997 - - 1 - 0 0 0 0 0 0 - - - - - 0.5 - 1 - - - - - - - - - - - - - - 0.5 - 1 - - - - 0.300000012 0.300000012 0.300000012 1 - 0.699999988 0.699999988 0.699999988 1 - 1 1 1 1 - - - 0 0 0 0 0 0 - false - - false - false - - - 6.6916393047249407 -4.0550962129920318 0.5 0 0 0 - - - - 0.074999999999999997 - 0 - 0 - 0.074999999999999997 - 0 - 0.074999999999999997 - - 1 - 0 0 0 0 0 0 - - - - - 0.5 - 1 - - - - - - - - - - - - - - 0.5 - 1 - - - - 0.300000012 0.300000012 0.300000012 1 - 0.699999988 0.699999988 0.699999988 1 - 1 1 1 1 - - - 0 0 0 0 0 0 - false - - false - false - - - -8.8563514285855298 -1.1184917215844943 0.5 0 0 0 - - - - 0.074999999999999997 - 0 - 0 - 0.074999999999999997 - 0 - 0.074999999999999997 - - 1 - 0 0 0 0 0 0 - - - - - 0.5 - 1 - - - - - - - - - - - - - - 0.5 - 1 - - - - 0.300000012 0.300000012 0.300000012 1 - 0.699999988 0.699999988 0.699999988 1 - 1 1 1 1 - - - 0 0 0 0 0 0 - false - - false - false - - - 0 0 10 0 0 0 - true - 1 - -0.5 0.10000000000000001 -0.90000000000000002 - 0.800000012 0.800000012 0.800000012 1 - 0.200000003 0.200000003 0.200000003 1 - - 1000 - 0.0099999997764825821 - 0.89999997615814209 - 0.0010000000474974513 - - - 0 - 0 - 0 - - - - diff --git a/worlds/world.world b/worlds/world.world deleted file mode 100644 index b841d84..0000000 --- a/worlds/world.world +++ /dev/null @@ -1,716 +0,0 @@ - - - - 1 - 0 0 10 0 -0 0 - 0.8 0.8 0.8 1 - 0.2 0.2 0.2 1 - - 1000 - 0.9 - 0.01 - 0.001 - - -0.5 0.1 -0.9 - - 0 - 0 - 0 - - - - 1 - - - - - 0 0 1 - 100 100 - - - - - 65535 - - - - - 100 - 50 - - - - - - - - 10 - - - 0 - - - 0 0 1 - 100 100 - - - - - - - 0 - 0 - 0 - - - 0 0 -9.8 - 6e-06 2.3e-05 -4.2e-05 - - - 0.001 - 1 - 1000 - - - 0.4 0.4 0.4 1 - 0.7 0.7 0.7 1 - 1 - - - - - EARTH_WGS84 - 0 - 0 - 0 - 0 - - - 1 - - - -0.4 -0.75 0.0948 0 -0 0 - - - 9.38 22.63 0.19 - - - 10 - - - - - - - - - - - - - - - -5.03 0.53 1.415 0 -0 0 - - - 0.12 23.16 2.83 - - - 10 - - - - - - - - - - - - - - - 4.24 -0.31 1.415 0 -0 0 - - - 0.12 21.48 2.83 - - - 10 - - - - - - - - - - - - - - - -1.48 7.43 1.415 0 -0 0 - - - 7.2 0.12 2.83 - - - 10 - - - - - - - - - - - - - - - 2.09 8.9 1.435 0 -0 0 - - - 0.12 3.05 2.87 - - - 10 - - - - - - - - - - - - - - - 3.155 10.4 1.435 0 -0 0 - - - 2.13 0.12 2.87 - - - 10 - - - - - - - - - - - - - - - 0.615 -10.98 1.415 0 -0 0 - - - 7.36 0.15 2.83 - - - 10 - - - - - - - - - - - - - - - -4.62 -10.98 1.415 0 -0 0 - - - 0.93 0.15 2.83 - - - 10 - - - - - - - - - - - - - - - -3.61 -10.98 2.69 0 -0 0 - - - 1.09 0.15 0.28 - - - 10 - - - - - - - - - - - - - - - -4.385 0.26 0.95 0 -0 0 - - - 1.03 1.03 1.52 - - - 10 - - - - - - - - - - - - - - - - - model://cafe/meshes/cafe.dae - - - - 0 - 0 - 0 - - 0.391121 0.574421 0 0 -0 0 - - - 513 902000000 - 302 518471727 - 1771869094 929640008 - 301572 - - 3.26486 -3.50132 0.687739 1.80686 0.382854 2.34062 - 1 1 1 - - 3.26486 -3.50132 0.687739 1.80686 0.382854 2.34062 - 0 0 0 0 -0 0 - 9.90611 7.95814 7.67758 -0.537658 0.407983 2.47661 - 4953.05 3979.07 3838.79 0 -0 0 - - - - 3.46469 -4.77561 0.1898 -1e-06 1e-06 1.4e-05 - 1 1 1 - - 3.46469 -4.77561 0.1898 -1e-06 1e-06 1.4e-05 - 0 0 0 0 -0 0 - 0 1e-06 -0.975655 -2.21899 1.50165 0 - 0 1e-06 -0.975655 0 -0 0 - - - - 4.20942 -3.93462 0.189801 6e-06 1e-06 0.001974 - 1 1 1 - - 4.20942 -3.93462 0.189801 6e-06 1e-06 0.001974 - 0 0 0 0 -0 0 - 0 5e-06 7.08825 2.33854 1.28605 -1e-06 - 0 5e-06 7.08825 0 -0 0 - - - - 3.70554 -4.05372 0.189791 1e-06 -2e-06 -0.001419 - 1 1 1 - - 3.70554 -4.05372 0.189791 1e-06 -2e-06 -0.001419 - 0 0 0 0 -0 0 - 0 0 -9.8 0 -0 0 - 0 0 -9.8 0 -0 0 - - - - 0.391121 0.574421 0 0 -0 0 - 1 1 1 - - 0.391121 0.574421 0 0 -0 0 - 0 0 0 0 -0 0 - 0 0 0 0 -0 0 - 0 0 0 0 -0 0 - - - - -2.19394 -10.9756 0 0 -0 0 - 1 1 1 - - -2.19394 -10.9756 0 0 -0 0 - 0 0 0 0 -0 0 - 0 0 0 0 -0 0 - 0 0 0 0 -0 0 - - - - 0 0 0 0 -0 0 - 1 1 1 - - 0 0 0 0 -0 0 - 0 0 0 0 -0 0 - 0 0 0 0 -0 0 - 0 0 0 0 -0 0 - - - - -2.20858 -5.80323 0.189799 -2e-06 1e-06 -0.106531 - 1 1 1 - - -2.20858 -5.80323 0.189799 -2e-06 1e-06 -0.106531 - 0 0 0 0 -0 0 - 1.158 1.89026 -2.78955 -1.95478 1.23162 0.104139 - 92.6397 151.22 -223.164 0 -0 0 - - - - 0 0 10 0 -0 0 - - - - - 6.09784 -13.029 7.99499 0 0.383641 1.34339 - orbit - perspective - - - - - - 0 0 0.95 0 -0 0 - 80 - - 27.82 - 0 - 0 - 24.88 - 0 - 4.57 - - - - 0 0 0.01 0 -0 0 - - - 0.35 0.75 0.02 - - - 10 - - - - - - - - - - - - - - - 0 0 -0.02 0 -0 0 - - - model://person_walking/meshes/walking.dae - - - 10 - - - - - - - - - - - - - - - 0 0 -0.02 0 -0 0 - - - model://person_walking/meshes/walking.dae - - - - 0 - 0 - 0 - - -2.19815 -5.79971 0 0 -0 0 - - - - - 0 0 0.4 0 -0 0 - 500 - - 51.2096 - 51.2096 - 25 - 0 - 0 - 0 - - - - - - model://construction_barrel/meshes/construction_barrel.dae - - - 10 - - - - - - - - - - - - - - - - - model://construction_barrel/meshes/construction_barrel.dae - - - - 0 - 0 - 0 - - 4.09493 -3.22559 0 0 -0 0 - - - - - - - 10 10 10 - model://construction_cone/meshes/construction_cone.dae - - - 10 - - - - - - - - - - - - - - - - - 10 10 10 - model://construction_cone/meshes/construction_cone.dae - - - - 0 - - 0 0 0 0 -0 0 - - 1 - 0 - 0 - 1 - 0 - 1 - - 1 - - 0 - 0 - - 3.46359 -4.77659 0 0 -0 0 - - - - - - - 10 10 10 - model://construction_cone/meshes/construction_cone.dae - - - 10 - - - - - - - - - - - - - - - - - 10 10 10 - model://construction_cone/meshes/construction_cone.dae - - - - 0 - - 0 0 0 0 -0 0 - - 1 - 0 - 0 - 1 - 0 - 1 - - 1 - - 0 - 0 - - 4.20033 -3.94231 0 0 -0 0 - - - - - - - 10 10 10 - model://construction_cone/meshes/construction_cone.dae - - - 10 - - - - - - - - - - - - - - - - - 10 10 10 - model://construction_cone/meshes/construction_cone.dae - - - - 0 - - 0 0 0 0 -0 0 - - 1 - 0 - 0 - 1 - 0 - 1 - - 1 - - 0 - 0 - - 3.70441 -4.05484 0 0 -0 0 - - - 1 - - - - - model://fire_hydrant/meshes/fire_hydrant.dae - - - 10 - - - - - - - - - - - - - - - - - model://fire_hydrant/meshes/fire_hydrant.dae - - - - 0 - 0 - 0 - - -2.19394 -10.9756 0 0 -0 0 - - - From e8c409e99bcf13888e715df5a6ce85a1c5c387c9 Mon Sep 17 00:00:00 2001 From: attu0 Date: Sat, 20 Jun 2026 09:49:06 +0530 Subject: [PATCH 14/16] this is clean --- CMakeLists.txt | 1 + README.md | 8 +- config/main.rviz | 80 ++---- config/map.rviz | 53 ++-- config/nav.rviz | 62 +---- ...av2_params_clean.yaml => nav2_params.yaml} | 0 launch/launch_sim.launch.py | 2 +- map/map_save.pgm | Bin 0 -> 57136 bytes map/map_save.yaml | 7 + worlds/empty.world | 70 +++++ worlds/world.world | 254 ++++++++++++++++++ 11 files changed, 393 insertions(+), 144 deletions(-) rename config/{nav2_params_clean.yaml => nav2_params.yaml} (100%) create mode 100644 map/map_save.pgm create mode 100644 map/map_save.yaml create mode 100644 worlds/empty.world create mode 100644 worlds/world.world diff --git a/CMakeLists.txt b/CMakeLists.txt index d734a3e..43ac402 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,6 +39,7 @@ install( launch worlds meshes + map DESTINATION share/${PROJECT_NAME} ) diff --git a/README.md b/README.md index ca62e8c..32b9cce 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Raspberry Pi Setup Guide ## Requirements -- OS: Ubuntu 22.04 Jammy +- OS: Ubuntu 24.04 Jammy - Ros2 jazzy ## Build your Workspace for devloper pc @@ -85,17 +85,17 @@ ros2 launch articubot_one rplidar.launch.py ##### for slam ```bash -ros2 launch articubot_two online_async_launch.py slam_params_file:=/home/atharv/Desktop/dev_Ws/src/articubot_two/config/mapper_params_online_async.yaml +ros2 launch articubot_two online_async_launch.py slam_params_file:=src/articubot_two/config/mapper_params_online_async.yaml ``` ##### for localization ```bash -ros2 launch articubot_two localization_launch.py map:=/home/atharv/Desktop/dev_Ws/map_save.yaml params_file:=/home/atharv/Desktop/dev_Ws/src/articubot_two/config/nav2_params_clean.yaml use_sim_time:=true +ros2 launch articubot_two localization_launch.py map:=src/articubot_two/map/map_save.yaml params_file:=src/articubot_two/config/nav2_params.yaml use_sim_time:=true ``` ##### for navigation ```bash -ros2 launch articubot_two navigation_launch.py params_file:=/home/atharv/Desktop/dev_Ws/src/articubot_two/config/nav2_params_clean.yaml use_sim_time:=true +ros2 launch articubot_two navigation_launch.py params_file:=src/articubot_two/config/nav2_params.yaml use_sim_time:=true ``` diff --git a/config/main.rviz b/config/main.rviz index 0af55c1..89aa83b 100644 --- a/config/main.rviz +++ b/config/main.rviz @@ -71,8 +71,6 @@ Visualization Manager: Value: true left_wheel: Value: true - map: - Value: true odom: Value: true right_wheel: @@ -83,25 +81,24 @@ Visualization Manager: Show Axes: true Show Names: false Tree: - map: - odom: - base_link: - base_footprint: + odom: + base_link: + base_footprint: + {} + chassis: + back_caster_wheel_one: {} - chassis: - back_caster_wheel_one: - {} - camera_link: - camera_link_optical: - {} - front_caster_wheel_one: - {} - laser_frame: + camera_link: + camera_link_optical: {} - left_wheel: + front_caster_wheel_one: {} - right_wheel: + laser_frame: {} + left_wheel: + {} + right_wheel: + {} Update Interval: 0 Value: true - Alpha: 1 @@ -193,7 +190,6 @@ Visualization Manager: Visibility: Grid: true LaserScan: true - Map: true RobotModel: true TF: true Value: true @@ -232,56 +228,10 @@ Visualization Manager: Use Fixed Frame: true Use rainbow: true Value: true - - Alpha: 0.699999988079071 - Binary representation: false - Binary threshold: 100 - Class: rviz_default_plugins/Map - Color Scheme: map - Draw Behind: false - Enabled: true - Name: Map - Topic: - Depth: 5 - Durability Policy: Volatile - Filter size: 10 - History Policy: Keep Last - Reliability Policy: Reliable - Value: /map - Update Topic: - Depth: 5 - Durability Policy: Volatile - History Policy: Keep Last - Reliability Policy: Reliable - Value: /map_updates - Use Timestamp: false - Value: true - - Alpha: 0.699999988079071 - Binary representation: false - Binary threshold: 100 - Class: rviz_default_plugins/Map - Color Scheme: costmap - Draw Behind: false - Enabled: true - Name: Map - Topic: - Depth: 5 - Durability Policy: Volatile - Filter size: 10 - History Policy: Keep Last - Reliability Policy: Reliable - Value: /global_costmap/costmap - Update Topic: - Depth: 5 - Durability Policy: Volatile - History Policy: Keep Last - Reliability Policy: Reliable - Value: /global_costmap/costmap_updates - Use Timestamp: false - Value: true Enabled: true Global Options: Background Color: 48; 48; 48 - Fixed Frame: map + Fixed Frame: odom Frame Rate: 30 Name: root Tools: diff --git a/config/map.rviz b/config/map.rviz index 550255f..c16a168 100644 --- a/config/map.rviz +++ b/config/map.rviz @@ -3,9 +3,11 @@ Panels: Help Height: 78 Name: Displays Property Tree Widget: - Expanded: ~ + Expanded: + - /Global Options1 + - /Map1/Status1 Splitter Ratio: 0.5 - Tree Height: 468 + Tree Height: 287 - Class: rviz_common/Selection Name: Selection - Class: rviz_common/Tool Properties @@ -24,6 +26,8 @@ Panels: Name: Time SyncMode: 0 SyncSource: LaserScan + - Class: slam_toolbox::SlamToolboxPlugin + Name: SlamToolboxPlugin Visualization Manager: Class: "" Displays: @@ -83,25 +87,24 @@ Visualization Manager: Show Names: false Tree: map: - {} - odom: - base_link: - base_footprint: - {} - chassis: - back_caster_wheel_one: + odom: + base_link: + base_footprint: {} - camera_link: - camera_link_optical: + chassis: + back_caster_wheel_one: + {} + camera_link: + camera_link_optical: + {} + front_caster_wheel_one: + {} + laser_frame: {} - front_caster_wheel_one: + left_wheel: {} - laser_frame: + right_wheel: {} - left_wheel: - {} - right_wheel: - {} Update Interval: 0 Value: true - Alpha: 1 @@ -178,7 +181,7 @@ Visualization Manager: Value: true Visual Enabled: true - Class: rviz_default_plugins/Camera - Enabled: true + Enabled: false Far Plane Distance: 100 Image Rendering: background and overlay Name: Camera @@ -189,7 +192,7 @@ Visualization Manager: History Policy: Keep Last Reliability Policy: Reliable Value: /camera/image_raw - Value: true + Value: false Visibility: Grid: true LaserScan: true @@ -300,7 +303,7 @@ Visualization Manager: Value: true Views: Current: - Angle: -1.634999394416809 + Angle: -9.225017547607422 Class: rviz_default_plugins/TopDownOrtho Enable Stereo Rendering: Stereo Eye Separation: 0.05999999865889549 @@ -310,7 +313,7 @@ Visualization Manager: Invert Z Axis: false Name: Current View Near Clip Distance: 0.009999999776482582 - Scale: 96.46293640136719 + Scale: 65.6382827758789 Target Frame: Value: TopDownOrtho (rviz_default_plugins) X: -0.37073683738708496 @@ -324,15 +327,17 @@ Window Geometry: Height: 1011 Hide Left Dock: false Hide Right Dock: false - QMainWindow State: 000000ff00000000fd00000004000000000000019000000351fc0200000009fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005d00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003f00000262000000cc00fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb0000000c00430061006d00650072006101000002a7000000e90000001700ffffff000000010000010f00000351fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000003f00000351000000a900fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e100000197000000030000073a0000003efc0100000002fb0000000800540069006d006501000000000000073a0000026f00fffffffb0000000800540069006d006501000000000000045000000000000000000000048f0000035100000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 + QMainWindow State: 000000ff00000000fd00000004000000000000021100000351fc020000000afb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005d00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003f000001ad000000cc00fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb0000000c00430061006d00650072006100000002a7000000e90000001700fffffffb000000220053006c0061006d0054006f006f006c0062006f00780050006c007500670069006e01000001f20000019e0000019e00ffffff000000010000010f00000351fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000003f00000351000000a900fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e100000197000000030000073e0000003efc0100000002fb0000000800540069006d006501000000000000073e0000026f00fffffffb0000000800540069006d00650100000000000004500000000000000000000004120000035100000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 Selection: collapsed: false + SlamToolboxPlugin: + collapsed: false Time: collapsed: false Tool Properties: collapsed: false Views: collapsed: false - Width: 1850 - X: 70 + Width: 1854 + X: 66 Y: 32 diff --git a/config/nav.rviz b/config/nav.rviz index 0af55c1..c7b5855 100644 --- a/config/nav.rviz +++ b/config/nav.rviz @@ -6,7 +6,7 @@ Panels: Expanded: - /Global Options1 Splitter Ratio: 0.5 - Tree Height: 468 + Tree Height: 99 - Class: rviz_common/Selection Name: Selection - Class: rviz_common/Tool Properties @@ -25,6 +25,8 @@ Panels: Name: Time SyncMode: 0 SyncSource: LaserScan + - Class: nav2_rviz_plugins/Navigation 2 + Name: Navigation 2 Visualization Manager: Class: "" Displays: @@ -47,63 +49,21 @@ Visualization Manager: Reference Frame: Value: true - Class: rviz_default_plugins/TF - Enabled: true + Enabled: false Filter (blacklist): "" Filter (whitelist): "" Frame Timeout: 15 Frames: All Enabled: true - back_caster_wheel_one: - Value: true - base_footprint: - Value: true - base_link: - Value: true - camera_link: - Value: true - camera_link_optical: - Value: true - chassis: - Value: true - front_caster_wheel_one: - Value: true - laser_frame: - Value: true - left_wheel: - Value: true - map: - Value: true - odom: - Value: true - right_wheel: - Value: true Marker Scale: 1 Name: TF Show Arrows: true Show Axes: true Show Names: false Tree: - map: - odom: - base_link: - base_footprint: - {} - chassis: - back_caster_wheel_one: - {} - camera_link: - camera_link_optical: - {} - front_caster_wheel_one: - {} - laser_frame: - {} - left_wheel: - {} - right_wheel: - {} + {} Update Interval: 0 - Value: true + Value: false - Alpha: 1 Class: rviz_default_plugins/RobotModel Collision Enabled: false @@ -324,7 +284,7 @@ Visualization Manager: Views: Current: Class: rviz_default_plugins/Orbit - Distance: 13.372947692871094 + Distance: 18.47389030456543 Enable Stereo Rendering: Stereo Eye Separation: 0.05999999865889549 Stereo Focal Distance: 1 @@ -352,7 +312,9 @@ Window Geometry: Height: 1011 Hide Left Dock: false Hide Right Dock: false - QMainWindow State: 000000ff00000000fd00000004000000000000019000000351fc0200000009fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005d00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003f00000262000000cc00fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb0000000c00430061006d00650072006101000002a7000000e90000001700ffffff000000010000010f00000351fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000003f00000351000000a900fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e100000197000000030000073a0000003efc0100000002fb0000000800540069006d006501000000000000073a0000026f00fffffffb0000000800540069006d006501000000000000045000000000000000000000048f0000035100000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 + Navigation 2: + collapsed: false + QMainWindow State: 000000ff00000000fd00000004000000000000019000000351fc020000000afb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005d00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003f000000f1000000cc00fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb0000000c00430061006d00650072006101000001360000005c0000001700fffffffb00000018004e0061007600690067006100740069006f006e002000320100000198000001f8000001e300ffffff000000010000010f00000351fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000003f00000351000000a900fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e100000197000000030000073e0000003efc0100000002fb0000000800540069006d006501000000000000073e0000026f00fffffffb0000000800540069006d00650100000000000004500000000000000000000004930000035100000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 Selection: collapsed: false Time: @@ -361,6 +323,6 @@ Window Geometry: collapsed: false Views: collapsed: false - Width: 1850 - X: 70 + Width: 1854 + X: 66 Y: 32 diff --git a/config/nav2_params_clean.yaml b/config/nav2_params.yaml similarity index 100% rename from config/nav2_params_clean.yaml rename to config/nav2_params.yaml diff --git a/launch/launch_sim.launch.py b/launch/launch_sim.launch.py index 19052d3..36ce82c 100644 --- a/launch/launch_sim.launch.py +++ b/launch/launch_sim.launch.py @@ -44,7 +44,7 @@ def generate_launch_description(): default_world = os.path.join( get_package_share_directory(package_name), 'worlds', - 'obs.sdf' + 'empty.world' ) world = LaunchConfiguration('world') diff --git a/map/map_save.pgm b/map/map_save.pgm new file mode 100644 index 0000000000000000000000000000000000000000..5c11ad987d0e41af55e17cb24ce737dffc88fb90 GIT binary patch literal 57136 zcmeI5U3S|b5QY7mRdfyM$wPP1jb}?aWfa-55d{lA@W6~t+e8QuckZ1Z6gmC-@%H}v z&#&9F}J22ynm596=)vcUiWb-DRm2VD7sM)9b#wFu7mOuCu$0 z1zgO_P?-V}%8XR=qHV^+>_z0FI^JN3m{-OZWAhzRY>|b|jYVc-a6J(%7=o!u5~TNAVUZi`w< zV_zMrjIrx*OM+~<{%SD~&bwj%dOR|D7yhA%wL~LCl&rfXd+-WS0z86R=Cd zo#4T1zAij?0Tp=RaZov zgKyx82u^J9bU0i(R7DK6oXUUwNSjYH+zw*a47bCMh*XQQL^Q$E3}?4Gni?x2X}BFi z6&ab0g{leQ(xIx_@s9(w*UScYL`RaUTS5(q*UXy5+yO2fnX9=x4(#E(G+gqry0d%K z!1FD%TIjqx0lUV;tQ;Gp4Q5Y4v*%HiJ62u!4`ppONXisVy278VgP!+ z16>8t^GzUTl3iNN9g0ZOcPC(%hD#Qa9YU36xUiUm_~?g0Ai4h0i|3PAswbU@Br>P& zQ`r`@M~g2^Sh<+QFoTJRw4QQyCGV1O;omPs`z~B&B;2K`N#H8>-6m{_!8E&Ys7kE3 zsflKH0x^@Z#TZ->bCcZq4yJt7aybHl7&IQlUsfQExJP~MKqe-3b+GZx5uNt-11ZG=G0JP z>+JQ-nQ{v}Iiawd8KMC$YF=A#OTL?+7qxaqS#qg|m@{hLZgTqi}mckiP_n$HL;7i)^a_@ z8548Z@RB97?4Qy3dQc3`>2N_~s+-E$RYwW9AZHgern;$|U3HXz3vzZrW2&3V*;Pjg zxFBa2G^V<#oLzO4fD3YVL1U_$${M@us~+m;j22{#U4If831FpDYhw0LwUT-xEY`&A zkvS5;N~bR7mDr521a?Qhjve2A^tp?9w8e+s&sHKjexUW-OIv&IbAv|m`M9#pcav`| UFWQ*+q>%Qe#3u&gCI7d}KYTg_EC2ui literal 0 HcmV?d00001 diff --git a/map/map_save.yaml b/map/map_save.yaml new file mode 100644 index 0000000..436255b --- /dev/null +++ b/map/map_save.yaml @@ -0,0 +1,7 @@ +image: map_save.pgm +mode: trinary +resolution: 0.050 +origin: [-5.987, -5.952, 0] +negate: 0 +occupied_thresh: 0.65 +free_thresh: 0.196 \ No newline at end of file diff --git a/worlds/empty.world b/worlds/empty.world new file mode 100644 index 0000000..61f365f --- /dev/null +++ b/worlds/empty.world @@ -0,0 +1,70 @@ + + + + 0.001 + 1.0 + + + + + + + + + ogre2 + + + + + + true + 0 0 10 0 0 0 + 0.8 0.8 0.8 1 + 0.2 0.2 0.2 1 + + 1000 + 0.9 + 0.01 + 0.001 + + -0.5 0.1 -0.9 + + + + true + + + + + 0 0 1 + 100 100 + + + + + + + 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 + + + + + + \ No newline at end of file diff --git a/worlds/world.world b/worlds/world.world new file mode 100644 index 0000000..a22f54d --- /dev/null +++ b/worlds/world.world @@ -0,0 +1,254 @@ + + + + + + + 0.001 + 1.0 + + + + + + + + + + + ogre2 + + + + + + + 0 0 10 0 0 0 + true + 1 1 1 1 + 0.2 0.2 0.2 1 + -0.5 0.1 -0.9 + + + + + true + + + + + 0 0 1 + 100 100 + + + + + + + + 0 0 1 + 100 100 + + + + 1.0 + + + + + + + true + 0 6 1 0 0 0 + + + + 12 0.2 2 + + + + + + 12 0.2 2 + + + 0.4 0.4 0.4 1 + 0.5 0.5 0.5 1 + 0.05 0.05 0.05 1 + + + + + + + + true + 0 -6 1 0 0 0 + + + + 12 0.2 2 + + + + + + 12 0.2 2 + + + 0.4 0.4 0.4 1 + 0.5 0.5 0.5 1 + 0.05 0.05 0.05 1 + + + + + + + + true + 6 0 1 0 0 0 + + + + 0.2 12 2 + + + + + + 0.2 12 2 + + + 0.4 0.4 0.4 1 + 0.5 0.5 0.5 1 + 0.05 0.05 0.05 1 + + + + + + + + true + -6 0 1 0 0 0 + + + + 0.2 12 2 + + + + + + 0.2 12 2 + + + 0.4 0.4 0.4 1 + 0.5 0.5 0.5 1 + 0.05 0.05 0.05 1 + + + + + + + + true + -2 1 1 0 0 0 + + + + 0.2 6 2 + + + + + + 0.2 6 2 + + + 0.4 0.4 0.4 1 + 0.5 0.5 0.5 1 + 0.05 0.05 0.05 1 + + + + + + + + true + 2 -1 1 0 0 0 + + + + 0.2 6 2 + + + + + + 0.2 6 2 + + + 0.4 0.4 0.4 1 + 0.5 0.5 0.5 1 + 0.05 0.05 0.05 1 + + + + + + + + true + -4 -3 0.5 0 0 0 + + + + 1 1 1 + + + + + + 1 1 1 + + + 0.25 0.25 0.25 1 + 0.35 0.35 0.35 1 + + + + + + + true + 4 3 0.5 0 0 0 + + + + 1 1 1 + + + + + + 1 1 1 + + + 0.25 0.25 0.25 1 + 0.35 0.35 0.35 1 + + + + + + + \ No newline at end of file From b2a301787cb6cb1214fe7877f4e9cc375c08ea79 Mon Sep 17 00:00:00 2001 From: attu0 Date: Sun, 21 Jun 2026 11:51:15 +0530 Subject: [PATCH 15/16] added some lauch files to test to actual hardware --- config/gz_bridge.yaml | 7 +++ description/imu.xacro | 22 +++++++ description/robot.urdf.xacro | 11 ++++ launch/camera.launch.py | 17 +++++ launch/imu.launch.py | 12 ++++ launch/launch_robot.launch.py | 115 ++++++++++++++++++++++++++++++++++ launch/navigation_launch.py | 4 +- launch/rplidar.launch.py | 19 ++++++ 8 files changed, 205 insertions(+), 2 deletions(-) create mode 100644 description/imu.xacro create mode 100644 launch/camera.launch.py create mode 100644 launch/imu.launch.py create mode 100644 launch/launch_robot.launch.py create mode 100644 launch/rplidar.launch.py diff --git a/config/gz_bridge.yaml b/config/gz_bridge.yaml index c7e6896..02307fb 100644 --- a/config/gz_bridge.yaml +++ b/config/gz_bridge.yaml @@ -18,6 +18,13 @@ gz_type_name: "gz.msgs.CameraInfo" direction: GZ_TO_ROS +# gz topic published by Sensors plugin (imu) +- ros_topic_name: "imu/data" + gz_topic_name: "imu/data" + ros_type_name: "sensor_msgs/msg/Imu" + gz_type_name: "gz.msgs.IMU" + direction: GZ_TO_ROS + # gz topic published by DiffDrive plugin - ros_topic_name: "odom" diff --git a/description/imu.xacro b/description/imu.xacro new file mode 100644 index 0000000..8fd04b2 --- /dev/null +++ b/description/imu.xacro @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + 1 + 1 + true + imu + + + + \ No newline at end of file diff --git a/description/robot.urdf.xacro b/description/robot.urdf.xacro index c8e9c76..3bf53af 100644 --- a/description/robot.urdf.xacro +++ b/description/robot.urdf.xacro @@ -1,9 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/launch/camera.launch.py b/launch/camera.launch.py new file mode 100644 index 0000000..0359179 --- /dev/null +++ b/launch/camera.launch.py @@ -0,0 +1,17 @@ +import os + +from launch import LaunchDescription +from launch_ros.actions import Node + +def generate_launch_description(): + return LaunchDescription([ + Node( + package='v4l2_camera', + executable='v4l2_camera_node', + output='screen', + parameters=[{ + 'image_size':[640,480], + 'camera_frame_id':'camera_link_optical' + }] + ) + ]) diff --git a/launch/imu.launch.py b/launch/imu.launch.py new file mode 100644 index 0000000..86e9feb --- /dev/null +++ b/launch/imu.launch.py @@ -0,0 +1,12 @@ +from launch import LaunchDescription +from launch_ros.actions import Node + +def generate_launch_description(): + return LaunchDescription([ + Node( + package='ros_gz_bridge', + executable='parameter_bridge', + parameters=[{'config_file': 'gz_bridge.yaml'}], + output='screen' + ) + ]) diff --git a/launch/launch_robot.launch.py b/launch/launch_robot.launch.py new file mode 100644 index 0000000..180d41b --- /dev/null +++ b/launch/launch_robot.launch.py @@ -0,0 +1,115 @@ +import os + +from ament_index_python.packages import get_package_share_directory + + +from launch import LaunchDescription +from launch.actions import IncludeLaunchDescription, TimerAction +from launch.launch_description_sources import PythonLaunchDescriptionSource +from launch.substitutions import Command +from launch.actions import RegisterEventHandler +from launch.event_handlers import OnProcessStart + +from launch_ros.actions import Node + + + +def generate_launch_description(): + + + # Include the robot_state_publisher launch file, provided by our own package. Force sim time to be enabled + # !!! MAKE SURE YOU SET THE PACKAGE NAME CORRECTLY !!! + + package_name='articubot_two' #<--- CHANGE ME + + rsp = IncludeLaunchDescription( + PythonLaunchDescriptionSource([os.path.join( + get_package_share_directory(package_name),'launch','rsp.launch.py' + )]), launch_arguments={'use_sim_time': 'false', 'use_ros2_control': 'true'}.items() + ) + + # joystick = IncludeLaunchDescription( + # PythonLaunchDescriptionSource([os.path.join( + # get_package_share_directory(package_name),'launch','joystick.launch.py' + # )]) + # ) + + + twist_mux_params = os.path.join(get_package_share_directory(package_name),'config','twist_mux.yaml') + twist_mux = Node( + package="twist_mux", + executable="twist_mux", + parameters=[twist_mux_params], + remappings=[('/cmd_vel_out','/diff_cont/cmd_vel_unstamped')] + ) + + + + + robot_description = Command(['ros2 param get --hide-type /robot_state_publisher robot_description']) + + controller_params_file = os.path.join(get_package_share_directory(package_name),'config','my_controllers.yaml') + + controller_manager = Node( + package="controller_manager", + executable="ros2_control_node", + parameters=[{'robot_description': robot_description}, + controller_params_file] + ) + + delayed_controller_manager = TimerAction(period=3.0, actions=[controller_manager]) + + diff_drive_spawner = Node( + package="controller_manager", + executable="spawner", + arguments=["diff_cont"], + ) + + delayed_diff_drive_spawner = RegisterEventHandler( + event_handler=OnProcessStart( + target_action=controller_manager, + on_start=[diff_drive_spawner], + ) + ) + + joint_broad_spawner = Node( + package="controller_manager", + executable="spawner", + arguments=["joint_broad"], + ) + + delayed_joint_broad_spawner = RegisterEventHandler( + event_handler=OnProcessStart( + target_action=controller_manager, + on_start=[joint_broad_spawner], + ) + ) + + + # Code for delaying a node (I haven't tested how effective it is) + # + # First add the below lines to imports + # from launch.actions import RegisterEventHandler + # from launch.event_handlers import OnProcessExit + # + # Then add the following below the current diff_drive_spawner + # delayed_diff_drive_spawner = RegisterEventHandler( + # event_handler=OnProcessExit( + # target_action=spawn_entity, + # on_exit=[diff_drive_spawner], + # ) + # ) + # + # Replace the diff_drive_spawner in the final return with delayed_diff_drive_spawner + + + + # Launch them all! + return LaunchDescription([ + rsp, + # joystick, + twist_mux, + delayed_controller_manager, + delayed_diff_drive_spawner, + delayed_joint_broad_spawner + ]) \ No newline at end of file diff --git a/launch/navigation_launch.py b/launch/navigation_launch.py index 2d6f93e..f7c29a8 100644 --- a/launch/navigation_launch.py +++ b/launch/navigation_launch.py @@ -28,7 +28,7 @@ def generate_launch_description(): # Get the launch directory - bringup_dir = get_package_share_directory('nav2_bringup') + bringup_dir = get_package_share_directory('articubot_two') namespace = LaunchConfiguration('namespace') use_sim_time = LaunchConfiguration('use_sim_time') @@ -90,7 +90,7 @@ def generate_launch_description(): declare_params_file_cmd = DeclareLaunchArgument( 'params_file', - default_value=os.path.join(bringup_dir, 'params', 'nav2_params.yaml'), + default_value=os.path.join(bringup_dir, 'config', 'nav2_params.yaml'), description='Full path to the ROS2 parameters file to use for all launched nodes', ) diff --git a/launch/rplidar.launch.py b/launch/rplidar.launch.py new file mode 100644 index 0000000..ccc0d74 --- /dev/null +++ b/launch/rplidar.launch.py @@ -0,0 +1,19 @@ +from launch import LaunchDescription +from launch_ros.actions import Node + +def generate_launch_description(): + return LaunchDescription([ + Node( + package='rplidar_ros', + executable='rplidar_node', + name='rplidar', + output='screen', + parameters=[{ + 'serial_port': '/dev/ttyUSB0', + 'serial_baudrate': 115200, + 'frame_id': 'laser_frame', + 'angle_compensate': False, + 'scan_mode': 'Standard' + }] + ) + ]) \ No newline at end of file From b206f70ff3c2c4ac6a37a60859d38aae9674a975 Mon Sep 17 00:00:00 2001 From: attu0 Date: Sun, 21 Jun 2026 22:47:39 +0530 Subject: [PATCH 16/16] fixed lidar and ros2 control bugs --- launch/rsp.launch.py | 47 ++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/launch/rsp.launch.py b/launch/rsp.launch.py index b8e9268..d93a842 100644 --- a/launch/rsp.launch.py +++ b/launch/rsp.launch.py @@ -1,5 +1,6 @@ import os + from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription @@ -7,43 +8,41 @@ from launch.actions import DeclareLaunchArgument from launch_ros.actions import Node +import xacro + def generate_launch_description(): + # Check if we're told to use sim time use_sim_time = LaunchConfiguration('use_sim_time') - - pkg_path = os.path.join( - get_package_share_directory('articubot_two') - ) - - xacro_file = os.path.join( - pkg_path, - 'description', - 'robot.urdf.xacro' - ) - - robot_description = Command([ - 'xacro ', - xacro_file, - ' sim_mode:=', - use_sim_time - ]) - + use_ros2_control = LaunchConfiguration('use_ros2_control') + + # Process the URDF file + pkg_path = os.path.join(get_package_share_directory('articubot_two')) + xacro_file = os.path.join(pkg_path,'description','robot.urdf.xacro') + # robot_description_config = xacro.process_file(xacro_file).toxml() + robot_description_config = Command(['xacro ', xacro_file, ' use_ros2_control:=', use_ros2_control, ' sim_mode:=', use_sim_time]) + + # Create a robot_state_publisher node + params = {'robot_description': robot_description_config, 'use_sim_time': use_sim_time} node_robot_state_publisher = Node( package='robot_state_publisher', executable='robot_state_publisher', output='screen', - parameters=[{ - 'robot_description': robot_description, - 'use_sim_time': use_sim_time - }] + parameters=[params] ) + + # Launch! return LaunchDescription([ DeclareLaunchArgument( 'use_sim_time', + default_value='false', + description='Use sim time if true'), + DeclareLaunchArgument( + 'use_ros2_control', default_value='true', - description='Use sim time if true' - ), + description='Use ros2_control if true'), + node_robot_state_publisher ]) \ No newline at end of file