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 cd6ad1c..32b9cce 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Raspberry Pi Setup Guide ## Requirements -- OS: Ubuntu 22.04 Jammy -- Ros2 Humble +- OS: Ubuntu 24.04 Jammy +- 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 ``` @@ -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,12 +83,28 @@ ros2 run rqt_image_view rqt_image_view ros2 launch articubot_one rplidar.launch.py ``` +##### for slam +```bash +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:=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:=src/articubot_two/config/nav2_params.yaml use_sim_time:=true +``` + + ## Run the Real Robot ##### Source it ```bash cd ~/robot_ws -source /opt/ros/humble/setup.bash +source /opt/ros/jazzy/setup.bash source install/setup.bash ``` 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/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/gz_bridge.yaml b/config/gz_bridge.yaml new file mode 100644 index 0000000..02307fb --- /dev/null +++ b/config/gz_bridge.yaml @@ -0,0 +1,55 @@ +- 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 + +# 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 + +# 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 + +# 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" + gz_topic_name: "odom" + ros_type_name: "nav_msgs/msg/Odometry" + gz_type_name: "gz.msgs.Odometry" + direction: GZ_TO_ROS + +# 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 + +# 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 + +# 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/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/main.rviz b/config/main.rviz index 85841c8..89aa83b 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: @@ -78,6 +83,8 @@ Visualization Manager: Tree: odom: base_link: + base_footprint: + {} chassis: back_caster_wheel_one: {} @@ -86,8 +93,8 @@ Visualization Manager: {} front_caster_wheel_one: {} - laser_frame: - {} + laser_frame: + {} left_wheel: {} right_wheel: @@ -117,6 +124,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 @@ -263,7 +274,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 +292,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 +313,4 @@ Window Geometry: collapsed: false Width: 1850 X: 70 - Y: 27 + Y: 32 diff --git a/config/map.rviz b/config/map.rviz new file mode 100644 index 0000000..c16a168 --- /dev/null +++ b/config/map.rviz @@ -0,0 +1,343 @@ +Panels: + - Class: rviz_common/Displays + Help Height: 78 + Name: Displays + Property Tree Widget: + Expanded: + - /Global Options1 + - /Map1/Status1 + Splitter Ratio: 0.5 + Tree Height: 287 + - 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 + - Class: slam_toolbox::SlamToolboxPlugin + Name: SlamToolboxPlugin +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: false + 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: false + 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: -9.225017547607422 + 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: 65.6382827758789 + 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: 000000ff00000000fd00000004000000000000021100000351fc020000000afb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005d00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003f000001ad000000cc00fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb0000000c00430061006d00650072006100000002a7000000e90000001700fffffffb000000220053006c0061006d0054006f006f006c0062006f00780050006c007500670069006e01000001f20000019e0000019e00ffffff000000010000010f00000351fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000003f00000351000000a900fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e100000197000000030000073e0000003efc0100000002fb0000000800540069006d006501000000000000073e0000026f00fffffffb0000000800540069006d00650100000000000004500000000000000000000004120000035100000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 + Selection: + collapsed: false + SlamToolboxPlugin: + collapsed: false + Time: + collapsed: false + Tool Properties: + collapsed: false + Views: + collapsed: false + Width: 1854 + X: 66 + Y: 32 diff --git a/config/mapper_params_online_async.yaml b/config/mapper_params_online_async.yaml index 571354c..0a86719 100644 --- a/config/mapper_params_online_async.yaml +++ b/config/mapper_params_online_async.yaml @@ -12,14 +12,14 @@ slam_toolbox: # ROS Parameters odom_frame: odom map_frame: map - base_frame: base_footprint + base_frame: base_link scan_topic: /scan - mode: localization #mapping + 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/bot_ws/my_map_serial + 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 diff --git a/config/my_controllers.yaml b/config/my_controllers.yaml index 53551ef..9b13b48 100644 --- a/config/my_controllers.yaml +++ b/config/my_controllers.yaml @@ -1,7 +1,7 @@ controller_manager: ros__parameters: - update_rate: 50 - #use_sim_time: true + update_rate: 30 + # use_sim_time: true diff_cont: type: diff_drive_controller/DiffDriveController @@ -12,7 +12,7 @@ controller_manager: diff_cont: ros__parameters: - publish_rate: 50.0 + publish_rate: 50.0 base_frame_id: base_link @@ -21,20 +21,20 @@ diff_cont: wheel_separation: 0.18 wheel_radius: 0.035 - use_stamped_vel: false + # 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 + # 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: false + # enable_odom_tf: x # cmd_vel_timeout: x # publish_limited_velocity: x diff --git a/config/nav.rviz b/config/nav.rviz new file mode 100644 index 0000000..c7b5855 --- /dev/null +++ b/config/nav.rviz @@ -0,0 +1,328 @@ +Panels: + - Class: rviz_common/Displays + Help Height: 78 + Name: Displays + Property Tree Widget: + Expanded: + - /Global Options1 + Splitter Ratio: 0.5 + Tree Height: 99 + - 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 + - Class: nav2_rviz_plugins/Navigation 2 + Name: Navigation 2 +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: false + Filter (blacklist): "" + Filter (whitelist): "" + Frame Timeout: 15 + Frames: + All Enabled: true + Marker Scale: 1 + Name: TF + Show Arrows: true + Show Axes: true + Show Names: false + Tree: + {} + Update Interval: 0 + Value: false + - 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: + Class: rviz_default_plugins/Orbit + Distance: 18.47389030456543 + 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 + Pitch: 1.5697963237762451 + Target Frame: + Value: Orbit (rviz) + Yaw: 3.0736117362976074 + Saved: ~ +Window Geometry: + Camera: + collapsed: false + Displays: + collapsed: false + Height: 1011 + Hide Left Dock: false + Hide Right Dock: false + Navigation 2: + collapsed: false + QMainWindow State: 000000ff00000000fd00000004000000000000019000000351fc020000000afb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005d00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003f000000f1000000cc00fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb0000000c00430061006d00650072006101000001360000005c0000001700fffffffb00000018004e0061007600690067006100740069006f006e002000320100000198000001f8000001e300ffffff000000010000010f00000351fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000003f00000351000000a900fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e100000197000000030000073e0000003efc0100000002fb0000000800540069006d006501000000000000073e0000026f00fffffffb0000000800540069006d00650100000000000004500000000000000000000004930000035100000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 + Selection: + collapsed: false + Time: + collapsed: false + Tool Properties: + collapsed: false + Views: + collapsed: false + Width: 1854 + X: 66 + Y: 32 diff --git a/config/nav2_params.yaml b/config/nav2_params.yaml new file mode 100644 index 0000000..8d3edcb --- /dev/null +++ b/config/nav2_params.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 a4e1ffb..de4a397 100644 --- a/description/camera.xacro +++ b/description/camera.xacro @@ -32,23 +32,24 @@ 0 0 0 0 0 0 + true true - 30 + 10 - 0.933 + camera/camera_info + 1.089 R8G8B8 640 480 - 0.1 - 100.0 + 0.05 + 8.0 - - camera_link_optical - + camera/image_raw + camera_link_optical diff --git a/description/gazebo_control.xacro b/description/gazebo_control.xacro index 3501277..2d5bd93 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.035 - 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/imu.xacro b/description/imu.xacro index 1ab6eb3..8fd04b2 100644 --- a/description/imu.xacro +++ b/description/imu.xacro @@ -1,57 +1,22 @@ - + - - - + + - - - - - - - - + - - - - - + - - - - - - - - - - - - - - - true - 30 - true - - - - ~/out:=/imu/data - - imu_link - - - + + 1 + 1 + true + imu + - - + \ No newline at end of file diff --git a/description/lidar.xacro b/description/lidar.xacro index 6bea529..fd36c06 100644 --- a/description/lidar.xacro +++ b/description/lidar.xacro @@ -1,11 +1,12 @@ - + - + + @@ -21,17 +22,20 @@ + + + - + Gazebo/Black + + 0 0 0 0 0 0 - true + false + true 10 - + - - - 360 -3.14 3.14 @@ -41,15 +45,10 @@ 0.3 12 - - - - ~/out:=scan - - sensor_msgs/LaserScan - laser_frame - + + scan + laser_frame - Gazebo/Red + \ No newline at end of file diff --git a/description/robot.urdf.xacro b/description/robot.urdf.xacro index 6211f8c..3bf53af 100644 --- a/description/robot.urdf.xacro +++ b/description/robot.urdf.xacro @@ -1,13 +1,20 @@ + + + + + + + + - - + - + \ No newline at end of file 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 diff --git a/description/ros2_control.xacro b/description/ros2_control.xacro index c387af2..7cf72ad 100644 --- a/description/ros2_control.xacro +++ b/description/ros2_control.xacro @@ -5,30 +5,27 @@ diffdrive_arduino/DiffDriveArduinoHardware - - /dev/ttyACM0 - 57600 - 100 - 1286 - 30.0 - 0.035 - 0.180 left_wheel_joint right_wheel_joint - 0 - 0 - 0 - 0 + 30 + /dev/ttyUSB0 + 57600 + 1000 + 3436 - - + + -10 + 10 + - - + + -10 + 10 + @@ -38,7 +35,7 @@ - gazebo_ros2_control/GazeboSystem + gz_ros2_control/GazeboSimSystem @@ -60,10 +57,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 index 1c8f681..0359179 100644 --- a/launch/camera.launch.py +++ b/launch/camera.launch.py @@ -15,4 +15,3 @@ def generate_launch_description(): }] ) ]) - 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/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/joystick.launch.py b/launch/joystick.launch.py index 11f62c7..35bf401 100644 --- a/launch/joystick.launch.py +++ b/launch/joystick.launch.py @@ -1,34 +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", - name="joy_node", - output="screen", - ) + 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_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 - }] - ) + 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 + teleop_node, + twist_stamper ]) \ No newline at end of file diff --git a/launch/launch_robot.launch.py b/launch/launch_robot.launch.py index b0d9b8e..180d41b 100644 --- a/launch/launch_robot.launch.py +++ b/launch/launch_robot.launch.py @@ -25,9 +25,16 @@ def generate_launch_description(): rsp = IncludeLaunchDescription( PythonLaunchDescriptionSource([os.path.join( get_package_share_directory(package_name),'launch','rsp.launch.py' - )]), launch_arguments={'use_sim_time': 'false'}.items() + )]), 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", @@ -36,6 +43,9 @@ def generate_launch_description(): 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') @@ -49,12 +59,6 @@ def generate_launch_description(): 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", @@ -81,31 +85,31 @@ def generate_launch_description(): ) ) - 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], - ) - ) + # 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, - delayed_ekf_node, + delayed_joint_broad_spawner ]) \ No newline at end of file diff --git a/launch/launch_sim.launch.py b/launch/launch_sim.launch.py index 5b06eb1..36ce82c 100644 --- a/launch/launch_sim.launch.py +++ b/launch/launch_sim.launch.py @@ -4,8 +4,9 @@ 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 @@ -22,30 +23,53 @@ def generate_launch_description(): rsp = IncludeLaunchDescription( PythonLaunchDescriptionSource([os.path.join( get_package_share_directory(package_name),'launch','rsp.launch.py' - )]), launch_arguments={'use_sim_time': 'true'}.items() + )]), launch_arguments={'use_sim_time': 'true', 'use_ros2_control': 'true'}.items() ) - ekf_config = os.path.join( - get_package_share_directory(package_name), - 'config', - 'ekf.yaml' + joystick = IncludeLaunchDescription( + PythonLaunchDescriptionSource([os.path.join( + get_package_share_directory(package_name),'launch','joystick.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') + 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')] + ) + - # Include the Gazebo launch file, provided by the gazebo_ros package + 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('gazebo_ros'), 'launch', 'gazebo.launch.py')]), - launch_arguments={'extra_gazebo_args': '--ros-args --params-file ' + gazebo_params_file}.items() + 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 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', + # 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', - '-entity', 'my_bot'], + '-name', 'my_bot', + '-z', '0.1'], output='screen') + diff_drive_spawner = Node( package="controller_manager", executable="spawner", @@ -58,24 +82,35 @@ def generate_launch_description(): 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} - ], + + 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"] ) # Launch them all! return LaunchDescription([ rsp, + joystick, + twist_mux, + world_arg, gazebo, spawn_entity, diff_drive_spawner, joint_broad_spawner, - ekf_node, - ]) \ No newline at end of file + ros_gz_bridge, + ros_gz_image_bridge + ]) diff --git a/launch/localization_launch.py b/launch/localization_launch.py new file mode 100644 index 0000000..42afb5c --- /dev/null +++ b/launch/localization_launch.py @@ -0,0 +1,258 @@ +# 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 +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('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. + # 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')] + + 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/navigation_launch.py b/launch/navigation_launch.py new file mode 100644 index 0000000..f7c29a8 --- /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('articubot_two') + + 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, 'config', '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..3a54f4e --- /dev/null +++ b/launch/online_async_launch.py @@ -0,0 +1,89 @@ +import os + +from ament_index_python.packages import get_package_share_directory +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') + 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_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') + + start_async_slam_toolbox_node = LifecycleNode( + parameters=[ + 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', + 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_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/launch/rplidar.launch.py b/launch/rplidar.launch.py index e4edbd6..ccc0d74 100644 --- a/launch/rplidar.launch.py +++ b/launch/rplidar.launch.py @@ -16,4 +16,4 @@ def generate_launch_description(): 'scan_mode': 'Standard' }] ) - ]) + ]) \ No newline at end of file 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 diff --git a/map/map_save.pgm b/map/map_save.pgm new file mode 100644 index 0000000..5c11ad9 Binary files /dev/null and b/map/map_save.pgm differ 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 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 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/world.world b/worlds/world.world index b841d84..a22f54d 100644 --- a/worlds/world.world +++ b/worlds/world.world @@ -1,716 +1,254 @@ - - - - 1 - 0 0 10 0 -0 0 - 0.8 0.8 0.8 1 + + + + + + + 0.001 + 1.0 + + + + + + + + + + + ogre2 + + + + + + + 0 0 10 0 0 0 + true + 1 1 1 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 - - + + + + true + + 0 0 1 100 100 - - - 65535 - - - - - 100 - 50 - - - - - - - - 10 - - 0 + + 0 0 1 100 100 - - - + + 1.0 - 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 + + + + true + 0 6 1 0 0 0 + + - - 0.93 0.15 2.83 - + 12 0.2 2 - 10 - - - - - - - - - - - - - - -3.61 -10.98 2.69 0 -0 0 + + - - 1.09 0.15 0.28 - + 12 0.2 2 - 10 - - - - - - - - - - - - - - - -4.385 0.26 0.95 0 -0 0 + + 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 + + - - 1.03 1.03 1.52 - + 12 0.2 2 - 10 - - - - - - - - - - - - - + + - - model://cafe/meshes/cafe.dae - + 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 + - 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 + + + + true + 6 0 1 0 0 0 + + - - model://person_walking/meshes/walking.dae - + 0.2 12 2 - 10 - - - - - - - - - - - - - - 0 0 -0.02 0 -0 0 + + - - model://person_walking/meshes/walking.dae - + 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 + - 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 - - - + + + + true + -6 0 1 0 0 0 + + - - model://construction_barrel/meshes/construction_barrel.dae - + 0.2 12 2 - 10 - - - - - - - - - - - - - + + - - model://construction_barrel/meshes/construction_barrel.dae - + 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 + - 0 - 0 - 0 - 4.09493 -3.22559 0 0 -0 0 - - - + + + + true + -2 1 1 0 0 0 + + - - 10 10 10 - model://construction_cone/meshes/construction_cone.dae - + 0.2 6 2 - 10 - - - - - - - - - - - - - + + - - 10 10 10 - model://construction_cone/meshes/construction_cone.dae - + 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 + - 0 - - 0 0 0 0 -0 0 - - 1 - 0 - 0 - 1 - 0 - 1 - - 1 - - 0 - 0 - 3.46359 -4.77659 0 0 -0 0 - - - + + + + true + 2 -1 1 0 0 0 + + - - 10 10 10 - model://construction_cone/meshes/construction_cone.dae - + 0.2 6 2 - 10 - - - - - - - - - - - - - + + - - 10 10 10 - model://construction_cone/meshes/construction_cone.dae - + 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 + - 0 - - 0 0 0 0 -0 0 - - 1 - 0 - 0 - 1 - 0 - 1 - - 1 - - 0 - 0 - 4.20033 -3.94231 0 0 -0 0 - - - + + + + true + -4 -3 0.5 0 0 0 + + - - 10 10 10 - model://construction_cone/meshes/construction_cone.dae - + 1 1 1 - 10 - - - - - - - - - - - - - + + - - 10 10 10 - model://construction_cone/meshes/construction_cone.dae - + 1 1 1 + + 0.25 0.25 0.25 1 + 0.35 0.35 0.35 1 + - 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 - - + + + true + 4 3 0.5 0 0 0 + + - - model://fire_hydrant/meshes/fire_hydrant.dae - + 1 1 1 - 10 - - - - - - - - - - - - - + + - - model://fire_hydrant/meshes/fire_hydrant.dae - + 1 1 1 + + 0.25 0.25 0.25 1 + 0.35 0.35 0.35 1 + - 0 - 0 - 0 - -2.19394 -10.9756 0 0 -0 0 + - + \ No newline at end of file