├── LICENSE ├── README.md ├── drone ├── drone_control │ ├── drone_control │ │ ├── __init__.py │ │ └── drone_control.py │ ├── package.xml │ ├── resource │ │ └── drone_control │ ├── setup.cfg │ ├── setup.py │ └── test │ │ ├── test_copyright.py │ │ ├── test_flake8.py │ │ └── test_pep257.py ├── sjtu_drone_bringup │ ├── launch │ │ ├── sjtu_drone_bringup.launch.py │ │ └── sjtu_drone_gazebo.launch.py │ ├── package.xml │ ├── resource │ │ └── sjtu_drone_bringup │ ├── rviz │ │ └── rviz.rviz │ ├── setup.cfg │ ├── setup.py │ ├── sjtu_drone_bringup │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-310.pyc │ │ │ └── spawn_drone.cpython-310.pyc │ │ └── spawn_drone.py │ └── test │ │ ├── test_copyright.py │ │ ├── test_flake8.py │ │ └── test_pep257.py └── sjtu_drone_description │ ├── .gitignore │ ├── CMakeLists.txt │ ├── LICENSE │ ├── README.md │ ├── include │ ├── pid_controller.h │ └── plugin_drone.h │ ├── models │ ├── database.config │ └── sjtu_drone │ │ ├── model.config │ │ ├── quadrotor_4.dae │ │ ├── quadrotor_4.stl │ │ └── sjtu_drone.sdf │ ├── package.xml │ ├── src │ ├── .vscode │ │ ├── c_cpp_properties.json │ │ └── settings.json │ ├── pid_controller.cpp │ └── plugin_drone.cpp │ ├── urdf │ ├── sjtu_drone.urdf │ └── sjtu_drone.urdf.xacro │ └── worlds │ └── playground.world ├── merge_map ├── config │ └── merge_map.rviz ├── launch │ └── merge_map_launch.py ├── merge_map │ ├── __init__.py │ └── merge_map.py ├── package.xml ├── resource │ └── merge_map ├── setup.cfg ├── setup.py └── test │ ├── test_copyright.py │ ├── test_flake8.py │ └── test_pep257.py ├── multi_robot_exploration ├── multi_robot_exploration │ ├── __init__.py │ └── control.py ├── package.xml ├── resource │ └── multi_robot_exploration ├── setup.cfg ├── setup.py └── test │ ├── test_copyright.py │ ├── test_flake8.py │ └── test_pep257.py ├── path_follow ├── package.xml ├── path_follow │ ├── __init__.py │ └── path_follow.py ├── resource │ └── path_follow ├── setup.cfg ├── setup.py └── test │ ├── test_copyright.py │ ├── test_flake8.py │ └── test_pep257.py ├── readme-tr.md └── turtlebot3_gazebo ├── CHANGELOG.rst ├── CMakeLists.txt ├── config ├── tb3_0.rviz └── tb3_1.rviz ├── include └── turtlebot3_gazebo │ └── turtlebot3_drive.hpp ├── launch ├── multi_robot_launch.py ├── robot_state_publisher.launch.py └── spawn_turtlebot3.launch.py ├── models ├── turtlebot3_burger_0 │ ├── model-1_4.sdf │ ├── model.config │ └── model.sdf ├── turtlebot3_burger_1 │ ├── model-1_4.sdf │ ├── model.config │ └── model.sdf ├── turtlebot3_common │ ├── meshes │ │ ├── burger_base.dae │ │ ├── lds.dae │ │ ├── r200.dae │ │ ├── tire.dae │ │ ├── waffle_base.dae │ │ └── waffle_pi_base.dae │ └── model.config ├── turtlebot3_dqn_world │ ├── goal_box │ │ ├── model.config │ │ └── model.sdf │ ├── inner_walls │ │ ├── model.config │ │ └── model.sdf │ ├── model.config │ ├── model.sdf │ ├── obstacle1 │ │ ├── model.config │ │ └── model.sdf │ ├── obstacle2 │ │ ├── model.config │ │ └── model.sdf │ ├── obstacle_plugin │ │ ├── CMakeLists.txt │ │ ├── obstacle1.cc │ │ ├── obstacle2.cc │ │ └── obstacles.cc │ └── obstacles │ │ ├── model.config │ │ └── model.sdf ├── turtlebot3_house │ ├── model.config │ └── model.sdf ├── turtlebot3_waffle │ ├── model-1_4.sdf │ ├── model.config │ └── model.sdf ├── turtlebot3_waffle_pi │ ├── model-1_4_.sdf │ ├── model.config │ └── model.sdf └── turtlebot3_world │ ├── meshes │ ├── hexagon.dae │ └── wall.dae │ ├── model-1_4.sdf │ ├── model.config │ └── model.sdf ├── package.xml ├── rviz └── tb3_gazebo.rviz ├── src └── turtlebot3_drive.cpp ├── urdf ├── common_properties.urdf ├── turtlebot3_burger.urdf ├── turtlebot3_waffle.urdf └── turtlebot3_waffle_pi.urdf └── worlds ├── empty_world.world ├── turtlebot3_dqn_stage1.world ├── turtlebot3_dqn_stage2.world ├── turtlebot3_dqn_stage3.world ├── turtlebot3_dqn_stage4.world ├── turtlebot3_house.world └── turtlebot3_world.world /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Abdulkadir TÜRE 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Multi Robot Exploration 2 | ![pic](https://user-images.githubusercontent.com/87595266/232087653-15e75801-908e-4017-930c-543008c47192.png) 3 | 4 | [tr-readme](https://github.com/abdulkadrtr/multiRobotExploration/blob/main/readme-tr.md) 5 | 6 | The Autonomous Exploration Army project is a cutting-edge initiative that aims to create a team of robotic vehicles for autonomous exploration. The team consists of 1 aerial vehicle, or drone, and 2 ground vehicles, which work collaboratively to map and explore unknown areas. Equipped with lidar sensors, the ground vehicles are responsible for mapping the terrain, while the aerial vehicle provides aerial imaging support to monitor the ground vehicles from above. 7 | 8 | The heart of the system is the Autonomous Exploration Control Center, which centrally manages all the robots. It sends messages to the ground vehicles, providing them with optimal routes for exploration based on the combined maps obtained from the ground vehicles. Additionally, it receives camera images from the aerial vehicle, allowing it to have a comprehensive view of the entire area. 9 | 10 | Using this coordinated approach, the Autonomous Exploration Control Center commands the aerial vehicle to position itself in a strategic location where it can have a clear view of both ground vehicles. This enables the team to effectively explore and map the entire area. The merged maps from the ground vehicles and the aerial imagery provide a consolidated map of the environment, allowing for further analysis and decision-making. 11 | 12 | The utilization of ROS 2 and Gazebo simulation environment in this project has facilitated realistic simulations for testing and development of the autonomous exploration army. This cutting-edge project showcases the power of autonomous robotics in exploring unknown terrains and gathering valuable information, with potential applications in fields such as search and rescue, environmental monitoring, and more. 13 | 14 | In conclusion, the Autonomous Exploration Army project demonstrates the capabilities of a team of autonomous robotic vehicles working together to explore and map unknown areas. With the use of advanced technologies such as lidar sensors, aerial imaging, and centralized control, this project has the potential to revolutionize the field of exploration and create new opportunities for autonomous robotics. 15 | 16 | The project utilized the TurtleBot3 model and the SJTU Drone model for implementation. 17 | 18 | # How Does It Work 19 | 20 | 21 | To run the project, you will need to have ROS2 and Gazebo simulation installed on your system. Follow the instructions below: 22 | 23 | 1 - Install ROS2 and Gazebo simulation on your system. 24 | 25 | 2 - Create a ROS2 workspace (e.g., `ros2_ws`) and inside the workspace, create a src directory. 26 | 27 | 3 - Clone the project repository to the src directory using the following command: 28 | 29 | `git clone https://github.com/abdulkadrtr/multiRobotExploration.git` 30 | 31 | 4 - Build the project using colcon build command in the ros2_ws directory: 32 | 33 | `cd ros2_ws` 34 | 35 | `colcon build` 36 | 37 | 5 - Source the project using the following command: `source install/setup.bash` 38 | 39 | 6 - Launch the Gazebo environment and robots using the following command in a new terminal: 40 | 41 | `ros2 launch turtlebot3_gazebo multi_robot_launch.py` 42 | 43 | 7 - Launch the map merging package using the following command in another terminal: 44 | 45 | `ros2 launch merge_map merge_map_launch.py` 46 | 47 | This will start the map merging process and display the merged map in an RViz2 window, along with the real-time paths of the robots and the live image feed from the drone. 48 | 49 | 8 - Finally, in a third terminal, run the following command to start the autonomous exploration center: 50 | 51 | `ros2 run multi_robot_exploration control` 52 | 53 | With these steps, your project is now up and running, and the robots will start autonomously exploring the environment and merging maps to create a single map for visualization. 54 | 55 | # Youtube Project Introduction & Demo 56 | 57 | You can watch the video below for demo and detailed project presentation. 58 | 59 | https://youtu.be/6FtEvvi4lk4 60 | 61 | # A scene from the robots work 62 | 63 | ![Screenshot from 2023-04-14 15-09-45](https://user-images.githubusercontent.com/87595266/232044431-143e2592-d4f9-404b-89fd-243b9af53d68.png) 64 | 65 | # ROS 2 communication network 66 | 67 | ![rosgraph](https://user-images.githubusercontent.com/87595266/232061251-64c3ed55-8297-4057-86f8-11599ae4cfa8.svg) 68 | -------------------------------------------------------------------------------- /drone/drone_control/drone_control/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abdulkadrtr/multiRobotExploration-RobotArmy/8dd94741de5b012dfa99ad6bacb0050d00e29742/drone/drone_control/drone_control/__init__.py -------------------------------------------------------------------------------- /drone/drone_control/drone_control/drone_control.py: -------------------------------------------------------------------------------- 1 | import rclpy 2 | from rclpy.node import Node 3 | from geometry_msgs.msg import Pose 4 | from std_msgs.msg import Empty 5 | from geometry_msgs.msg import Twist 6 | import time 7 | 8 | class DroneController(Node): 9 | def __init__(self): 10 | super().__init__('drone_controller') 11 | self.subscription = self.create_subscription(Pose,'drone/gt_pose',self.odom_callback,1) 12 | self.subscription = self.create_subscription(Pose,'drone/target_pose',self.target,10) 13 | self.publisher_takeoff = self.create_publisher(Empty, '/drone/takeoff', 10) 14 | self.publisher_drone_cmd_vel = self.create_publisher(Twist, '/drone/cmd_vel', 10) 15 | self.subscription 16 | self.Kp = 0.6 17 | self.Ki = 0.0 18 | self.Kd = 0.0 19 | self.error_x = 0.0 20 | self.error_y = 0.0 21 | self.error_z = 0.0 22 | self.integral_x = 0.0 23 | self.integral_y = 0.0 24 | self.integral_z = 0.0 25 | self.derivative_x = 0.0 26 | self.derivative_y = 0.0 27 | self.derivative_z = 0.0 28 | self.flag = 0 29 | 30 | def odom_callback(self, msg): 31 | self.x = msg.position.x 32 | self.y = msg.position.y 33 | self.z = msg.position.z 34 | 35 | def target(self, msg): 36 | self.target_x = msg.position.x 37 | self.target_y = msg.position.y 38 | self.target_z = msg.position.z 39 | self.timer = self.create_timer(0.2, self.go_pose) 40 | 41 | def go_pose(self): 42 | if self.flag == 0: 43 | self.flag = 1 44 | msg = Empty() 45 | self.publisher_takeoff.publish(msg) 46 | time.sleep(3) 47 | self.error_x = self.target_x - self.x 48 | self.error_y = self.target_y - self.y 49 | self.error_z = self.target_z - self.z 50 | self.integral_x += self.error_x * 0.1 51 | self.integral_y += self.error_y * 0.1 52 | self.integral_z += self.error_z * 0.1 53 | self.derivative_x = (self.error_x - self.derivative_x) / 0.1 54 | self.derivative_y = (self.error_y - self.derivative_y) / 0.1 55 | self.derivative_z = (self.error_z - self.derivative_z) / 0.1 56 | v_x = self.Kp * self.error_x + self.Ki * self.integral_x + self.Kd * self.derivative_x 57 | v_y = self.Kp * self.error_y + self.Ki * self.integral_y + self.Kd * self.derivative_y 58 | v_z = self.Kp * self.error_z + self.Ki * self.integral_z + self.Kd * self.derivative_z 59 | msg = Twist() 60 | msg.linear.x = v_x 61 | msg.linear.y = v_y 62 | msg.linear.z = v_z 63 | self.publisher_drone_cmd_vel.publish(msg) 64 | if self.error_x < 0.3 and self.error_y < 0.3 and self.error_z < 0.3: 65 | msg.linear.x = 0.0 66 | msg.linear.y = 0.0 67 | msg.linear.z = -0.001 68 | self.publisher_drone_cmd_vel.publish(msg) 69 | self.timer.cancel() 70 | 71 | 72 | 73 | 74 | def main(args=None): 75 | rclpy.init(args=args) 76 | drone_controller = DroneController() 77 | rclpy.spin(drone_controller) 78 | drone_controller.destroy_node() 79 | rclpy.shutdown() 80 | 81 | if __name__ == '__main__': 82 | main() 83 | -------------------------------------------------------------------------------- /drone/drone_control/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | drone_control 5 | 0.0.0 6 | TODO: Package description 7 | abd 8 | TODO: License declaration 9 | 10 | ament_copyright 11 | ament_flake8 12 | ament_pep257 13 | python3-pytest 14 | 15 | 16 | ament_python 17 | 18 | 19 | -------------------------------------------------------------------------------- /drone/drone_control/resource/drone_control: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abdulkadrtr/multiRobotExploration-RobotArmy/8dd94741de5b012dfa99ad6bacb0050d00e29742/drone/drone_control/resource/drone_control -------------------------------------------------------------------------------- /drone/drone_control/setup.cfg: -------------------------------------------------------------------------------- 1 | [develop] 2 | script_dir=$base/lib/drone_control 3 | [install] 4 | install_scripts=$base/lib/drone_control 5 | -------------------------------------------------------------------------------- /drone/drone_control/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | package_name = 'drone_control' 4 | 5 | setup( 6 | name=package_name, 7 | version='0.0.0', 8 | packages=[package_name], 9 | data_files=[ 10 | ('share/ament_index/resource_index/packages', 11 | ['resource/' + package_name]), 12 | ('share/' + package_name, ['package.xml']), 13 | ], 14 | install_requires=['setuptools'], 15 | zip_safe=True, 16 | maintainer='abd', 17 | maintainer_email='abd@todo.todo', 18 | description='TODO: Package description', 19 | license='TODO: License declaration', 20 | tests_require=['pytest'], 21 | entry_points={ 22 | 'console_scripts': [ 23 | 'drone_control = drone_control.drone_control:main' 24 | ], 25 | }, 26 | ) 27 | -------------------------------------------------------------------------------- /drone/drone_control/test/test_copyright.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Open Source Robotics Foundation, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from ament_copyright.main import main 16 | import pytest 17 | 18 | 19 | # Remove the `skip` decorator once the source file(s) have a copyright header 20 | @pytest.mark.skip(reason='No copyright header has been placed in the generated source file.') 21 | @pytest.mark.copyright 22 | @pytest.mark.linter 23 | def test_copyright(): 24 | rc = main(argv=['.', 'test']) 25 | assert rc == 0, 'Found errors' 26 | -------------------------------------------------------------------------------- /drone/drone_control/test/test_flake8.py: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Open Source Robotics Foundation, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from ament_flake8.main import main_with_errors 16 | import pytest 17 | 18 | 19 | @pytest.mark.flake8 20 | @pytest.mark.linter 21 | def test_flake8(): 22 | rc, errors = main_with_errors(argv=[]) 23 | assert rc == 0, \ 24 | 'Found %d code style errors / warnings:\n' % len(errors) + \ 25 | '\n'.join(errors) 26 | -------------------------------------------------------------------------------- /drone/drone_control/test/test_pep257.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Open Source Robotics Foundation, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from ament_pep257.main import main 16 | import pytest 17 | 18 | 19 | @pytest.mark.linter 20 | @pytest.mark.pep257 21 | def test_pep257(): 22 | rc = main(argv=['.', 'test']) 23 | assert rc == 0, 'Found code style errors / warnings' 24 | -------------------------------------------------------------------------------- /drone/sjtu_drone_bringup/launch/sjtu_drone_bringup.launch.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import os 4 | 5 | from ament_index_python.packages import get_package_share_directory 6 | from launch import LaunchDescription 7 | from launch.actions import IncludeLaunchDescription 8 | from launch.substitutions import LaunchConfiguration 9 | from launch_ros.actions import Node 10 | from launch.launch_description_sources import PythonLaunchDescriptionSource 11 | 12 | 13 | def generate_launch_description(): 14 | 15 | use_sim_time = LaunchConfiguration("use_sim_time", default="false") 16 | sjtu_drone_bringup_path = get_package_share_directory('sjtu_drone_bringup') 17 | 18 | rviz_path = os.path.join( 19 | sjtu_drone_bringup_path, "rviz", "rviz.rviz" 20 | ) 21 | 22 | return LaunchDescription([ 23 | Node( 24 | package="rviz2", 25 | executable="rviz2", 26 | name="rviz2", 27 | arguments=[ 28 | "-d", rviz_path 29 | ], 30 | output="screen", 31 | ), 32 | 33 | IncludeLaunchDescription( 34 | PythonLaunchDescriptionSource( 35 | os.path.join(sjtu_drone_bringup_path, 'launch', 'sjtu_drone_gazebo.launch.py') 36 | ) 37 | ), 38 | 39 | Node( 40 | package="teleop_twist_keyboard", 41 | executable="teleop_twist_keyboard", 42 | namespace="drone", 43 | output="screen", 44 | prefix="xterm -e" 45 | ) 46 | ]) -------------------------------------------------------------------------------- /drone/sjtu_drone_bringup/launch/sjtu_drone_gazebo.launch.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import os 4 | 5 | from ament_index_python.packages import get_package_share_directory 6 | from launch import LaunchDescription 7 | from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription 8 | from launch.substitutions import LaunchConfiguration 9 | from launch_ros.actions import Node 10 | from launch.launch_description_sources import PythonLaunchDescriptionSource 11 | 12 | import xacro 13 | 14 | def generate_launch_description(): 15 | 16 | use_sim_time = LaunchConfiguration("use_sim_time", default="false") 17 | xacro_file_name = "sjtu_drone.urdf.xacro" 18 | pkg_gazebo_ros = get_package_share_directory('gazebo_ros') 19 | xacro_file = os.path.join( 20 | get_package_share_directory("sjtu_drone_description"), 21 | "urdf", xacro_file_name 22 | ) 23 | robot_description_config = xacro.process_file(xacro_file) 24 | robot_desc = robot_description_config.toxml() 25 | model_ns = "drone" 26 | 27 | world_file = os.path.join( 28 | get_package_share_directory("sjtu_drone_description"), 29 | "worlds", "playground.world" 30 | ) 31 | 32 | return LaunchDescription([ 33 | Node( 34 | package="robot_state_publisher", 35 | executable="robot_state_publisher", 36 | name="robot_state_publisher", 37 | namespace=model_ns, 38 | output="screen", 39 | parameters=[{"use_sim_time": use_sim_time, "robot_description": robot_desc}], 40 | arguments=[robot_desc] 41 | ), 42 | 43 | Node( 44 | package='joint_state_publisher', 45 | executable='joint_state_publisher', 46 | name='joint_state_publisher', 47 | namespace=model_ns, 48 | output='screen', 49 | ), 50 | #IncludeLaunchDescription(PythonLaunchDescriptionSource(os.path.join(pkg_gazebo_ros, 'launch', 'gzserver.launch.py')),launch_arguments={'world': world_file,'verbose': "true",'extra_gazebo_args': 'verbose'}.items()), 51 | 52 | #IncludeLaunchDescription(PythonLaunchDescriptionSource(os.path.join(pkg_gazebo_ros, 'launch', 'gzclient.launch.py')),launch_arguments={'verbose': "true"}.items()), 53 | Node( 54 | package="sjtu_drone_bringup", 55 | executable="spawn_drone", 56 | arguments=[robot_desc, model_ns,'-4.0','-4.0'], 57 | output="screen" 58 | ) 59 | ]) -------------------------------------------------------------------------------- /drone/sjtu_drone_bringup/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | sjtu_drone_bringup 5 | 0.0.0 6 | TODO: Package description 7 | ubuntu 8 | TODO: License declaration 9 | 10 | rclpy 11 | xacro 12 | rviz2 13 | xterm 14 | imu_tools 15 | teleop_twist_keyboard 16 | robot_state_publisher 17 | joint_state_publisher 18 | 19 | ament_copyright 20 | ament_flake8 21 | ament_pep257 22 | python3-pytest 23 | 24 | 25 | ament_python 26 | 27 | 28 | -------------------------------------------------------------------------------- /drone/sjtu_drone_bringup/resource/sjtu_drone_bringup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abdulkadrtr/multiRobotExploration-RobotArmy/8dd94741de5b012dfa99ad6bacb0050d00e29742/drone/sjtu_drone_bringup/resource/sjtu_drone_bringup -------------------------------------------------------------------------------- /drone/sjtu_drone_bringup/setup.cfg: -------------------------------------------------------------------------------- 1 | [develop] 2 | script_dir=$base/lib/sjtu_drone_bringup 3 | [install] 4 | install_scripts=$base/lib/sjtu_drone_bringup 5 | -------------------------------------------------------------------------------- /drone/sjtu_drone_bringup/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | from glob import glob 3 | import os 4 | 5 | package_name = 'sjtu_drone_bringup' 6 | 7 | setup( 8 | name=package_name, 9 | version='0.0.0', 10 | packages=[package_name], 11 | data_files=[ 12 | ('share/ament_index/resource_index/packages', 13 | ['resource/' + package_name]), 14 | ('share/' + package_name, ['package.xml']), 15 | (os.path.join('share', package_name, "launch"), glob('launch/*launch.[pxy][yma]*')), 16 | (os.path.join('share', package_name, "rviz"), glob('rviz/*.rviz')) 17 | ], 18 | install_requires=['setuptools'], 19 | zip_safe=True, 20 | maintainer='ubuntu', 21 | maintainer_email='georg.novtony@aon.at', 22 | description='TODO: Package description', 23 | license='TODO: License declaration', 24 | tests_require=['pytest'], 25 | entry_points={ 26 | 'console_scripts': [ 27 | 'spawn_drone = sjtu_drone_bringup.spawn_drone:main', 28 | ], 29 | }, 30 | ) 31 | -------------------------------------------------------------------------------- /drone/sjtu_drone_bringup/sjtu_drone_bringup/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abdulkadrtr/multiRobotExploration-RobotArmy/8dd94741de5b012dfa99ad6bacb0050d00e29742/drone/sjtu_drone_bringup/sjtu_drone_bringup/__init__.py -------------------------------------------------------------------------------- /drone/sjtu_drone_bringup/sjtu_drone_bringup/__pycache__/__init__.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abdulkadrtr/multiRobotExploration-RobotArmy/8dd94741de5b012dfa99ad6bacb0050d00e29742/drone/sjtu_drone_bringup/sjtu_drone_bringup/__pycache__/__init__.cpython-310.pyc -------------------------------------------------------------------------------- /drone/sjtu_drone_bringup/sjtu_drone_bringup/__pycache__/spawn_drone.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abdulkadrtr/multiRobotExploration-RobotArmy/8dd94741de5b012dfa99ad6bacb0050d00e29742/drone/sjtu_drone_bringup/sjtu_drone_bringup/__pycache__/spawn_drone.cpython-310.pyc -------------------------------------------------------------------------------- /drone/sjtu_drone_bringup/sjtu_drone_bringup/spawn_drone.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | import os 4 | import sys 5 | import rclpy 6 | from gazebo_msgs.srv import SpawnEntity 7 | from geometry_msgs.msg import Pose 8 | 9 | def main(args=None): 10 | rclpy.init(args=args) 11 | node = rclpy.create_node('spawn_drone') 12 | cli = node.create_client(SpawnEntity, '/spawn_entity') 13 | 14 | content = sys.argv[1] 15 | namespace = sys.argv[2] 16 | x = float(sys.argv[3]) # X koordinatını float olarak dönüştür 17 | y = float(sys.argv[4]) # Y koordinatını float olarak dönüştür 18 | 19 | req = SpawnEntity.Request() 20 | req.name = namespace 21 | req.xml = content 22 | req.robot_namespace = namespace 23 | req.reference_frame = "world" 24 | pose = Pose() 25 | pose.position.x = x # X koordinatını güncelle 26 | pose.position.y = y # Y koordinatını güncelle 27 | pose.position.z = 0.0 # Z koordinatını varsayılan olarak 0.0 olarak belirle 28 | req.initial_pose = pose 29 | 30 | while not cli.wait_for_service(timeout_sec=1.0): 31 | node.get_logger().info('service not available, waiting again...') 32 | 33 | future = cli.call_async(req) 34 | rclpy.spin_until_future_complete(node, future) 35 | 36 | if future.result() is not None: 37 | node.get_logger().info( 38 | 'Result ' + str(future.result().success) + " " + future.result().status_message) 39 | else: 40 | node.get_logger().info('Service call failed %r' % (future.exception(),)) 41 | 42 | node.destroy_node() 43 | rclpy.shutdown() 44 | 45 | 46 | if __name__ == '__main__': 47 | main() 48 | -------------------------------------------------------------------------------- /drone/sjtu_drone_bringup/test/test_copyright.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Open Source Robotics Foundation, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from ament_copyright.main import main 16 | import pytest 17 | 18 | 19 | # Remove the `skip` decorator once the source file(s) have a copyright header 20 | @pytest.mark.skip(reason='No copyright header has been placed in the generated source file.') 21 | @pytest.mark.copyright 22 | @pytest.mark.linter 23 | def test_copyright(): 24 | rc = main(argv=['.', 'test']) 25 | assert rc == 0, 'Found errors' 26 | -------------------------------------------------------------------------------- /drone/sjtu_drone_bringup/test/test_flake8.py: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Open Source Robotics Foundation, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from ament_flake8.main import main_with_errors 16 | import pytest 17 | 18 | 19 | @pytest.mark.flake8 20 | @pytest.mark.linter 21 | def test_flake8(): 22 | rc, errors = main_with_errors(argv=[]) 23 | assert rc == 0, \ 24 | 'Found %d code style errors / warnings:\n' % len(errors) + \ 25 | '\n'.join(errors) 26 | -------------------------------------------------------------------------------- /drone/sjtu_drone_bringup/test/test_pep257.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Open Source Robotics Foundation, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from ament_pep257.main import main 16 | import pytest 17 | 18 | 19 | @pytest.mark.linter 20 | @pytest.mark.pep257 21 | def test_pep257(): 22 | rc = main(argv=['.', 'test']) 23 | assert rc == 0, 'Found code style errors / warnings' 24 | -------------------------------------------------------------------------------- /drone/sjtu_drone_description/.gitignore: -------------------------------------------------------------------------------- 1 | plugins/ 2 | bin/ 3 | 4 | -------------------------------------------------------------------------------- /drone/sjtu_drone_description/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.8) 2 | project(sjtu_drone_description) 3 | 4 | if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") 5 | add_compile_options(-Wall -Wextra -Wpedantic) 6 | endif() 7 | 8 | include (FindPkgConfig) 9 | if (PKG_CONFIG_FOUND) 10 | pkg_check_modules(OGRE OGRE) 11 | pkg_check_modules(OGRE-Terrain OGRE-Terrain) 12 | endif() 13 | 14 | # find dependencies 15 | find_package(ament_cmake REQUIRED) 16 | find_package(ament_cmake_ros REQUIRED) 17 | find_package(rclcpp REQUIRED) 18 | find_package(gazebo_ros REQUIRED) 19 | find_package(gazebo_plugins REQUIRED) 20 | find_package(gazebo_dev REQUIRED) 21 | find_package(std_msgs REQUIRED) 22 | find_package(geometry_msgs REQUIRED) 23 | find_package(sensor_msgs REQUIRED) 24 | 25 | 26 | link_directories(${GAZEBO_LIBRARY_DIRS} ${Boost_LIBRARIES} ${PROTOBUF_LIBRARIES} ${OGRE_LIBRARY_DIRS}) 27 | include_directories(${OpenCV_INCLUDE_DIR} 28 | ${Boost_INCLUDE_DIR} 29 | ${catkin_INCLUDE_DIRS} 30 | ${GAZEBO_INCLUDE_DIRS} 31 | ${OGRE_INCLUDE_DIRS} 32 | ${OGRE-Terrain_INCLUDE_DIRS} 33 | include) 34 | 35 | 36 | 37 | ################## 2. A simple model controller for the quadrotor ############# 38 | add_library( plugin_drone SHARED 39 | src/plugin_drone.cpp 40 | src/pid_controller.cpp 41 | include/plugin_drone.h 42 | include/pid_controller.h 43 | ) 44 | 45 | 46 | target_compile_features(plugin_drone PUBLIC c_std_99 cxx_std_17) # Require C99 and C++17 47 | target_include_directories(plugin_drone PUBLIC 48 | $ 49 | $) 50 | ament_target_dependencies(plugin_drone 51 | "rclcpp" 52 | "gazebo_ros" 53 | "gazebo_plugins" 54 | "gazebo_dev" 55 | "std_msgs" 56 | "geometry_msgs" 57 | "sensor_msgs" 58 | ) 59 | 60 | 61 | # Causes the visibility macros to use dllexport rather than dllimport, 62 | # which is appropriate when building the dll but not consuming it. 63 | target_compile_definitions(plugin_drone PRIVATE "SJTU_DRONE_BUILDING_LIBRARY") 64 | 65 | install( 66 | DIRECTORY include/ 67 | DESTINATION include 68 | ) 69 | install( 70 | TARGETS plugin_drone 71 | EXPORT export_${PROJECT_NAME} 72 | ARCHIVE DESTINATION lib 73 | LIBRARY DESTINATION lib 74 | RUNTIME DESTINATION bin 75 | ) 76 | 77 | if(BUILD_TESTING) 78 | find_package(ament_lint_auto REQUIRED) 79 | # the following line skips the linter which checks for copyrights 80 | # comment the line when a copyright and license is added to all source files 81 | set(ament_cmake_copyright_FOUND TRUE) 82 | # the following line skips cpplint (only works in a git repo) 83 | # comment the line when this package is in a git repo and when 84 | # a copyright and license is added to all source files 85 | set(ament_cmake_cpplint_FOUND TRUE) 86 | ament_lint_auto_find_test_dependencies() 87 | endif() 88 | 89 | set_target_properties(plugin_drone 90 | PROPERTIES 91 | LIBRARY_OUTPUT_DIRECTORY 92 | ${PROJECT_SOURCE_DIR}/plugins 93 | ) 94 | 95 | ament_export_include_directories( 96 | include 97 | ) 98 | ament_export_libraries( 99 | plugin_drone 100 | ) 101 | ament_export_targets( 102 | export_${PROJECT_NAME} 103 | ) 104 | 105 | 106 | install( 107 | DIRECTORY models urdf worlds 108 | DESTINATION share/${PROJECT_NAME} 109 | ) 110 | ament_package() 111 | -------------------------------------------------------------------------------- /drone/sjtu_drone_description/README.md: -------------------------------------------------------------------------------- 1 | # sjtu_drone_description 2 | 3 | This package contains the xacro/urdf/sdf model description of the sjtu drone and the corresponding plugin for Gazebo 11 and ROS 2 Humble. 4 | 5 | 6 | ## Structure 7 | 8 | * __models__: Gazebo sdf model and model meshes 9 | * __include__: Header files for the PID controller and drone plugin 10 | * __src__: Source code for the drone plugin and PID controller 11 | * __urdf__: Xacro and urdf model description files 12 | * __worlds__: Contains one playground world 13 | 14 | 15 | ## Worlds 16 | To fully load the world you need to donwload the gazebo models first: 17 | ``` 18 | curl -L https://github.com/osrf/gazebo_models/archive/refs/heads/master.zip -o /tmp/gazebo_models.zip \ 19 | && unzip /tmp/gazebo_models.zip -d /tmp && mkdir -p ~/.gazebo/models/ && mv /tmp/gazebo_models-master/* ~/.gazebo/models/ \ 20 | && rm -r /tmp/gazebo_models.zip 21 | ``` 22 | 23 | ## TF Tree 24 | 25 | ![TF Tree](../imgs/tf_tree.png) -------------------------------------------------------------------------------- /drone/sjtu_drone_description/include/pid_controller.h: -------------------------------------------------------------------------------- 1 | #ifndef PIDCONTROLLER_H 2 | #define PIDCONTROLLER_H 3 | 4 | 5 | #include 6 | #include 7 | 8 | class PIDController { 9 | public: 10 | PIDController(); 11 | virtual ~PIDController(); 12 | virtual void Load(sdf::ElementPtr _sdf, const std::string& prefix = ""); 13 | 14 | double gain_p; 15 | double gain_i; 16 | double gain_d; 17 | double time_constant; 18 | double limit; 19 | 20 | double input; 21 | double dinput; 22 | double output; 23 | double p, i, d; 24 | 25 | double update(double input, double x, double dx, double dt); 26 | void reset(); 27 | }; 28 | 29 | #endif // PIDCONTROLLER_H 30 | -------------------------------------------------------------------------------- /drone/sjtu_drone_description/include/plugin_drone.h: -------------------------------------------------------------------------------- 1 | #ifndef PLUGIN_DRONE_H 2 | #define PLUGIN_DRONE_H 3 | 4 | #include "gazebo/gazebo.hh" 5 | #include "gazebo/physics/physics.hh" 6 | #include "gazebo/common/Events.hh" 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | #include "pid_controller.h" 19 | 20 | #define LANDED_MODEL 0 21 | #define FLYING_MODEL 1 22 | #define TAKINGOFF_MODEL 2 23 | #define LANDING_MODEL 3 24 | 25 | using namespace std::placeholders; 26 | 27 | namespace gazebo 28 | { 29 | class DroneSimpleController : public ModelPlugin 30 | { 31 | public: 32 | DroneSimpleController(); 33 | virtual ~DroneSimpleController(); 34 | 35 | protected: 36 | virtual void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf); 37 | virtual void LoadControllerSettings(physics::ModelPtr _model, sdf::ElementPtr _sdf); 38 | virtual void Update(); 39 | void UpdateDynamics(double dt); 40 | void UpdateState(double dt); 41 | virtual void Reset(); 42 | 43 | private: 44 | double m_timeAfterCmd; 45 | bool m_posCtrl; 46 | bool m_velMode; 47 | unsigned int navi_state; 48 | 49 | /// \brief The parent World 50 | physics::WorldPtr world; 51 | 52 | /// \brief The link referred to by this plugin 53 | physics::LinkPtr link; 54 | 55 | std::shared_ptr executor_; 56 | std::shared_ptr node_handle_; 57 | rclcpp::CallbackGroup::SharedPtr callback_group_; 58 | rclcpp::Subscription::SharedPtr cmd_subscriber_; 59 | rclcpp::Subscription::SharedPtr posctrl_subscriber_; 60 | rclcpp::Subscription::SharedPtr imu_subscriber_; 61 | 62 | // extra robot control command 63 | rclcpp::Subscription::SharedPtr takeoff_subscriber_; 64 | rclcpp::Subscription::SharedPtr land_subscriber_; 65 | rclcpp::Subscription::SharedPtr reset_subscriber_; 66 | rclcpp::Subscription::SharedPtr switch_mode_subscriber_; 67 | 68 | rclcpp::Publisher::SharedPtr pub_gt_pose_; //for publishing ground truth pose 69 | rclcpp::Publisher::SharedPtr pub_gt_vec_; //ground truth velocity in the body frame 70 | rclcpp::Publisher::SharedPtr pub_gt_acc_; //ground truth acceleration in the body frame 71 | 72 | geometry_msgs::msg::Twist cmd_val; 73 | // callback functions for subscribers 74 | void CmdCallback(const geometry_msgs::msg::Twist::SharedPtr msg); 75 | void PosCtrlCallback(const std_msgs::msg::Bool::SharedPtr msg); 76 | void ImuCallback(const sensor_msgs::msg::Imu::SharedPtr msg); 77 | void TakeoffCallback(const std_msgs::msg::Empty::SharedPtr msg); 78 | void LandCallback(const std_msgs::msg::Empty::SharedPtr msg); 79 | void ResetCallback(const std_msgs::msg::Empty::SharedPtr msg); 80 | void SwitchModeCallback(const std_msgs::msg::Bool::SharedPtr msg); 81 | 82 | rclcpp::Time state_stamp_; 83 | ignition::math::v6::Pose3 pose; 84 | ignition::math::v6::Vector3 euler; 85 | ignition::math::v6::Vector3 velocity, acceleration, angular_velocity, position; 86 | 87 | std::string link_name_; 88 | std::string model_name_; 89 | std::string cmd_normal_topic_; 90 | std::string switch_mode_topic_; 91 | std::string posctrl_topic_; 92 | std::string imu_topic_; 93 | std::string takeoff_topic_; 94 | std::string land_topic_; 95 | std::string reset_topic_; 96 | std::string gt_topic_; 97 | std::string gt_vel_topic_; 98 | std::string gt_acc_topic_; 99 | 100 | double max_force_; 101 | double motion_small_noise_; 102 | double motion_drift_noise_; 103 | double motion_drift_noise_time_; 104 | 105 | struct Controllers { 106 | PIDController roll; 107 | PIDController pitch; 108 | PIDController yaw; 109 | PIDController velocity_x; 110 | PIDController velocity_y; 111 | PIDController velocity_z; 112 | PIDController pos_x; 113 | PIDController pos_y; 114 | PIDController pos_z; 115 | } controllers_; 116 | 117 | ignition::math::v6::Vector3 inertia; 118 | double mass; 119 | 120 | /// \brief save last_time 121 | common::Time last_time; 122 | 123 | // Pointer to the update event connection 124 | event::ConnectionPtr updateConnection; 125 | }; 126 | 127 | } 128 | 129 | #endif // PLUGIN_DRONE_HPP -------------------------------------------------------------------------------- /drone/sjtu_drone_description/models/database.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | sjtu_drone 4 | Creative Commons Attribution 3.0 Unported 5 | 6 | file://sjtu_drone 7 | 8 | 9 | -------------------------------------------------------------------------------- /drone/sjtu_drone_description/models/sjtu_drone/model.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | sjtu_drone 4 | 1.0 5 | sjtu_drone.sdf 6 | 7 | 8 | Danping Zou 9 | dpzou@sjtu.edu.cn 10 | 11 | 12 | 13 | The quadrotor model 14 | 15 | 16 | -------------------------------------------------------------------------------- /drone/sjtu_drone_description/models/sjtu_drone/quadrotor_4.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abdulkadrtr/multiRobotExploration-RobotArmy/8dd94741de5b012dfa99ad6bacb0050d00e29742/drone/sjtu_drone_description/models/sjtu_drone/quadrotor_4.stl -------------------------------------------------------------------------------- /drone/sjtu_drone_description/models/sjtu_drone/sjtu_drone.sdf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 0 0 0 0 -0 0 6 | 1.477 7 | 8 | 0.1152 9 | 0 10 | 0 11 | 0.1152 12 | 0 13 | 0.218 14 | 15 | 16 | 17 | 0 0 0.04 0 -0 0 18 | 19 | 20 | 1 1 1 21 | model://sjtu_drone/quadrotor_4.dae 22 | 23 | 24 | 25 | 26 | 0 0 0.04 0 -0 0 27 | 28 | 29 | 1 1 1 30 | model://sjtu_drone/quadrotor_4.dae 31 | 32 | 33 | 34 | 35 | 1 36 | 1 37 | 100 38 | 0 0 0 0 -0 0 39 | 40 | 41 | /sjtu_drone 42 | 43 | 0 44 | 45 | 46 | 47 | gaussian 48 | 49 | 0 50 | 0 51 | 52 | 53 | 0 54 | 0.00 55 | 56 | 57 | 58 | 59 | 60 | 1 61 | 30 62 | 63 | 64 | 65 | 66 | 0 67 | 0.0002 68 | 69 | 70 | 71 | 72 | 0 73 | 0.0002 74 | 75 | 76 | 77 | 78 | 79 | 80 | /sjtu_drone/gps 81 | ~/out:=data 82 | 83 | 84 | 85 | 86 | 87 | 1.047 88 | 89 | 640 90 | 360 91 | R8G8B8 92 | 93 | 94 | 0.1 95 | 100 96 | 97 | 98 | gaussian 99 | 0 100 | 0.005 101 | 102 | 103 | 1 104 | 15 105 | 1 106 | 107 | 108 | /sjtu_drone 109 | image_raw:=camera_bottom 110 | camera_info:=camera_bottom_info 111 | 112 | bottom 113 | bottom_cam_link 114 | 0.07 115 | 116 | 0 0 0 3.14159 1.57079 3.14159 117 | 118 | 119 | 120 | 2.09 121 | 122 | 640 123 | 360 124 | R8G8B8 125 | 126 | 127 | 0.1 128 | 100 129 | 130 | 131 | gaussian 132 | 0 133 | 0.005 134 | 135 | 136 | 1 137 | 60 138 | 1 139 | 140 | 141 | /sjtu_drone 142 | image_raw:=camera_front 143 | camera_info:=camera_front_info 144 | 145 | front 146 | front_cam_link 147 | 0.07 148 | 149 | 0.2 0 0 0 -0 0 150 | 151 | 152 | 1 153 | 1 154 | 5 155 | 156 | 157 | 158 | 5 159 | 1 160 | -0.12 161 | 0.12 162 | 163 | 164 | 5 165 | 1 166 | -0.12 167 | 0.12 168 | 169 | 170 | 171 | 0.02 172 | 10 173 | 0.01 174 | 175 | 176 | gaussian 177 | 0 178 | 0.01 179 | 180 | 181 | 182 | 183 | /sjtu_drone 184 | ~/out:=sonar 185 | 186 | sensor_msgs/Range 187 | ultrasound 188 | sonar_link 189 | 190 | 0 0 0 3.14159 1.57079 3.14159 191 | 192 | 193 | 0 194 | 195 | base_link 196 | drone 197 | imu 198 | 10.0 199 | 5.0 200 | 0.5 201 | 2.0 202 | 1.0 203 | 1.5 204 | 5.0 205 | 2.3 206 | 2 207 | 5.0 208 | 0.0 209 | 1.0 210 | -1 211 | 1.1 212 | 0.0 213 | 0.0 214 | 5 215 | 1.0 216 | 0.2 217 | 0.0 218 | -1 219 | 30 220 | 0.05 221 | 0.03 222 | 5.0 223 | 224 | 225 | 226 | -------------------------------------------------------------------------------- /drone/sjtu_drone_description/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | sjtu_drone_description 5 | 0.0.0 6 | TODO: Package description 7 | Georg Novotny 8 | TODO: License declaration 9 | 10 | ament_cmake_ros 11 | 12 | rclcpp 13 | gazebo_ros 14 | gazebo_plugins 15 | gazebo_dev 16 | geometry_msgs 17 | std_msgs 18 | sensor_msgs 19 | 20 | ament_lint_auto 21 | ament_lint_common 22 | 23 | 24 | ament_cmake 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /drone/sjtu_drone_description/src/.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "browse": { 5 | "databaseFilename": "", 6 | "limitSymbolsToIncludedHeaders": true 7 | }, 8 | "includePath": [ 9 | "/home/georg/catkin_ws/devel/include/**", 10 | "/opt/ros/noetic/include/**", 11 | "/home/georg/catkin_ws/src/LMD/follow_human/include/**", 12 | "/home/georg/catkin_ws/src/LMD/LIO-SAM/include/**", 13 | "/home/georg/catkin_ws/src/LMD/robot_control/include/**", 14 | "/home/georg/catkin_ws/src/LMD/robot_simulation/include/**", 15 | "/home/georg/catkin_ws/src/rl_course_files/parrot_ardrone/sjtu_drone/include/**", 16 | "/usr/include/**" 17 | ], 18 | "name": "ROS" 19 | } 20 | ], 21 | "version": 4 22 | } -------------------------------------------------------------------------------- /drone/sjtu_drone_description/src/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "python.autoComplete.extraPaths": [ 3 | "/home/georg/catkin_ws/devel/lib/python3/dist-packages", 4 | "/opt/ros/noetic/lib/python3/dist-packages" 5 | ], 6 | "python.analysis.extraPaths": [ 7 | "/home/georg/catkin_ws/devel/lib/python3/dist-packages", 8 | "/opt/ros/noetic/lib/python3/dist-packages" 9 | ] 10 | } -------------------------------------------------------------------------------- /drone/sjtu_drone_description/src/pid_controller.cpp: -------------------------------------------------------------------------------- 1 | #include "pid_controller.h" 2 | 3 | PIDController::PIDController() 4 | { 5 | 6 | } 7 | 8 | PIDController::~PIDController(){ 9 | 10 | } 11 | 12 | 13 | void PIDController::Load(sdf::ElementPtr _sdf, const std::string& prefix) 14 | { 15 | gain_p = 5.0; 16 | gain_d = 1.0; 17 | gain_i = 0.0; 18 | time_constant = 0.0; 19 | limit = -1.0; 20 | 21 | if (!_sdf) return; 22 | if (_sdf->HasElement(prefix + "ProportionalGain")) gain_p = _sdf->GetElement(prefix + "ProportionalGain")->Get(); 23 | if (_sdf->HasElement(prefix + "DifferentialGain")) gain_d = _sdf->GetElement(prefix + "DifferentialGain")->Get(); 24 | if (_sdf->HasElement(prefix + "IntegralGain")) gain_i = _sdf->GetElement(prefix + "IntegralGain")->Get(); 25 | if (_sdf->HasElement(prefix + "TimeConstant")) time_constant = _sdf->GetElement(prefix + "TimeConstant")->Get(); 26 | if (_sdf->HasElement(prefix + "Limit")) limit = _sdf->GetElement(prefix + "Limit")->Get(); 27 | } 28 | 29 | double PIDController::update(double new_input, double x, double dx, double dt) 30 | { 31 | // limit command 32 | if (limit > 0.0 && fabs(new_input) > limit) new_input = (new_input < 0 ? -1.0 : 1.0) * limit; 33 | 34 | // filter command 35 | if (dt + time_constant > 0.0) { 36 | input = (dt * new_input + time_constant * input) / (dt + time_constant); 37 | dinput = (new_input - input) / (dt + time_constant); 38 | } 39 | 40 | // update proportional, differential and integral errors 41 | p = input - x; 42 | d = dinput - dx; 43 | i = i + dt * p; 44 | 45 | // update control output 46 | output = gain_p * p + gain_d * d + gain_i * i; 47 | return output; 48 | } 49 | 50 | void PIDController::reset() 51 | { 52 | input = dinput = 0; 53 | p = i = d = output = 0; 54 | } 55 | 56 | -------------------------------------------------------------------------------- /drone/sjtu_drone_description/urdf/sjtu_drone.urdf.xacro: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | base_link 53 | drone 54 | imu 55 | 10.0 56 | 5.0 57 | 0.5 58 | 2.0 59 | 1.0 60 | 1.5 61 | 5.0 62 | 2.3 63 | 2 64 | 5.0 65 | 0.0 66 | 1.0 67 | -1 68 | 1.1 69 | 0.0 70 | 0.0 71 | 5 72 | 1.0 73 | 0.2 74 | 0.0 75 | -1 76 | 30 77 | 0.05 78 | 0.03 79 | 5.0 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 1 88 | 1 89 | 100 90 | 0 0 0 0 0 0 91 | 92 | false 93 | 94 | 95 | 96 | gaussian 97 | 98 | 0 99 | 0 100 | 101 | 102 | 0 103 | 0.00 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | true 115 | true 116 | 5 117 | 118 | 119 | 120 | 5 121 | 1.000000 122 | -0.12 123 | 0.12 124 | 125 | 126 | 5 127 | 1.000000 128 | -0.12 129 | 0.12 130 | 131 | 132 | 133 | 0.02 134 | 10 135 | 0.01 136 | 137 | 138 | gaussian 139 | 0.0 140 | 0.01 141 | 142 | 143 | 144 | 145 | ~/out:=sonar 146 | 147 | sensor_msgs/Range 148 | ultrasound 149 | sonar_link 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 2.09 158 | 159 | 640 160 | 360 161 | R8G8B8 162 | 163 | 164 | 0.1 165 | 100 166 | 167 | 168 | gaussian 169 | 0.0 170 | 0.005 171 | 172 | 173 | 1 174 | 60 175 | true 176 | 177 | 178 | image_raw:=camera_front 179 | camera_info:=camera_front_info 180 | 181 | front 182 | front_cam_link 183 | 0.07 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 1.047 194 | 195 | 640 196 | 360 197 | R8G8B8 198 | 199 | 200 | 0.1 201 | 100 202 | 203 | 204 | gaussian 205 | 0.0 206 | 0.005 207 | 208 | 209 | 1 210 | 15 211 | true 212 | 213 | 214 | image_raw:=camera_bottom 215 | camera_info:=camera_bottom_info 216 | 217 | bottom 218 | bottom_cam_link 219 | 0.07 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | true 228 | 30 229 | 230 | 231 | 232 | 233 | 0.0 234 | 2e-4 235 | 236 | 237 | 238 | 239 | 0.0 240 | 2e-4 241 | 242 | 243 | 244 | 245 | 246 | 247 | /gps 248 | ~/out:=data 249 | 250 | 251 | 252 | 253 | 254 | -------------------------------------------------------------------------------- /drone/sjtu_drone_description/worlds/playground.world: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | model://ground_plane 7 | 8 | 9 | 10 | model://sun 11 | 12 | 13 | 14 | false 15 | 16 | 17 | 18 | 19 | 20 | 0.319654 -0.235002 9.29441 0 1.5138 0.009599 21 | orbit 22 | perspective 23 | 24 | 25 | 26 | 27 | 1000.0 28 | 0.001 29 | 1 30 | 31 | 32 | quick 33 | 150 34 | 0 35 | 1.400000 36 | 1 37 | 38 | 39 | 0.00001 40 | 0.2 41 | 2000.000000 42 | 0.01000 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /merge_map/config/merge_map.rviz: -------------------------------------------------------------------------------- 1 | Panels: 2 | - Class: rviz_common/Displays 3 | Help Height: 70 4 | Name: Displays 5 | Property Tree Widget: 6 | Expanded: 7 | - /Global Options1 8 | Splitter Ratio: 0.5 9 | Tree Height: 70 10 | - Class: rviz_common/Selection 11 | Name: Selection 12 | - Class: rviz_common/Tool Properties 13 | Expanded: 14 | - /2D Goal Pose1 15 | - /Publish Point1 16 | Name: Tool Properties 17 | Splitter Ratio: 0.5886790156364441 18 | - Class: rviz_common/Views 19 | Expanded: 20 | - /Current View1 21 | Name: Views 22 | Splitter Ratio: 0.5 23 | - Class: rviz_common/Time 24 | Experimental: false 25 | Name: Time 26 | SyncMode: 0 27 | SyncSource: "" 28 | Visualization Manager: 29 | Class: "" 30 | Displays: 31 | - Alpha: 0.5 32 | Cell Size: 1 33 | Class: rviz_default_plugins/Grid 34 | Color: 160; 160; 164 35 | Enabled: true 36 | Line Style: 37 | Line Width: 0.029999999329447746 38 | Value: Lines 39 | Name: Grid 40 | Normal Cell Count: 0 41 | Offset: 42 | X: 0 43 | Y: 0 44 | Z: 0 45 | Plane: XY 46 | Plane Cell Count: 10 47 | Reference Frame: 48 | Value: true 49 | - Alpha: 0.699999988079071 50 | Class: rviz_default_plugins/Map 51 | Color Scheme: map 52 | Draw Behind: false 53 | Enabled: true 54 | Name: Map 55 | Topic: 56 | Depth: 5 57 | Durability Policy: Volatile 58 | Filter size: 10 59 | History Policy: Keep Last 60 | Reliability Policy: Reliable 61 | Value: /merge_map 62 | Update Topic: 63 | Depth: 5 64 | Durability Policy: Volatile 65 | History Policy: Keep Last 66 | Reliability Policy: Reliable 67 | Value: /merge_map_updates 68 | Use Timestamp: false 69 | Value: true 70 | - Alpha: 1 71 | Buffer Length: 1 72 | Class: rviz_default_plugins/Path 73 | Color: 246; 211; 45 74 | Enabled: true 75 | Head Diameter: 0.30000001192092896 76 | Head Length: 0.20000000298023224 77 | Length: 0.30000001192092896 78 | Line Style: Billboards 79 | Line Width: 0.10000000149011612 80 | Name: Path 81 | Offset: 82 | X: 0 83 | Y: 0 84 | Z: 0 85 | Pose Color: 255; 85; 255 86 | Pose Style: None 87 | Radius: 0.029999999329447746 88 | Shaft Diameter: 0.10000000149011612 89 | Shaft Length: 0.10000000149011612 90 | Topic: 91 | Depth: 5 92 | Durability Policy: Volatile 93 | Filter size: 10 94 | History Policy: Keep Last 95 | Reliability Policy: Reliable 96 | Value: /tb3_1/visual_path 97 | Value: true 98 | - Alpha: 1 99 | Buffer Length: 1 100 | Class: rviz_default_plugins/Path 101 | Color: 25; 255; 0 102 | Enabled: true 103 | Head Diameter: 0.30000001192092896 104 | Head Length: 0.20000000298023224 105 | Length: 0.30000001192092896 106 | Line Style: Billboards 107 | Line Width: 0.10000000149011612 108 | Name: Path 109 | Offset: 110 | X: 0 111 | Y: 0 112 | Z: 0 113 | Pose Color: 255; 85; 255 114 | Pose Style: None 115 | Radius: 0.029999999329447746 116 | Shaft Diameter: 0.10000000149011612 117 | Shaft Length: 0.10000000149011612 118 | Topic: 119 | Depth: 5 120 | Durability Policy: Volatile 121 | Filter size: 10 122 | History Policy: Keep Last 123 | Reliability Policy: Reliable 124 | Value: /tb3_0/visual_path 125 | Value: true 126 | - Class: rviz_default_plugins/Image 127 | Enabled: true 128 | Max Value: 1 129 | Median window: 5 130 | Min Value: 0 131 | Name: Image 132 | Normalize Range: true 133 | Topic: 134 | Depth: 5 135 | Durability Policy: Volatile 136 | History Policy: Keep Last 137 | Reliability Policy: Reliable 138 | Value: /drone/bottom/image_raw 139 | Value: true 140 | Enabled: true 141 | Global Options: 142 | Background Color: 48; 48; 48 143 | Fixed Frame: merge_map 144 | Frame Rate: 30 145 | Name: root 146 | Tools: 147 | - Class: rviz_default_plugins/Interact 148 | Hide Inactive Objects: true 149 | - Class: rviz_default_plugins/MoveCamera 150 | - Class: rviz_default_plugins/Select 151 | - Class: rviz_default_plugins/FocusCamera 152 | - Class: rviz_default_plugins/Measure 153 | Line color: 128; 128; 0 154 | - Class: rviz_default_plugins/SetInitialPose 155 | Covariance x: 0.25 156 | Covariance y: 0.25 157 | Covariance yaw: 0.06853891909122467 158 | Topic: 159 | Depth: 5 160 | Durability Policy: Volatile 161 | History Policy: Keep Last 162 | Reliability Policy: Reliable 163 | Value: /initialpose 164 | - Class: rviz_default_plugins/SetGoal 165 | Topic: 166 | Depth: 5 167 | Durability Policy: Volatile 168 | History Policy: Keep Last 169 | Reliability Policy: Reliable 170 | Value: /goal_pose 171 | - Class: rviz_default_plugins/PublishPoint 172 | Single click: true 173 | Topic: 174 | Depth: 5 175 | Durability Policy: Volatile 176 | History Policy: Keep Last 177 | Reliability Policy: Reliable 178 | Value: /clicked_point 179 | Transformation: 180 | Current: 181 | Class: rviz_default_plugins/TF 182 | Value: true 183 | Views: 184 | Current: 185 | Class: rviz_default_plugins/Orbit 186 | Distance: 23.42510223388672 187 | Enable Stereo Rendering: 188 | Stereo Eye Separation: 0.05999999865889549 189 | Stereo Focal Distance: 1 190 | Swap Stereo Eyes: false 191 | Value: false 192 | Focal Point: 193 | X: 0.16153769195079803 194 | Y: 2.438749074935913 195 | Z: 0.00016973871970549226 196 | Focal Shape Fixed Size: true 197 | Focal Shape Size: 0.05000000074505806 198 | Invert Z Axis: false 199 | Name: Current View 200 | Near Clip Distance: 0.009999999776482582 201 | Pitch: 1.5697963237762451 202 | Target Frame: 203 | Value: Orbit (rviz) 204 | Yaw: 3.1404001712799072 205 | Saved: ~ 206 | Window Geometry: 207 | Displays: 208 | collapsed: false 209 | Height: 604 210 | Hide Left Dock: false 211 | Hide Right Dock: true 212 | Image: 213 | collapsed: false 214 | QMainWindow State: 000000ff00000000fd0000000400000000000001e5000001befc0200000009fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073000000003d000000c9000000c900fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb0000000a0049006d006100670065010000003d000001be0000002800ffffff000000010000010f00000168fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073000000003d00000168000000a400fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000002fb0000003efc0100000002fb0000000800540069006d00650100000000000002fb000002fb00fffffffb0000000800540069006d0065010000000000000450000000000000000000000110000001be00000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 215 | Selection: 216 | collapsed: false 217 | Time: 218 | collapsed: false 219 | Tool Properties: 220 | collapsed: false 221 | Views: 222 | collapsed: true 223 | Width: 763 224 | X: 603 225 | Y: 127 226 | -------------------------------------------------------------------------------- /merge_map/launch/merge_map_launch.py: -------------------------------------------------------------------------------- 1 | # Authors: Abdulkadir Ture 2 | # Github : abdulkadrtr 3 | 4 | import os 5 | 6 | from ament_index_python.packages import get_package_share_directory 7 | from launch import LaunchDescription 8 | from launch.actions import IncludeLaunchDescription 9 | from launch.launch_description_sources import PythonLaunchDescriptionSource 10 | from launch.substitutions import LaunchConfiguration 11 | from launch_ros.actions import Node 12 | 13 | def generate_launch_description(): 14 | rviz_file = os.path.join(get_package_share_directory('merge_map'), 'config', 'merge_map.rviz') 15 | return LaunchDescription([ 16 | Node( 17 | package='rviz2', 18 | executable='rviz2', 19 | name='rviz2', 20 | output='screen', 21 | arguments=['-d', rviz_file], 22 | parameters=[{'use_sim_time': True}] 23 | ), 24 | Node( 25 | package='merge_map', 26 | executable='merge_map', 27 | output='screen', 28 | parameters=[{'use_sim_time': True}] 29 | ), 30 | ]) 31 | -------------------------------------------------------------------------------- /merge_map/merge_map/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abdulkadrtr/multiRobotExploration-RobotArmy/8dd94741de5b012dfa99ad6bacb0050d00e29742/merge_map/merge_map/__init__.py -------------------------------------------------------------------------------- /merge_map/merge_map/merge_map.py: -------------------------------------------------------------------------------- 1 | import rclpy 2 | from rclpy.node import Node 3 | from nav_msgs.msg import OccupancyGrid 4 | import numpy as np 5 | 6 | def merge_maps(map1, map2): 7 | merged_map = OccupancyGrid() 8 | merged_map.header = map1.header 9 | merged_map.header.frame_id = 'merge_map' 10 | min_x = min(map1.info.origin.position.x, map2.info.origin.position.x) 11 | min_y = min(map1.info.origin.position.y, map2.info.origin.position.y) 12 | max_x = max(map1.info.origin.position.x + (map1.info.width * map1.info.resolution), 13 | map2.info.origin.position.x + (map2.info.width * map2.info.resolution)) 14 | max_y = max(map1.info.origin.position.y + (map1.info.height * map1.info.resolution), 15 | map2.info.origin.position.y + (map2.info.height * map2.info.resolution)) 16 | merged_map.info.origin.position.x = min_x 17 | merged_map.info.origin.position.y = min_y 18 | merged_map.info.resolution = min(map1.info.resolution, map2.info.resolution) 19 | merged_map.info.width = int(np.ceil((max_x - min_x) / merged_map.info.resolution)) 20 | merged_map.info.height = int(np.ceil((max_y - min_y) / merged_map.info.resolution)) 21 | merged_map.data = [-1] * (merged_map.info.width * merged_map.info.height) 22 | for y in range(map1.info.height): 23 | for x in range(map1.info.width): 24 | i = x + y * map1.info.width 25 | merged_x = int(np.floor((map1.info.origin.position.x + x * map1.info.resolution - min_x) / merged_map.info.resolution)) 26 | merged_y = int(np.floor((map1.info.origin.position.y + y * map1.info.resolution - min_y) / merged_map.info.resolution)) 27 | merged_i = merged_x + merged_y * merged_map.info.width 28 | merged_map.data[merged_i] = map1.data[i] 29 | for y in range(map2.info.height): 30 | for x in range(map2.info.width): 31 | i = x + y * map2.info.width 32 | merged_x = int(np.floor((map2.info.origin.position.x + x * map2.info.resolution - min_x) / merged_map.info.resolution)) 33 | merged_y = int(np.floor((map2.info.origin.position.y + y * map2.info.resolution - min_y) / merged_map.info.resolution)) 34 | merged_i = merged_x + merged_y * merged_map.info.width 35 | if merged_map.data[merged_i] == -1: 36 | merged_map.data[merged_i] = map2.data[i] 37 | return merged_map 38 | 39 | class MergeMapNode(Node): 40 | def __init__(self): 41 | super().__init__('merge_map_node') 42 | self.publisher = self.create_publisher(OccupancyGrid, '/merge_map', 10) 43 | self.subscription = self.create_subscription(OccupancyGrid, '/tb3_0/map', self.map1_callback, 10) 44 | self.subscription = self.create_subscription(OccupancyGrid, '/tb3_1/map', self.map2_callback, 10) 45 | self.map1 = None 46 | self.map2 = None 47 | 48 | def map1_callback(self, msg): 49 | self.map1 = msg 50 | if self.map2 is not None: 51 | msg = merge_maps(self.map1, self.map2) 52 | self.publisher.publish(msg) 53 | 54 | def map2_callback(self, msg): 55 | self.map2 = msg 56 | if self.map1 is not None: 57 | msg = merge_maps(self.map1, self.map2) 58 | self.publisher.publish(msg) 59 | 60 | def main(args=None): 61 | rclpy.init(args=args) 62 | merge_map_node = MergeMapNode() 63 | rclpy.spin(merge_map_node) 64 | merge_map_node.destroy_node() 65 | rclpy.shutdown() 66 | 67 | if __name__ == '__main__': 68 | main() 69 | -------------------------------------------------------------------------------- /merge_map/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | merge_map 5 | 0.0.0 6 | TODO: Package description 7 | abd 8 | TODO: License declaration 9 | 10 | ament_copyright 11 | ament_flake8 12 | ament_pep257 13 | python3-pytest 14 | 15 | 16 | ament_python 17 | rclpy 18 | nav_msgs 19 | geometry_msgs 20 | sensor_msgs 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /merge_map/resource/merge_map: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abdulkadrtr/multiRobotExploration-RobotArmy/8dd94741de5b012dfa99ad6bacb0050d00e29742/merge_map/resource/merge_map -------------------------------------------------------------------------------- /merge_map/setup.cfg: -------------------------------------------------------------------------------- 1 | [develop] 2 | script_dir=$base/lib/merge_map 3 | [install] 4 | install_scripts=$base/lib/merge_map 5 | -------------------------------------------------------------------------------- /merge_map/setup.py: -------------------------------------------------------------------------------- 1 | import os 2 | from glob import glob 3 | from setuptools import setup 4 | 5 | package_name = 'merge_map' 6 | 7 | setup( 8 | name=package_name, 9 | version='0.0.0', 10 | packages=[package_name], 11 | data_files=[ 12 | ('share/ament_index/resource_index/packages', 13 | ['resource/' + package_name]), 14 | ('share/' + package_name, ['package.xml']), 15 | (os.path.join('share', package_name, 'launch'), glob('launch/*.py')), 16 | (os.path.join('share', package_name, 'config'), glob('config/*')), 17 | ], 18 | install_requires=['setuptools'], 19 | zip_safe=True, 20 | maintainer='abd', 21 | maintainer_email='abd@todo.todo', 22 | description='TODO: Package description', 23 | license='TODO: License declaration', 24 | tests_require=['pytest'], 25 | entry_points={ 26 | 'console_scripts': [ 27 | 'merge_map = merge_map.merge_map:main' 28 | ], 29 | }, 30 | ) 31 | -------------------------------------------------------------------------------- /merge_map/test/test_copyright.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Open Source Robotics Foundation, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from ament_copyright.main import main 16 | import pytest 17 | 18 | 19 | # Remove the `skip` decorator once the source file(s) have a copyright header 20 | @pytest.mark.skip(reason='No copyright header has been placed in the generated source file.') 21 | @pytest.mark.copyright 22 | @pytest.mark.linter 23 | def test_copyright(): 24 | rc = main(argv=['.', 'test']) 25 | assert rc == 0, 'Found errors' 26 | -------------------------------------------------------------------------------- /merge_map/test/test_flake8.py: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Open Source Robotics Foundation, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from ament_flake8.main import main_with_errors 16 | import pytest 17 | 18 | 19 | @pytest.mark.flake8 20 | @pytest.mark.linter 21 | def test_flake8(): 22 | rc, errors = main_with_errors(argv=[]) 23 | assert rc == 0, \ 24 | 'Found %d code style errors / warnings:\n' % len(errors) + \ 25 | '\n'.join(errors) 26 | -------------------------------------------------------------------------------- /merge_map/test/test_pep257.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Open Source Robotics Foundation, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from ament_pep257.main import main 16 | import pytest 17 | 18 | 19 | @pytest.mark.linter 20 | @pytest.mark.pep257 21 | def test_pep257(): 22 | rc = main(argv=['.', 'test']) 23 | assert rc == 0, 'Found code style errors / warnings' 24 | -------------------------------------------------------------------------------- /multi_robot_exploration/multi_robot_exploration/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abdulkadrtr/multiRobotExploration-RobotArmy/8dd94741de5b012dfa99ad6bacb0050d00e29742/multi_robot_exploration/multi_robot_exploration/__init__.py -------------------------------------------------------------------------------- /multi_robot_exploration/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | multi_robot_exploration 5 | 0.0.0 6 | TODO: Package description 7 | abd 8 | TODO: License declaration 9 | 10 | ament_copyright 11 | ament_flake8 12 | ament_pep257 13 | python3-pytest 14 | 15 | 16 | ament_python 17 | 18 | 19 | -------------------------------------------------------------------------------- /multi_robot_exploration/resource/multi_robot_exploration: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abdulkadrtr/multiRobotExploration-RobotArmy/8dd94741de5b012dfa99ad6bacb0050d00e29742/multi_robot_exploration/resource/multi_robot_exploration -------------------------------------------------------------------------------- /multi_robot_exploration/setup.cfg: -------------------------------------------------------------------------------- 1 | [develop] 2 | script_dir=$base/lib/multi_robot_exploration 3 | [install] 4 | install_scripts=$base/lib/multi_robot_exploration 5 | -------------------------------------------------------------------------------- /multi_robot_exploration/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | package_name = 'multi_robot_exploration' 4 | 5 | setup( 6 | name=package_name, 7 | version='0.0.0', 8 | packages=[package_name], 9 | data_files=[ 10 | ('share/ament_index/resource_index/packages', 11 | ['resource/' + package_name]), 12 | ('share/' + package_name, ['package.xml']), 13 | ], 14 | install_requires=['setuptools'], 15 | zip_safe=True, 16 | maintainer='abd', 17 | maintainer_email='abdulkadir.ture@std.yildiz.edu.tr', 18 | description='TODO: Package description', 19 | license='TODO: License declaration', 20 | tests_require=['pytest'], 21 | entry_points={ 22 | 'console_scripts': [ 23 | 'control = multi_robot_exploration.control:main' 24 | ], 25 | }, 26 | ) 27 | -------------------------------------------------------------------------------- /multi_robot_exploration/test/test_copyright.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Open Source Robotics Foundation, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from ament_copyright.main import main 16 | import pytest 17 | 18 | 19 | # Remove the `skip` decorator once the source file(s) have a copyright header 20 | @pytest.mark.skip(reason='No copyright header has been placed in the generated source file.') 21 | @pytest.mark.copyright 22 | @pytest.mark.linter 23 | def test_copyright(): 24 | rc = main(argv=['.', 'test']) 25 | assert rc == 0, 'Found errors' 26 | -------------------------------------------------------------------------------- /multi_robot_exploration/test/test_flake8.py: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Open Source Robotics Foundation, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from ament_flake8.main import main_with_errors 16 | import pytest 17 | 18 | 19 | @pytest.mark.flake8 20 | @pytest.mark.linter 21 | def test_flake8(): 22 | rc, errors = main_with_errors(argv=[]) 23 | assert rc == 0, \ 24 | 'Found %d code style errors / warnings:\n' % len(errors) + \ 25 | '\n'.join(errors) 26 | -------------------------------------------------------------------------------- /multi_robot_exploration/test/test_pep257.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Open Source Robotics Foundation, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from ament_pep257.main import main 16 | import pytest 17 | 18 | 19 | @pytest.mark.linter 20 | @pytest.mark.pep257 21 | def test_pep257(): 22 | rc = main(argv=['.', 'test']) 23 | assert rc == 0, 'Found code style errors / warnings' 24 | -------------------------------------------------------------------------------- /path_follow/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | path_follow 5 | 0.0.0 6 | TODO: Package description 7 | abd 8 | TODO: License declaration 9 | 10 | ament_copyright 11 | ament_flake8 12 | ament_pep257 13 | python3-pytest 14 | 15 | 16 | ament_python 17 | 18 | 19 | -------------------------------------------------------------------------------- /path_follow/path_follow/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abdulkadrtr/multiRobotExploration-RobotArmy/8dd94741de5b012dfa99ad6bacb0050d00e29742/path_follow/path_follow/__init__.py -------------------------------------------------------------------------------- /path_follow/path_follow/path_follow.py: -------------------------------------------------------------------------------- 1 | import rclpy 2 | from rclpy.node import Node 3 | from std_msgs.msg import Float32MultiArray 4 | from nav_msgs.msg import Path 5 | from geometry_msgs.msg import PoseStamped 6 | from geometry_msgs.msg import Twist 7 | from nav_msgs.msg import Odometry 8 | import threading 9 | import math , time 10 | 11 | lookahead_distance = 0.22 #one bakma mesafesi 12 | speed = 0.18 #maksimum hiz 13 | 14 | def euler_from_quaternion(x,y,z,w): 15 | t0 = +2.0 * (w * x + y * z) 16 | t1 = +1.0 - 2.0 * (x * x + y * y) 17 | roll_x = math.atan2(t0, t1) 18 | t2 = +2.0 * (w * y - z * x) 19 | t2 = +1.0 if t2 > +1.0 else t2 20 | t2 = -1.0 if t2 < -1.0 else t2 21 | pitch_y = math.asin(t2) 22 | t3 = +2.0 * (w * z + x * y) 23 | t4 = +1.0 - 2.0 * (y * y + z * z) 24 | yaw_z = math.atan2(t3, t4) 25 | return yaw_z 26 | 27 | def pure_pursuit(current_x, current_y, current_heading, path,index): 28 | global lookahead_distance 29 | closest_point = None 30 | v = speed 31 | for i in range(index,len(path)): 32 | x = path[i][0] 33 | y = path[i][1] 34 | distance = math.hypot(current_x - x, current_y - y) 35 | if lookahead_distance < distance: 36 | closest_point = (x, y) 37 | index = i 38 | break 39 | if closest_point is not None: 40 | target_heading = math.atan2(closest_point[1] - current_y, closest_point[0] - current_x) 41 | desired_steering_angle = target_heading - current_heading 42 | else: 43 | target_heading = math.atan2(path[-1][1] - current_y, path[-1][0] - current_x) 44 | desired_steering_angle = target_heading - current_heading 45 | index = len(path)-1 46 | if desired_steering_angle > math.pi: 47 | desired_steering_angle -= 2 * math.pi 48 | elif desired_steering_angle < -math.pi: 49 | desired_steering_angle += 2 * math.pi 50 | if desired_steering_angle > math.pi/6 or desired_steering_angle < -math.pi/6: 51 | sign = 1 if desired_steering_angle > 0 else -1 52 | desired_steering_angle = sign * math.pi/4 53 | v = 0.0 54 | return v,desired_steering_angle,index 55 | 56 | class pathFollower(Node): 57 | def __init__(self): 58 | super().__init__('path_follower') 59 | self.subscription_path = self.create_subscription(Float32MultiArray,'/path',self.get_path,10) 60 | self.subscription_odom = self.create_subscription(Odometry,'/odom',self.odom_callback,10) 61 | self.publisher_visual_path = self.create_publisher(Path, '/visual_path', 10) 62 | self.publisher_cmd_vel = self.create_publisher(Twist, '/cmd_vel', 10) 63 | print("Path follower node has been started") 64 | 65 | 66 | def get_path(self,msg): 67 | #Rota dinleme 68 | print("Path has been received") 69 | data_list = [msg.data[i] for i in range(len(msg.data))] 70 | reshaped_data_list = [(data_list[i], data_list[i+1]) for i in range(0, len(data_list), 2)] 71 | self.path = reshaped_data_list 72 | threading.Thread(target=self.follow_path).start() 73 | 74 | 75 | def follow_path(self): 76 | twist = Twist() 77 | path_msg = Path() 78 | path_msg.header.frame_id = "merge_map" 79 | path_msg.header.stamp = self.get_clock().now().to_msg() 80 | for i in range(len(self.path)): 81 | pose = PoseStamped() 82 | pose.pose.position.x = self.path[i][0] 83 | pose.pose.position.y = self.path[i][1] 84 | path_msg.poses.append(pose) 85 | v = 0.0 86 | w = 0.0 87 | i = 0 88 | while True: 89 | if not hasattr(self, 'x'): 90 | continue 91 | v , w ,i = pure_pursuit(self.x,self.y,self.yaw,self.path,i) 92 | if(abs(self.x - self.path[-1][0]) < 0.15 and abs(self.y - self.path[-1][1])< 0.15): 93 | twist.linear.x = 0.0 94 | twist.angular.z = 0.0 95 | self.publisher_cmd_vel.publish(twist) 96 | print("Path has been followed") 97 | break 98 | twist.linear.x = v 99 | twist.angular.z = w 100 | self.publisher_visual_path.publish(path_msg) 101 | self.publisher_cmd_vel.publish(twist) 102 | time.sleep(0.1) 103 | 104 | def odom_callback(self,msg): 105 | self.x = msg.pose.pose.position.x 106 | self.y = msg.pose.pose.position.y 107 | self.yaw = euler_from_quaternion(msg.pose.pose.orientation.x,msg.pose.pose.orientation.y, 108 | msg.pose.pose.orientation.z,msg.pose.pose.orientation.w) 109 | 110 | 111 | def main(args=None): 112 | rclpy.init(args=args) 113 | path_follower = pathFollower() 114 | rclpy.spin(path_follower) 115 | path_follower.destroy_node() 116 | rclpy.shutdown() 117 | 118 | if __name__ == '__main__': 119 | main() -------------------------------------------------------------------------------- /path_follow/resource/path_follow: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abdulkadrtr/multiRobotExploration-RobotArmy/8dd94741de5b012dfa99ad6bacb0050d00e29742/path_follow/resource/path_follow -------------------------------------------------------------------------------- /path_follow/setup.cfg: -------------------------------------------------------------------------------- 1 | [develop] 2 | script_dir=$base/lib/path_follow 3 | [install] 4 | install_scripts=$base/lib/path_follow 5 | -------------------------------------------------------------------------------- /path_follow/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | package_name = 'path_follow' 4 | 5 | setup( 6 | name=package_name, 7 | version='0.0.0', 8 | packages=[package_name], 9 | data_files=[ 10 | ('share/ament_index/resource_index/packages', 11 | ['resource/' + package_name]), 12 | ('share/' + package_name, ['package.xml']), 13 | ], 14 | install_requires=['setuptools'], 15 | zip_safe=True, 16 | maintainer='abd', 17 | maintainer_email='abd@todo.todo', 18 | description='TODO: Package description', 19 | license='TODO: License declaration', 20 | tests_require=['pytest'], 21 | entry_points={ 22 | 'console_scripts': [ 23 | 'path_follow = path_follow.path_follow:main' 24 | ], 25 | }, 26 | ) 27 | -------------------------------------------------------------------------------- /path_follow/test/test_copyright.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Open Source Robotics Foundation, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from ament_copyright.main import main 16 | import pytest 17 | 18 | 19 | # Remove the `skip` decorator once the source file(s) have a copyright header 20 | @pytest.mark.skip(reason='No copyright header has been placed in the generated source file.') 21 | @pytest.mark.copyright 22 | @pytest.mark.linter 23 | def test_copyright(): 24 | rc = main(argv=['.', 'test']) 25 | assert rc == 0, 'Found errors' 26 | -------------------------------------------------------------------------------- /path_follow/test/test_flake8.py: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Open Source Robotics Foundation, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from ament_flake8.main import main_with_errors 16 | import pytest 17 | 18 | 19 | @pytest.mark.flake8 20 | @pytest.mark.linter 21 | def test_flake8(): 22 | rc, errors = main_with_errors(argv=[]) 23 | assert rc == 0, \ 24 | 'Found %d code style errors / warnings:\n' % len(errors) + \ 25 | '\n'.join(errors) 26 | -------------------------------------------------------------------------------- /path_follow/test/test_pep257.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Open Source Robotics Foundation, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from ament_pep257.main import main 16 | import pytest 17 | 18 | 19 | @pytest.mark.linter 20 | @pytest.mark.pep257 21 | def test_pep257(): 22 | rc = main(argv=['.', 'test']) 23 | assert rc == 0, 'Found code style errors / warnings' 24 | -------------------------------------------------------------------------------- /readme-tr.md: -------------------------------------------------------------------------------- 1 | # Çok Robotlu Keşif 2 | ![pic](https://user-images.githubusercontent.com/87595266/232087653-15e75801-908e-4017-930c-543008c47192.png) 3 | 4 | [en-readme](https://github.com/abdulkadrtr/multiRobotExploration/blob/main/README.md) 5 | 6 | Otonom Keşif Ordusu projesi, otonom keşif için robotik araçlardan oluşan bir ekip oluşturmayı amaçlar. Ekip, bilinmeyen bölgeleri haritalamak ve keşfetmek için işbirliği içinde çalışan 1 hava aracı ve 2 kara aracından oluşur. Lidar sensörleri ile donatılan kara araçları, arazinin haritalanmasından, hava aracı ise kara araçlarının yukarıdan izlenmesi için havadan görüntüleme desteği sağlar. 7 | 8 | Sistemin kalbi, tüm robotları merkezi olarak yöneten Otonom Keşif Kontrol Merkezi'dir. Kara araçlarına mesajlar göndererek, kara araçlarından elde edilen haritaları birleştirerek birleştirilmiş haritaya dayalı olarak keşif için en uygun rotaları sağlar. Ayrıca hava aracından kamera görüntüleri alarak tüm alanın kapsamlı bir şekilde havadan görüntülenmesini sağlar. 9 | 10 | Otonom Keşif Kontrol Merkezi, bu koordineli yaklaşımı kullanarak, hava aracına her iki kara aracını da net bir şekilde görebileceği stratejik bir konuma konumlandırması için komut verir. Bu, ekibin tüm alanı etkili bir şekilde keşfetmesini ve haritasını çıkarmasını sağlar. Kara araçlarından alınan haritalar ve hava aracından alınan görüntüler çevrenin birleştirilmiş bir haritasını sunarak daha fazla analiz ve karar vermeye olanak tanır. 11 | 12 | Bu projede ROS 2 ve Gazebo simülasyon ortamının kullanılması, otonom keşif ordusunun test edilmesi ve geliştirilmesi için gerçekçi simülasyonları sağlamıştır. Bu proje, arama ve kurtarma, çevresel izleme ve daha fazlası gibi alanlardaki potansiyel uygulamalarla, bilinmeyen arazileri keşfetme ve değerli bilgiler toplama konusunda otonom robotların gücünü sergiliyor. 13 | 14 | Sonuç olarak, Otonom Keşif Ordusu projesi, bilinmeyen bölgeleri keşfetmek ve haritasını çıkarmak için birlikte çalışan otonom robotik araçlardan oluşan bir ekibin yeteneklerini göstermektedir. Lidar sensörleri, havadan görüntüleme ve merkezi kontrol gibi teknolojilerin kullanımıyla bu proje, keşif alanında yeni yaklaşımlar yaratma potansiyeline sahiptir. 15 | 16 | *Projede ROS2 Humble, Gazebo , TurtleBot3 modeli ve SJTU Drone modeli kullanılmıştır. 17 | 18 | # Nasıl Çalışır 19 | 20 | 21 | Projeyi çalıştırmak için sisteminizde ROS2 ve Gazebo simülasyonunun kurulu olması gerekmektedir. Aşağıdaki talimatları izleyin: 22 | 23 | 1 - ROS2 ve Gazebo simülasyonunu sisteminize kurun. 24 | 25 | 2 - Bir ROS2 çalışma alanı (örneğin, ros2_ws) oluşturun ve içinde bir src dizini oluşturun. 26 | 27 | 3 - Projeyi aşağıdaki komutu kullanarak src dizinine klonlayın: 28 | 29 | `git clone https://github.com/abdulkadrtr/multiRobotExploration.git` 30 | 31 | 4 - Proje dosyalarını ros2_ws dizininde colcon build komutu ile derleyin: 32 | 33 | `cd ros2_ws` 34 | 35 | `colcon build` 36 | 37 | 5 - Projeyi aşağıdaki komutla kaynaklayın. `source install/setup.bash` 38 | 39 | 6 - Gazebo ortamını ve robotları aşağıdaki komutu kullanarak terminalde başlatın: 40 | 41 | `ros2 launch turtlebot3_gazebo multi_robot_launch.py` 42 | 43 | 7 - Harita birleştirme paketini başlatmak için başka bir terminalde aşağıdaki komutu kullanın: 44 | 45 | `ros2 launch merge_map merge_map_launch.py` 46 | 47 | Bu, harita birleştirme işlemini başlatacak ve birleştirilmiş haritayı bir RViz2 penceresinde, robotların gerçek 48 | zamanlı yolları ve dronun canlı görüntü akışıyla birlikte görüntüleyecektir. 49 | 50 | 8 - Son olarak, üçüncü bir terminalde aşağıdaki komutu kullanarak otonom keşif merkezini başlatın: 51 | 52 | `ros2 run multi_robot_exploration control` 53 | 54 | Bu adımları takip ederek projeniz artık çalışır durumda olacak ve robotlar ortamı otonom olarak keşfe çıkarak haritaları birleştirip tek bir harita oluşturacaklardır. 55 | 56 | # YouTube Proje Tanıtım ve Demo Videosu 57 | 58 | https://youtu.be/6FtEvvi4lk4 59 | 60 | # Tüm Robotlar Çalışırken Simulasyon Görüntüsü 61 | 62 | ![Screenshot from 2023-04-14 15-09-45](https://user-images.githubusercontent.com/87595266/232044431-143e2592-d4f9-404b-89fd-243b9af53d68.png) 63 | 64 | # ROS 2 Iletişim Ağı 65 | 66 | ![rosgraph](https://user-images.githubusercontent.com/87595266/232061251-64c3ed55-8297-4057-86f8-11599ae4cfa8.svg) 67 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package turtlebot3_gazebo 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 2.2.6 (2202-05-26) 6 | ------------------ 7 | * ROS2 Humble Hawksbill supported 8 | 9 | 2.2.5 (2021-08-25) 10 | ------------------ 11 | * Release for ROS2 Rolling 12 | * Contributors: Will Son 13 | 14 | 2.2.4 (2021-06-14) 15 | ------------------ 16 | * Release for ROS2 Galactic 17 | * Separate world and robot models(#162) 18 | * Clean up unncessary files 19 | * Use turtlebot3_common mesh modeling 20 | * Independent turtlebot3_simulations package 21 | * Contributors: Joep Tool, Will Son 22 | 23 | 2.2.3 (2021-04-12) 24 | ------------------ 25 | * Update required keyword arguments 26 | * Clear up exec_depend 27 | * Fix Waffle Pi wheel inertia 28 | * Contributors: ruffsl, Will Son 29 | 30 | 2.2.2 (2021-02-24) 31 | ------------------ 32 | * Remove shared objects built in older version 33 | * Contributors: Will Son 34 | 35 | 2.2.1 (2021-01-13) 36 | ------------------ 37 | * Eloquent Elusor EOL 38 | * Add missing imu joint in sdf 39 | * Append Gazebo model path 40 | * Portable fix, launch description revise 41 | * Ament lint applied 42 | * Contributors: minwoominwoominwoo7, Rayman, seanyen, ashe kim, Will Son 43 | 44 | 2.2.0 (2020-06-29) 45 | ------------------ 46 | * TurtleBot3 Drive node implementation 47 | * Additional Gazebo maps added 48 | * argument tags in the sdf file replaced with remapping tags 49 | * Low polygon 3D modeling applied for simulation 50 | * Contributors: Ryan Shim, Mikael Arguedas, Will Son 51 | 52 | 2.1.0 (2019-09-10) 53 | ------------------ 54 | * Added turtlebot3_house and related world, model files 55 | * Contributors: Ryan Shim 56 | 57 | 2.0.1 (2019-09-05) 58 | ------------------ 59 | * Modified dependency packages 60 | * Modified launch directory 61 | * Added a launch file for robot state publisher 62 | * Contributors: Darby Lim, Pyo 63 | 64 | 2.0.0 (2019-08-20) 65 | ------------------ 66 | * Supported ROS 2 Dashing Diademata 67 | * Updated the CHANGELOG and version to release binary packages 68 | * Contributors: Darby Lim, Pyo 69 | 70 | 1.3.0 (2020-06-29) 71 | ------------------ 72 | * Turtlebot3 Autorace 2020 implemented 73 | * Remove the plugin_path from gazebo_ros export 74 | * Remove *nix path separator 75 | * Contributors: Ashe Kim, Ben Wolsieffer, Sean Yen 76 | 77 | 1.2.0 (2019-01-22) 78 | ------------------ 79 | * moved into `#65 `_ 80 | * modified ML stage 81 | * delete unused param 82 | * update algorithm and modified variable more clearly 83 | * Contributors: Darby Lim, Gilbert, Louise Poubel, Pyo 84 | 85 | 1.1.0 (2018-07-20) 86 | ------------------ 87 | * modified uri path 88 | * modified autorace 89 | * delete remap 90 | * Contributors: Darby Lim, Gilbert, Pyo 91 | 92 | 1.0.2 (2018-06-01) 93 | ------------------ 94 | * added mission.launch modified model.sdf 95 | * deleted turtlebot3's gazebo plugins 96 | * modified autorace gazebo 97 | * merged pull request `#53 `_ `#52 `_ `#51 `_ `#50 `_ `#49 `_ 98 | * Contributors: Gilbert, Darby Lim, Pyo 99 | 100 | 1.0.1 (2018-05-30) 101 | ------------------ 102 | * resolving dependency issues: 103 | http://build.ros.org/job/Kbin_dj_dJ64__turtlebot3_gazebo__debian_jessie_amd64__binary/2/ 104 | * Contributors: Pyo 105 | 106 | 1.0.0 (2018-05-29) 107 | ------------------ 108 | * added world for turtlebot3_autorace 109 | * added world for turtlebot3_machine_learning 110 | * merged pull request `#46 `_ from AuTURBO/develop 111 | add turtlebot3_autorace world' 112 | * merged pull request `#48 `_ `#47 `_ `#44 `_ `#42 `_ `#41 `_ 113 | * Contributors: Darby Lim, Gilbert, hyunoklee, Pyo 114 | 115 | 0.2.4 (2018-03-14) 116 | ------------------ 117 | * none 118 | 119 | 0.2.3 (2018-03-14) 120 | ------------------ 121 | * solved DuplicateVersionsException error 122 | * Contributors: Pyo 123 | 124 | 0.2.2 (2018-03-14) 125 | ------------------ 126 | * none 127 | 128 | 0.2.1 (2018-03-14) 129 | ------------------ 130 | * added worlds for gazebo and turtlebot3 131 | * Contributors: Darby Lim 132 | 133 | 0.2.0 (2018-03-13) 134 | ------------------ 135 | * added slam with multiple tb3 136 | * added multi example 137 | * added turtlebot3_house 138 | * modified cmake file 139 | * modified spwn model name 140 | * modified multi slam param 141 | * modified camera position 142 | * modified folder name 143 | * Contributors: Darby Lim 144 | 145 | 0.1.7 (2017-08-16) 146 | ------------------ 147 | * renamed missed the install rule (worlds -> models) 148 | * Contributors: Darby Lim, Tully Foote 149 | 150 | 0.1.6 (2017-08-14) 151 | ------------------ 152 | * modified folder name and model path 153 | * updated rviz and add static tf publisher for depth camera 154 | * Contributors: Darby Lim 155 | 156 | 0.1.5 (2017-06-09) 157 | ------------------ 158 | * modified make files for dependencies 159 | * updated turtlebot3 sim 160 | * updated world config 161 | * Contributors: Darby Lim 162 | 163 | 0.1.4 (2017-05-23) 164 | ------------------ 165 | * added as new meta-packages and version update (0.1.4) 166 | * Contributors: Darby Lim, Pyo 167 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Set minimum required version of cmake, project name and compile options 3 | ################################################################################ 4 | cmake_minimum_required(VERSION 3.5) 5 | project(turtlebot3_gazebo) 6 | 7 | if(NOT CMAKE_CXX_STANDARD) 8 | set(CMAKE_CXX_STANDARD 17) 9 | endif() 10 | 11 | if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") 12 | add_compile_options(-Wall -Wextra -Wpedantic) 13 | endif() 14 | 15 | if(MSVC) 16 | add_compile_definitions(_USE_MATH_DEFINES) 17 | endif() 18 | 19 | ################################################################################ 20 | # Find ament packages and libraries for ament and system dependencies 21 | ################################################################################ 22 | find_package(ament_cmake REQUIRED) 23 | find_package(gazebo REQUIRED) 24 | find_package(gazebo_ros_pkgs REQUIRED) 25 | find_package(geometry_msgs REQUIRED) 26 | find_package(nav_msgs REQUIRED) 27 | find_package(rclcpp REQUIRED) 28 | find_package(sensor_msgs REQUIRED) 29 | find_package(tf2 REQUIRED) 30 | 31 | ################################################################################ 32 | # Build 33 | ################################################################################ 34 | link_directories( 35 | ${GAZEBO_LIBRARY_DIRS} 36 | ) 37 | 38 | include_directories( 39 | include 40 | ${GAZEBO_INCLUDE_DIRS} 41 | ) 42 | 43 | set(dependencies 44 | "geometry_msgs" 45 | "nav_msgs" 46 | "rclcpp" 47 | "sensor_msgs" 48 | "tf2" 49 | ) 50 | 51 | set(EXEC_NAME "turtlebot3_drive") 52 | 53 | add_executable(${EXEC_NAME} src/turtlebot3_drive.cpp) 54 | ament_target_dependencies(${EXEC_NAME} ${dependencies}) 55 | 56 | add_library(obstacle1 SHARED models/turtlebot3_dqn_world/obstacle_plugin/obstacle1.cc) 57 | target_link_libraries(obstacle1 ${GAZEBO_LIBRARIES}) 58 | 59 | add_library(obstacle2 SHARED models/turtlebot3_dqn_world/obstacle_plugin/obstacle2.cc) 60 | target_link_libraries(obstacle2 ${GAZEBO_LIBRARIES}) 61 | 62 | add_library(obstacles SHARED models/turtlebot3_dqn_world/obstacle_plugin/obstacles.cc) 63 | target_link_libraries(obstacles ${GAZEBO_LIBRARIES}) 64 | 65 | ################################################################################ 66 | # Install 67 | ################################################################################ 68 | install(TARGETS ${EXEC_NAME} 69 | DESTINATION lib/${PROJECT_NAME} 70 | ) 71 | 72 | install(DIRECTORY launch models rviz urdf worlds config 73 | DESTINATION share/${PROJECT_NAME}/ 74 | ) 75 | 76 | install(DIRECTORY include/ 77 | DESTINATION include/ 78 | ) 79 | 80 | ################################################################################ 81 | # Macro for ament package 82 | ################################################################################ 83 | ament_export_include_directories(include) 84 | ament_export_dependencies(gazebo_ros_pkgs) 85 | ament_export_dependencies(geometry_msgs) 86 | ament_export_dependencies(nav_msgs) 87 | ament_export_dependencies(rclcpp) 88 | ament_export_dependencies(sensor_msgs) 89 | ament_export_dependencies(tf2) 90 | ament_package() 91 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/config/tb3_0.rviz: -------------------------------------------------------------------------------- 1 | Panels: 2 | - Class: rviz_common/Displays 3 | Help Height: 78 4 | Name: Displays 5 | Property Tree Widget: 6 | Expanded: 7 | - /Global Options1 8 | - /Status1 9 | - /TF1/Status1 10 | Splitter Ratio: 0.5 11 | Tree Height: 223 12 | - Class: rviz_common/Selection 13 | Name: Selection 14 | - Class: rviz_common/Tool Properties 15 | Expanded: 16 | - /2D Goal Pose1 17 | - /Publish Point1 18 | Name: Tool Properties 19 | Splitter Ratio: 0.5886790156364441 20 | - Class: rviz_common/Views 21 | Expanded: 22 | - /Current View1 23 | Name: Views 24 | Splitter Ratio: 0.5 25 | - Class: rviz_common/Time 26 | Experimental: false 27 | Name: Time 28 | SyncMode: 0 29 | SyncSource: LaserScan 30 | Visualization Manager: 31 | Class: "" 32 | Displays: 33 | - Alpha: 0.5 34 | Cell Size: 1 35 | Class: rviz_default_plugins/Grid 36 | Color: 160; 160; 164 37 | Enabled: true 38 | Line Style: 39 | Line Width: 0.029999999329447746 40 | Value: Lines 41 | Name: Grid 42 | Normal Cell Count: 0 43 | Offset: 44 | X: 0 45 | Y: 0 46 | Z: 0 47 | Plane: XY 48 | Plane Cell Count: 10 49 | Reference Frame: 50 | Value: true 51 | - Alpha: 0.699999988079071 52 | Class: rviz_default_plugins/Map 53 | Color Scheme: map 54 | Draw Behind: false 55 | Enabled: true 56 | Name: Map 57 | Topic: 58 | Depth: 5 59 | Durability Policy: Volatile 60 | Filter size: 10 61 | History Policy: Keep Last 62 | Reliability Policy: Reliable 63 | Value: /tb3_0/map 64 | Update Topic: 65 | Depth: 5 66 | Durability Policy: Volatile 67 | History Policy: Keep Last 68 | Reliability Policy: Reliable 69 | Value: /tb3_0/map_updates 70 | Use Timestamp: false 71 | Value: true 72 | - Class: rviz_default_plugins/TF 73 | Enabled: true 74 | Frame Timeout: 15 75 | Frames: 76 | All Enabled: true 77 | tb3_0/base_footprint: 78 | Value: true 79 | tb3_0/base_link: 80 | Value: true 81 | tb3_0/base_scan: 82 | Value: true 83 | tb3_0/caster_back_link: 84 | Value: true 85 | tb3_0/imu_link: 86 | Value: true 87 | tb3_0/map: 88 | Value: true 89 | tb3_0/odom: 90 | Value: true 91 | tb3_0/wheel_left_link: 92 | Value: true 93 | tb3_0/wheel_right_link: 94 | Value: true 95 | tb3_1/base_footprint: 96 | Value: true 97 | tb3_1/base_link: 98 | Value: true 99 | tb3_1/base_scan: 100 | Value: true 101 | tb3_1/caster_back_link: 102 | Value: true 103 | tb3_1/imu_link: 104 | Value: true 105 | tb3_1/map: 106 | Value: true 107 | tb3_1/odom: 108 | Value: true 109 | tb3_1/wheel_left_link: 110 | Value: true 111 | tb3_1/wheel_right_link: 112 | Value: true 113 | Marker Scale: 1 114 | Name: TF 115 | Show Arrows: true 116 | Show Axes: true 117 | Show Names: false 118 | Tree: 119 | tb3_0/map: 120 | tb3_0/odom: 121 | tb3_0/base_footprint: 122 | tb3_0/base_link: 123 | tb3_0/base_scan: 124 | {} 125 | tb3_0/caster_back_link: 126 | {} 127 | tb3_0/imu_link: 128 | {} 129 | tb3_0/wheel_left_link: 130 | {} 131 | tb3_0/wheel_right_link: 132 | {} 133 | Update Interval: 0 134 | Value: true 135 | - Alpha: 1 136 | Autocompute Intensity Bounds: true 137 | Autocompute Value Bounds: 138 | Max Value: 10 139 | Min Value: -10 140 | Value: true 141 | Axis: Z 142 | Channel Name: intensity 143 | Class: rviz_default_plugins/LaserScan 144 | Color: 255; 255; 255 145 | Color Transformer: Intensity 146 | Decay Time: 0 147 | Enabled: true 148 | Invert Rainbow: false 149 | Max Color: 255; 255; 255 150 | Max Intensity: 0 151 | Min Color: 0; 0; 0 152 | Min Intensity: 0 153 | Name: LaserScan 154 | Position Transformer: XYZ 155 | Selectable: true 156 | Size (Pixels): 3 157 | Size (m): 0.009999999776482582 158 | Style: Flat Squares 159 | Topic: 160 | Depth: 5 161 | Durability Policy: Volatile 162 | Filter size: 10 163 | History Policy: Keep Last 164 | Reliability Policy: Reliable 165 | Value: /tb3_0/scan 166 | Use Fixed Frame: true 167 | Use rainbow: true 168 | Value: true 169 | Enabled: true 170 | Global Options: 171 | Background Color: 48; 48; 48 172 | Fixed Frame: tb3_0/map 173 | Frame Rate: 30 174 | Name: root 175 | Tools: 176 | - Class: rviz_default_plugins/Interact 177 | Hide Inactive Objects: true 178 | - Class: rviz_default_plugins/MoveCamera 179 | - Class: rviz_default_plugins/Select 180 | - Class: rviz_default_plugins/FocusCamera 181 | - Class: rviz_default_plugins/Measure 182 | Line color: 128; 128; 0 183 | - Class: rviz_default_plugins/SetInitialPose 184 | Covariance x: 0.25 185 | Covariance y: 0.25 186 | Covariance yaw: 0.06853891909122467 187 | Topic: 188 | Depth: 5 189 | Durability Policy: Volatile 190 | History Policy: Keep Last 191 | Reliability Policy: Reliable 192 | Value: /initialpose 193 | - Class: rviz_default_plugins/SetGoal 194 | Topic: 195 | Depth: 5 196 | Durability Policy: Volatile 197 | History Policy: Keep Last 198 | Reliability Policy: Reliable 199 | Value: /goal_pose 200 | - Class: rviz_default_plugins/PublishPoint 201 | Single click: true 202 | Topic: 203 | Depth: 5 204 | Durability Policy: Volatile 205 | History Policy: Keep Last 206 | Reliability Policy: Reliable 207 | Value: /clicked_point 208 | Transformation: 209 | Current: 210 | Class: rviz_default_plugins/TF 211 | Value: true 212 | Views: 213 | Current: 214 | Class: rviz_default_plugins/Orbit 215 | Distance: 6.068111419677734 216 | Enable Stereo Rendering: 217 | Stereo Eye Separation: 0.05999999865889549 218 | Stereo Focal Distance: 1 219 | Swap Stereo Eyes: false 220 | Value: false 221 | Focal Point: 222 | X: 0 223 | Y: 0 224 | Z: 0 225 | Focal Shape Fixed Size: true 226 | Focal Shape Size: 0.05000000074505806 227 | Invert Z Axis: false 228 | Name: Current View 229 | Near Clip Distance: 0.009999999776482582 230 | Pitch: 1.5697963237762451 231 | Target Frame: 232 | Value: Orbit (rviz) 233 | Yaw: 3.1203975677490234 234 | Saved: ~ 235 | Window Geometry: 236 | Displays: 237 | collapsed: true 238 | Height: 520 239 | Hide Left Dock: true 240 | Hide Right Dock: true 241 | QMainWindow State: 000000ff00000000fd0000000400000000000001560000016afc0200000008fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073000000003d0000016a000000c900fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261000000010000010f00000168fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073000000003d00000168000000a400fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000002fb0000003efc0100000002fb0000000800540069006d00650100000000000002fb000002fb00fffffffb0000000800540069006d00650100000000000004500000000000000000000002fb0000016a00000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 242 | Selection: 243 | collapsed: false 244 | Time: 245 | collapsed: false 246 | Tool Properties: 247 | collapsed: false 248 | Views: 249 | collapsed: true 250 | Width: 763 251 | X: 250 252 | Y: 79 253 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/config/tb3_1.rviz: -------------------------------------------------------------------------------- 1 | Panels: 2 | - Class: rviz_common/Displays 3 | Help Height: 78 4 | Name: Displays 5 | Property Tree Widget: 6 | Expanded: 7 | - /Global Options1 8 | - /Status1 9 | - /TF1 10 | Splitter Ratio: 0.5 11 | Tree Height: 221 12 | - Class: rviz_common/Selection 13 | Name: Selection 14 | - Class: rviz_common/Tool Properties 15 | Expanded: 16 | - /2D Goal Pose1 17 | - /Publish Point1 18 | Name: Tool Properties 19 | Splitter Ratio: 0.5886790156364441 20 | - Class: rviz_common/Views 21 | Expanded: 22 | - /Current View1 23 | Name: Views 24 | Splitter Ratio: 0.5 25 | - Class: rviz_common/Time 26 | Experimental: false 27 | Name: Time 28 | SyncMode: 0 29 | SyncSource: LaserScan 30 | Visualization Manager: 31 | Class: "" 32 | Displays: 33 | - Alpha: 0.5 34 | Cell Size: 1 35 | Class: rviz_default_plugins/Grid 36 | Color: 160; 160; 164 37 | Enabled: true 38 | Line Style: 39 | Line Width: 0.029999999329447746 40 | Value: Lines 41 | Name: Grid 42 | Normal Cell Count: 0 43 | Offset: 44 | X: 0 45 | Y: 0 46 | Z: 0 47 | Plane: XY 48 | Plane Cell Count: 10 49 | Reference Frame: 50 | Value: true 51 | - Alpha: 0.699999988079071 52 | Class: rviz_default_plugins/Map 53 | Color Scheme: map 54 | Draw Behind: false 55 | Enabled: true 56 | Name: Map 57 | Topic: 58 | Depth: 5 59 | Durability Policy: Volatile 60 | Filter size: 10 61 | History Policy: Keep Last 62 | Reliability Policy: Reliable 63 | Value: /tb3_1/map 64 | Update Topic: 65 | Depth: 5 66 | Durability Policy: Volatile 67 | History Policy: Keep Last 68 | Reliability Policy: Reliable 69 | Value: /tb3_1/map_updates 70 | Use Timestamp: false 71 | Value: true 72 | - Class: rviz_default_plugins/TF 73 | Enabled: true 74 | Frame Timeout: 15 75 | Frames: 76 | All Enabled: true 77 | tb3_0/base_footprint: 78 | Value: true 79 | tb3_0/base_link: 80 | Value: true 81 | tb3_0/base_scan: 82 | Value: true 83 | tb3_0/caster_back_link: 84 | Value: true 85 | tb3_0/imu_link: 86 | Value: true 87 | tb3_0/map: 88 | Value: true 89 | tb3_0/odom: 90 | Value: true 91 | tb3_0/wheel_left_link: 92 | Value: true 93 | tb3_0/wheel_right_link: 94 | Value: true 95 | tb3_1/base_footprint: 96 | Value: true 97 | tb3_1/base_link: 98 | Value: true 99 | tb3_1/base_scan: 100 | Value: true 101 | tb3_1/caster_back_link: 102 | Value: true 103 | tb3_1/imu_link: 104 | Value: true 105 | tb3_1/map: 106 | Value: true 107 | tb3_1/odom: 108 | Value: true 109 | tb3_1/wheel_left_link: 110 | Value: true 111 | tb3_1/wheel_right_link: 112 | Value: true 113 | Marker Scale: 1 114 | Name: TF 115 | Show Arrows: true 116 | Show Axes: true 117 | Show Names: false 118 | Tree: 119 | tb3_1/map: 120 | tb3_1/odom: 121 | tb3_1/base_footprint: 122 | tb3_1/base_link: 123 | tb3_1/base_scan: 124 | {} 125 | tb3_1/caster_back_link: 126 | {} 127 | tb3_1/imu_link: 128 | {} 129 | tb3_1/wheel_left_link: 130 | {} 131 | tb3_1/wheel_right_link: 132 | {} 133 | Update Interval: 0 134 | Value: true 135 | - Alpha: 1 136 | Autocompute Intensity Bounds: true 137 | Autocompute Value Bounds: 138 | Max Value: 10 139 | Min Value: -10 140 | Value: true 141 | Axis: Z 142 | Channel Name: intensity 143 | Class: rviz_default_plugins/LaserScan 144 | Color: 255; 255; 255 145 | Color Transformer: Intensity 146 | Decay Time: 0 147 | Enabled: true 148 | Invert Rainbow: false 149 | Max Color: 255; 255; 255 150 | Max Intensity: 0 151 | Min Color: 0; 0; 0 152 | Min Intensity: 0 153 | Name: LaserScan 154 | Position Transformer: XYZ 155 | Selectable: true 156 | Size (Pixels): 3 157 | Size (m): 0.009999999776482582 158 | Style: Flat Squares 159 | Topic: 160 | Depth: 5 161 | Durability Policy: Volatile 162 | Filter size: 10 163 | History Policy: Keep Last 164 | Reliability Policy: Reliable 165 | Value: /tb3_1/scan 166 | Use Fixed Frame: true 167 | Use rainbow: true 168 | Value: true 169 | Enabled: true 170 | Global Options: 171 | Background Color: 48; 48; 48 172 | Fixed Frame: tb3_1/map 173 | Frame Rate: 30 174 | Name: root 175 | Tools: 176 | - Class: rviz_default_plugins/Interact 177 | Hide Inactive Objects: true 178 | - Class: rviz_default_plugins/MoveCamera 179 | - Class: rviz_default_plugins/Select 180 | - Class: rviz_default_plugins/FocusCamera 181 | - Class: rviz_default_plugins/Measure 182 | Line color: 128; 128; 0 183 | - Class: rviz_default_plugins/SetInitialPose 184 | Covariance x: 0.25 185 | Covariance y: 0.25 186 | Covariance yaw: 0.06853891909122467 187 | Topic: 188 | Depth: 5 189 | Durability Policy: Volatile 190 | History Policy: Keep Last 191 | Reliability Policy: Reliable 192 | Value: /initialpose 193 | - Class: rviz_default_plugins/SetGoal 194 | Topic: 195 | Depth: 5 196 | Durability Policy: Volatile 197 | History Policy: Keep Last 198 | Reliability Policy: Reliable 199 | Value: /goal_pose 200 | - Class: rviz_default_plugins/PublishPoint 201 | Single click: true 202 | Topic: 203 | Depth: 5 204 | Durability Policy: Volatile 205 | History Policy: Keep Last 206 | Reliability Policy: Reliable 207 | Value: /clicked_point 208 | Transformation: 209 | Current: 210 | Class: rviz_default_plugins/TF 211 | Value: true 212 | Views: 213 | Current: 214 | Class: rviz_default_plugins/Orbit 215 | Distance: 4.57716703414917 216 | Enable Stereo Rendering: 217 | Stereo Eye Separation: 0.05999999865889549 218 | Stereo Focal Distance: 1 219 | Swap Stereo Eyes: false 220 | Value: false 221 | Focal Point: 222 | X: 0.6427488923072815 223 | Y: -0.020055752247571945 224 | Z: 0.0006430645007640123 225 | Focal Shape Fixed Size: true 226 | Focal Shape Size: 0.05000000074505806 227 | Invert Z Axis: false 228 | Name: Current View 229 | Near Clip Distance: 0.009999999776482582 230 | Pitch: 1.5697963237762451 231 | Target Frame: 232 | Value: Orbit (rviz) 233 | Yaw: 3.1153998374938965 234 | Saved: ~ 235 | Window Geometry: 236 | Displays: 237 | collapsed: true 238 | Height: 527 239 | Hide Left Dock: true 240 | Hide Right Dock: true 241 | QMainWindow State: 000000ff00000000fd00000004000000000000015600000168fc0200000008fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073000000003d00000168000000c900fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261000000010000010f00000168fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073000000003d00000168000000a400fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000002fb0000003efc0100000002fb0000000800540069006d00650100000000000002fb000002fb00fffffffb0000000800540069006d00650100000000000004500000000000000000000002fb0000017100000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 242 | Selection: 243 | collapsed: false 244 | Time: 245 | collapsed: false 246 | Tool Properties: 247 | collapsed: false 248 | Views: 249 | collapsed: true 250 | Width: 763 251 | X: 34 252 | Y: 94 253 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/include/turtlebot3_gazebo/turtlebot3_drive.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2019 ROBOTIS CO., LTD. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // 15 | // Authors: Taehun Lim (Darby), Ryan Shim 16 | 17 | #ifndef TURTLEBOT3_GAZEBO__TURTLEBOT3_DRIVE_HPP_ 18 | #define TURTLEBOT3_GAZEBO__TURTLEBOT3_DRIVE_HPP_ 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | #define DEG2RAD (M_PI / 180.0) 28 | #define RAD2DEG (180.0 / M_PI) 29 | 30 | #define CENTER 0 31 | #define LEFT 1 32 | #define RIGHT 2 33 | 34 | #define LINEAR_VELOCITY 0.3 35 | #define ANGULAR_VELOCITY 1.5 36 | 37 | #define GET_TB3_DIRECTION 0 38 | #define TB3_DRIVE_FORWARD 1 39 | #define TB3_RIGHT_TURN 2 40 | #define TB3_LEFT_TURN 3 41 | 42 | class Turtlebot3Drive : public rclcpp::Node 43 | { 44 | public: 45 | Turtlebot3Drive(); 46 | ~Turtlebot3Drive(); 47 | 48 | private: 49 | // ROS topic publishers 50 | rclcpp::Publisher::SharedPtr cmd_vel_pub_; 51 | 52 | // ROS topic subscribers 53 | rclcpp::Subscription::SharedPtr scan_sub_; 54 | rclcpp::Subscription::SharedPtr odom_sub_; 55 | 56 | // Variables 57 | double robot_pose_; 58 | double prev_robot_pose_; 59 | double scan_data_[3]; 60 | 61 | // ROS timer 62 | rclcpp::TimerBase::SharedPtr update_timer_; 63 | 64 | // Function prototypes 65 | void update_callback(); 66 | void update_cmd_vel(double linear, double angular); 67 | void scan_callback(const sensor_msgs::msg::LaserScan::SharedPtr msg); 68 | void odom_callback(const nav_msgs::msg::Odometry::SharedPtr msg); 69 | }; 70 | #endif // TURTLEBOT3_GAZEBO__TURTLEBOT3_DRIVE_HPP_ 71 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/launch/multi_robot_launch.py: -------------------------------------------------------------------------------- 1 | # Authors: Abdulkadir Ture 2 | # Github : abdulkadrtr 3 | 4 | import os 5 | 6 | from ament_index_python.packages import get_package_share_directory 7 | from launch import LaunchDescription 8 | from launch.actions import IncludeLaunchDescription 9 | from launch.launch_description_sources import PythonLaunchDescriptionSource 10 | from launch.substitutions import LaunchConfiguration 11 | from launch_ros.actions import Node 12 | 13 | 14 | def generate_launch_description(): 15 | model_folder = 'turtlebot3_burger' 16 | pkg_gazebo_ros = get_package_share_directory('gazebo_ros') 17 | robot_desc_path = os.path.join(get_package_share_directory("turtlebot3_gazebo"), "urdf", "turtlebot3_burger.urdf") 18 | world = os.path.join(get_package_share_directory('turtlebot3_gazebo'),'worlds','turtlebot3_house.world') 19 | urdf_path1 = os.path.join(get_package_share_directory('turtlebot3_gazebo'),'models',model_folder+'_0','model.sdf') 20 | urdf_path2 = os.path.join(get_package_share_directory('turtlebot3_gazebo'),'models',model_folder+'_1','model.sdf') 21 | with open(robot_desc_path, 'r') as infp: 22 | robot_desc = infp.read() 23 | name1 = "tb3_0" 24 | name2 = "tb3_1" 25 | # 1. ROBOT ICIN KODLAR 26 | spawn_robot1 = Node( 27 | package='gazebo_ros', 28 | executable='spawn_entity.py', 29 | arguments=[ 30 | '-entity', name1, 31 | '-file', urdf_path1, 32 | '-x', '5.0', 33 | '-y', '2.5', 34 | '-z', '0.01', 35 | '-robot_namespace', name1, 36 | ], 37 | output='screen' 38 | ) 39 | robot_state_publisher1 = Node( 40 | package='robot_state_publisher', 41 | executable='robot_state_publisher', 42 | name='robot_state_publisher', 43 | namespace=name1, 44 | output='screen', 45 | parameters=[{'frame_prefix': name1 + '/', 46 | 'use_sim_time': True, 47 | 'robot_description': robot_desc}] 48 | ) 49 | async_slam_toolbox1 = Node( 50 | package='slam_toolbox', 51 | executable='async_slam_toolbox_node', 52 | name='async_slam_toolbox_node', 53 | namespace=name1, 54 | parameters=[{ 55 | 'use_sim_time': True, 56 | 'odom_frame': name1 + '/odom', 57 | 'base_frame': name1 + '/base_footprint', 58 | 'scan_topic': 'scan', 59 | 'map_frame': name1 + '/map', 60 | 'minimum_travel_distance': 0.3, 61 | 'minimum_travel_heading': 0.3, 62 | 'resolution': 0.05, 63 | }], 64 | remappings=[ 65 | ("/map", "map"), 66 | ("/map_metadata", "map_metadata"), 67 | ("/slam_toolbox/scan_visualization", "slam_toolbox/scan_visualization"), 68 | ("/slam_toolbox/graph_visualization", "slam_toolbox/graph_visualization"), 69 | ], 70 | output='screen', 71 | ) 72 | rviz1 = Node( 73 | package='rviz2', 74 | executable='rviz2', 75 | name='rviz2', 76 | output='screen', 77 | arguments=['-d', os.path.join(get_package_share_directory('turtlebot3_gazebo'), 'config',name1+'.rviz')] 78 | ) 79 | # 2. ROBOT ICIN KODLAR 80 | 81 | spawn_robot2 = Node( 82 | package='gazebo_ros', 83 | executable='spawn_entity.py', 84 | arguments=[ 85 | '-entity', name2, 86 | '-file', urdf_path2, 87 | '-x', '-4.6', 88 | '-y', '3.0', 89 | '-z', '0.01', 90 | '-robot_namespace', name2, 91 | ], 92 | output='screen' 93 | ) 94 | robot_state_publisher2 = Node( 95 | package='robot_state_publisher', 96 | executable='robot_state_publisher', 97 | name='robot_state_publisher', 98 | namespace=name2, 99 | output='screen', 100 | parameters=[{'frame_prefix': name2 + '/', 101 | 'use_sim_time': True, 102 | 'robot_description': robot_desc}] 103 | ) 104 | async_slam_toolbox2 = Node( 105 | package='slam_toolbox', 106 | executable='async_slam_toolbox_node', 107 | name='async_slam_toolbox_node', 108 | namespace=name2, 109 | parameters=[{ 110 | 'use_sim_time': True, 111 | 'odom_frame': name2 + '/odom', 112 | 'base_frame': name2 + '/base_footprint', 113 | 'scan_topic': 'scan', 114 | 'map_frame': name2 + '/map', 115 | 'minimum_travel_distance': 0.3, 116 | 'minimum_travel_heading': 0.3, 117 | 'resolution': 0.05, 118 | }], 119 | remappings=[ 120 | ("/map", "map"), 121 | ("/map_metadata", "map_metadata"), 122 | ("/slam_toolbox/scan_visualization", "slam_toolbox/scan_visualization"), 123 | ("/slam_toolbox/graph_visualization", "slam_toolbox/graph_visualization"), 124 | ], 125 | output='screen', 126 | ) 127 | rviz2 = Node( 128 | package='rviz2', 129 | executable='rviz2', 130 | name='rviz2', 131 | output='screen', 132 | arguments=['-d', os.path.join(get_package_share_directory('turtlebot3_gazebo'), 'config', name2+'.rviz')] 133 | ) 134 | # GAZEBO ICIN KODLAR 135 | gzserver_cmd = IncludeLaunchDescription( 136 | PythonLaunchDescriptionSource( 137 | os.path.join(pkg_gazebo_ros, 'launch', 'gzserver.launch.py') 138 | ), 139 | launch_arguments={'world': world,'verbose':"true",'extra_gazebo_args': 'verbose'}.items() 140 | ) 141 | 142 | gzclient_cmd = IncludeLaunchDescription( 143 | PythonLaunchDescriptionSource( 144 | os.path.join(pkg_gazebo_ros, 'launch', 'gzclient.launch.py') 145 | ), 146 | launch_arguments={'verbose':"true"}.items() 147 | ) 148 | pathFollow1 = Node( 149 | package='path_follow', 150 | executable='path_follow', 151 | name='pathFollow', 152 | output='screen', 153 | namespace=name1, 154 | parameters=[{ 155 | 'use_sim_time': True, 156 | }], 157 | remappings=[ 158 | ("/path", "/"+name1+"/path"), 159 | ("/cmd_vel", "/"+name1+"/cmd_vel"), 160 | ("/odom", "/"+name1+"/odom"), 161 | ("/visual_path", "/"+name2+"/visual_path"), 162 | ] 163 | ) 164 | pathFollow2 = Node( 165 | package='path_follow', 166 | executable='path_follow', 167 | name='pathFollow', 168 | output='screen', 169 | namespace=name2, 170 | parameters=[{ 171 | 'use_sim_time': True, 172 | }], 173 | remappings=[ 174 | ("/path", "/"+name2+"/path"), 175 | ("/cmd_vel", "/"+name2+"/cmd_vel"), 176 | ("/odom", "/"+name2+"/odom"), 177 | ("/visual_path", "/"+name1+"/visual_path"), 178 | ] 179 | ) 180 | sjtu_drone_bringup_path = get_package_share_directory('sjtu_drone_bringup') 181 | drone = IncludeLaunchDescription( 182 | PythonLaunchDescriptionSource( 183 | os.path.join(sjtu_drone_bringup_path, 'launch', 'sjtu_drone_gazebo.launch.py') 184 | ), 185 | ) 186 | drone_control = Node( 187 | package='drone_control', 188 | executable='drone_control', 189 | name='drone_control', 190 | output='screen', 191 | parameters=[{ 192 | 'use_sim_time': True, 193 | }], 194 | ) 195 | ld = LaunchDescription() 196 | ld.add_action(drone_control) 197 | ld.add_action(drone) 198 | ld.add_action(pathFollow1) 199 | ld.add_action(pathFollow2) 200 | ld.add_action(gzserver_cmd) 201 | ld.add_action(gzclient_cmd) 202 | ld.add_action(spawn_robot1) 203 | ld.add_action(robot_state_publisher1) 204 | ld.add_action(async_slam_toolbox1) 205 | ld.add_action(rviz1) 206 | ld.add_action(spawn_robot2) 207 | ld.add_action(robot_state_publisher2) 208 | ld.add_action(async_slam_toolbox2) 209 | ld.add_action(rviz2) 210 | return ld 211 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/launch/robot_state_publisher.launch.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # 3 | # Copyright 2019 ROBOTIS CO., LTD. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | # Authors: Darby Lim 18 | 19 | import os 20 | 21 | from ament_index_python.packages import get_package_share_directory 22 | from launch import LaunchDescription 23 | from launch.actions import DeclareLaunchArgument 24 | from launch.substitutions import LaunchConfiguration 25 | from launch_ros.actions import Node 26 | 27 | 28 | def generate_launch_description(): 29 | TURTLEBOT3_MODEL = os.environ['TURTLEBOT3_MODEL'] 30 | 31 | use_sim_time = LaunchConfiguration('use_sim_time', default='false') 32 | urdf_file_name = 'turtlebot3_' + TURTLEBOT3_MODEL + '.urdf' 33 | 34 | print('urdf_file_name : {}'.format(urdf_file_name)) 35 | 36 | urdf_path = os.path.join( 37 | get_package_share_directory('turtlebot3_gazebo'), 38 | 'urdf', 39 | urdf_file_name) 40 | 41 | with open(urdf_path, 'r') as infp: 42 | robot_desc = infp.read() 43 | 44 | return LaunchDescription([ 45 | DeclareLaunchArgument( 46 | 'use_sim_time', 47 | default_value='false', 48 | description='Use simulation (Gazebo) clock if true'), 49 | 50 | Node( 51 | package='robot_state_publisher', 52 | executable='robot_state_publisher', 53 | name='robot_state_publisher', 54 | output='screen', 55 | parameters=[{ 56 | 'use_sim_time': use_sim_time, 57 | 'robot_description': robot_desc 58 | }], 59 | ), 60 | ]) 61 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/launch/spawn_turtlebot3.launch.py: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Open Source Robotics Foundation, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import os 16 | 17 | from ament_index_python.packages import get_package_share_directory 18 | from launch import LaunchDescription 19 | from launch.actions import DeclareLaunchArgument 20 | from launch.substitutions import LaunchConfiguration 21 | from launch_ros.actions import Node 22 | 23 | 24 | def generate_launch_description(): 25 | # Get the urdf file 26 | TURTLEBOT3_MODEL = os.environ['TURTLEBOT3_MODEL'] 27 | model_folder = 'turtlebot3_' + TURTLEBOT3_MODEL 28 | urdf_path = os.path.join( 29 | get_package_share_directory('turtlebot3_gazebo'), 30 | 'models', 31 | model_folder, 32 | 'model.sdf' 33 | ) 34 | 35 | # Launch configuration variables specific to simulation 36 | x_pose = LaunchConfiguration('x_pose', default='0.0') 37 | y_pose = LaunchConfiguration('y_pose', default='0.0') 38 | 39 | # Declare the launch arguments 40 | declare_x_position_cmd = DeclareLaunchArgument( 41 | 'x_pose', default_value='0.0', 42 | description='Specify namespace of the robot') 43 | 44 | declare_y_position_cmd = DeclareLaunchArgument( 45 | 'y_pose', default_value='0.0', 46 | description='Specify namespace of the robot') 47 | 48 | start_gazebo_ros_spawner_cmd = Node( 49 | package='gazebo_ros', 50 | executable='spawn_entity.py', 51 | arguments=[ 52 | '-entity', TURTLEBOT3_MODEL, 53 | '-file', urdf_path, 54 | '-x', x_pose, 55 | '-y', y_pose, 56 | '-z', '0.01' 57 | ], 58 | output='screen', 59 | ) 60 | 61 | ld = LaunchDescription() 62 | 63 | # Declare the launch options 64 | ld.add_action(declare_x_position_cmd) 65 | ld.add_action(declare_y_position_cmd) 66 | 67 | # Add any conditioned actions 68 | ld.add_action(start_gazebo_ros_spawner_cmd) 69 | 70 | return ld 71 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/models/turtlebot3_burger_0/model.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | TurtleBot3(Burger) 5 | 2.0 6 | model-1_4.sdf 7 | model.sdf 8 | 9 | 10 | Taehun Lim(Darby) 11 | thlim@robotis.com 12 | 13 | 14 | 15 | TurtleBot3 Burger 16 | 17 | 18 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/models/turtlebot3_burger_1/model.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | TurtleBot3(Burger) 5 | 2.0 6 | model-1_4.sdf 7 | model.sdf 8 | 9 | 10 | Taehun Lim(Darby) 11 | thlim@robotis.com 12 | 13 | 14 | 15 | TurtleBot3 Burger 16 | 17 | 18 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/models/turtlebot3_common/model.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | TurtleBot3 Common Mesh 5 | 2.0 6 | 7 | 8 | Will Son 9 | willson@robotis.com 10 | 11 | 12 | 13 | TurtleBot3 Common Mesh 14 | 15 | 16 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/models/turtlebot3_dqn_world/goal_box/model.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | goal_box 4 | 1.0 5 | model.sdf 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/models/turtlebot3_dqn_world/goal_box/model.sdf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0 0 0 0 -0 -1.5708 5 | 6 | 7 | 0 0 0.0005 0 -0 0 8 | 9 | 10 | 0.3 11 | 0.001 12 | 13 | 14 | 15 | 19 | 1 0 0 1 20 | 21 | 22 | 0 0 0 0 -0 0 23 | 24 | 1 25 | 26 | 27 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/models/turtlebot3_dqn_world/inner_walls/model.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | inner_walls 4 | 1.0 5 | model.sdf 6 | 7 | 8 | Ryan Shim 9 | jhshim@robotis.com 10 | 11 | 12 | 13 | TurtleBot3 DQN World Inner Walls 14 | 15 | 16 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/models/turtlebot3_dqn_world/inner_walls/model.sdf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0 0 0 0 0 0 5 | 6 | 7 | 8 | 9 | 1 0.15 0.5 10 | 11 | 12 | 0 0 0.25 0 -0 0 13 | 14 | 15 | 0 0 0.25 0 -0 0 16 | 17 | 18 | 1 0.15 0.5 19 | 20 | 21 | 22 | 26 | 1 1 1 1 27 | 28 | 29 | -2.0 -1.5 0 0 -0 0 30 | 31 | 32 | 33 | 34 | 35 | 1 0.15 0.5 36 | 37 | 38 | 0 0 0.25 0 -0 0 39 | 40 | 41 | 0 0 0.25 0 -0 0 42 | 43 | 44 | 1 0.15 0.5 45 | 46 | 47 | 48 | 52 | 1 1 1 1 53 | 54 | 55 | -0.5 -2.0 0 0 0 -1.5708 56 | 57 | 58 | 59 | 60 | 61 | 1 0.15 0.5 62 | 63 | 64 | 0 0 0.25 0 -0 0 65 | 66 | 67 | 0 0 0.25 0 -0 0 68 | 69 | 70 | 1 0.15 0.5 71 | 72 | 73 | 74 | 78 | 1 1 1 1 79 | 80 | 81 | 1.0 -1.0 0 0 -0 1.5708 82 | 83 | 84 | 85 | 86 | 87 | 1 0.15 0.5 88 | 89 | 90 | 0 0 0.25 0 -0 0 91 | 92 | 93 | 0 0 0.25 0 -0 0 94 | 95 | 96 | 1 0.15 0.5 97 | 98 | 99 | 100 | 104 | 1 1 1 1 105 | 106 | 107 | 1.2 1.9 0 0 0 -1.5708 108 | 109 | 110 | 111 | 112 | 113 | 1 0.15 0.5 114 | 115 | 116 | 0 0 0.25 0 -0 0 117 | 118 | 119 | 0 0 0.25 0 -0 0 120 | 121 | 122 | 1 0.15 0.5 123 | 124 | 125 | 126 | 130 | 1 1 1 1 131 | 132 | 133 | 1.9 0.4 0 0 -0 0 134 | 135 | 136 | 137 | 138 | 139 | 1 0.15 0.5 140 | 141 | 142 | 0 0 0.25 0 -0 0 143 | 144 | 145 | 0 0 0.25 0 -0 0 146 | 147 | 148 | 1 0.15 0.5 149 | 150 | 151 | 152 | 156 | 1 1 1 1 157 | 158 | 159 | -0.5 1.5 0 0 -0 0 160 | 161 | 162 | 163 | 164 | 165 | 1 0.15 0.5 166 | 167 | 168 | 0 0 0.25 0 -0 0 169 | 170 | 171 | 0 0 0.25 0 -0 0 172 | 173 | 174 | 1 0.15 0.5 175 | 176 | 177 | 178 | 182 | 1 1 1 1 183 | 184 | 185 | -1.2 0.092 0 0 0 -1.5708 186 | 187 | 1 188 | 189 | 190 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/models/turtlebot3_dqn_world/model.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | turtlebot3_dqn 4 | 1.0 5 | model.sdf 6 | 7 | 8 | Ryan Shim 9 | jhshim@robotis.com 10 | 11 | 12 | 13 | TurtleBot3 DQN World 14 | 15 | 16 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/models/turtlebot3_dqn_world/model.sdf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0 0 0 0 0 0 5 | 6 | 7 | 8 | 9 | 5 0.15 0.5 10 | 11 | 12 | 0 0 0.25 0 -0 0 13 | 14 | 15 | 0 0 0.25 0 -0 0 16 | 17 | 18 | 5 0.15 0.5 19 | 20 | 21 | 22 | 26 | 1 1 1 1 27 | 28 | 29 | -2.425 0 0 0 -0 1.5708 30 | 31 | 32 | 33 | 34 | 35 | 5 0.15 0.5 36 | 37 | 38 | 0 0 0.25 0 -0 0 39 | 40 | 41 | 0 0 0.25 0 -0 0 42 | 43 | 44 | 5 0.15 0.5 45 | 46 | 47 | 48 | 52 | 1 1 1 1 53 | 54 | 55 | 0 2.425 0 0 -0 0 56 | 57 | 58 | 59 | 60 | 61 | 5 0.15 0.5 62 | 63 | 64 | 0 0 0.25 0 -0 0 65 | 66 | 67 | 0 0 0.25 0 -0 0 68 | 69 | 70 | 5 0.15 0.5 71 | 72 | 73 | 74 | 78 | 1 1 1 1 79 | 80 | 81 | 2.425 0 0 0 0 -1.5708 82 | 83 | 84 | 85 | 86 | 87 | 5 0.15 0.5 88 | 89 | 90 | 0 0 0.25 0 -0 0 91 | 92 | 93 | 0 0 0.25 0 -0 0 94 | 95 | 96 | 5 0.15 0.5 97 | 98 | 99 | 100 | 104 | 1 1 1 1 105 | 106 | 107 | 0 -2.425 0 0 -0 3.14159 108 | 109 | 1 110 | 111 | 112 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/models/turtlebot3_dqn_world/obstacle1/model.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | obstacle1 4 | 1.0 5 | model.sdf 6 | 7 | 8 | Ryan Shim 9 | jhshim@robotis.com 10 | 11 | 12 | 13 | TurtleBot3 DQN World 14 | 15 | 16 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/models/turtlebot3_dqn_world/obstacle1/model.sdf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 0.12 9 | 0.25 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 0.12 18 | 0.25 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/models/turtlebot3_dqn_world/obstacle2/model.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | obstacle2 4 | 1.0 5 | model.sdf 6 | 7 | 8 | Ryan Shim 9 | jhshim@robotis.com 10 | 11 | 12 | 13 | TurtleBot3 DQN World 14 | 15 | 16 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/models/turtlebot3_dqn_world/obstacle2/model.sdf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 0.12 9 | 0.25 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 0.12 18 | 0.25 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/models/turtlebot3_dqn_world/obstacle_plugin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # CMake 3 | ################################################################################ 4 | cmake_minimum_required(VERSION 2.8 FATAL_ERROR) 5 | 6 | ################################################################################ 7 | # Packages 8 | ################################################################################ 9 | find_package(gazebo REQUIRED) 10 | 11 | ################################################################################ 12 | # Build 13 | ################################################################################ 14 | link_directories(${GAZEBO_LIBRARY_DIRS}) 15 | 16 | include_directories(${GAZEBO_INCLUDE_DIRS}) 17 | 18 | list(APPEND CMAKE_CXX_FLAGS "${GAZEBO_CXX_FLAGS}") 19 | 20 | add_library(obstacle1 SHARED obstacle1.cc) 21 | target_link_libraries(obstacle1 ${GAZEBO_LIBRARIES}) 22 | 23 | add_library(obstacle2 SHARED obstacle2.cc) 24 | target_link_libraries(obstacle2 ${GAZEBO_LIBRARIES}) 25 | 26 | add_library(obstacles SHARED obstacles.cc) 27 | target_link_libraries(obstacles ${GAZEBO_LIBRARIES}) 28 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/models/turtlebot3_dqn_world/obstacle_plugin/obstacle1.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Open Source Robotics Foundation 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // 15 | // Author: Ryan Shim 16 | 17 | #include 18 | #include 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | 25 | namespace gazebo 26 | { 27 | class Obstacle1: public ModelPlugin 28 | { 29 | public: 30 | void Load(physics::ModelPtr _parent, sdf::ElementPtr /*_sdf*/) 31 | { 32 | // Store the pointer to the model 33 | this->model = _parent; 34 | 35 | // create the animation 36 | gazebo::common::PoseAnimationPtr anim( 37 | // name the animation "move_1", 38 | // make it last 260 seconds, 39 | // and set it on a repeat loop 40 | new gazebo::common::PoseAnimation("move1", 160.0, true)); 41 | 42 | gazebo::common::PoseKeyFrame * key; 43 | 44 | // set starting location of the box 45 | key = anim->CreateKeyFrame(0); 46 | key->Translation(ignition::math::Vector3d(0.0, 0.0, 0.0)); 47 | key->Rotation(ignition::math::Quaterniond(0, 0, 0)); 48 | 49 | key = anim->CreateKeyFrame(10); 50 | key->Translation(ignition::math::Vector3d(-0.5, -1.0, 0.0)); 51 | key->Rotation(ignition::math::Quaterniond(0, 0, 0)); 52 | 53 | key = anim->CreateKeyFrame(50); 54 | key->Translation(ignition::math::Vector3d(-3.5, -1.0, 0.0)); 55 | key->Rotation(ignition::math::Quaterniond(0, 0, 0)); 56 | 57 | key = anim->CreateKeyFrame(70); 58 | key->Translation(ignition::math::Vector3d(-3.7, -3.0, 0.0)); 59 | key->Rotation(ignition::math::Quaterniond(0, 0, 0)); 60 | 61 | key = anim->CreateKeyFrame(90); 62 | key->Translation(ignition::math::Vector3d(-3.5, -1.0, 0.0)); 63 | key->Rotation(ignition::math::Quaterniond(0, 0, 0)); 64 | 65 | key = anim->CreateKeyFrame(130); 66 | key->Translation(ignition::math::Vector3d(-0.5, -1.0, 0.0)); 67 | key->Rotation(ignition::math::Quaterniond(0, 0, 0)); 68 | 69 | key = anim->CreateKeyFrame(140); 70 | key->Translation(ignition::math::Vector3d(0.0, 0.0, 0.0)); 71 | key->Rotation(ignition::math::Quaterniond(0, 0, 0)); 72 | 73 | key = anim->CreateKeyFrame(160); 74 | key->Translation(ignition::math::Vector3d(0.0, 0.0, 0.0)); 75 | key->Rotation(ignition::math::Quaterniond(0, 0, 0)); 76 | 77 | // set the animation 78 | _parent->SetAnimation(anim); 79 | } 80 | 81 | // Pointer to the model 82 | 83 | private: 84 | physics::ModelPtr model; 85 | 86 | // Pointer to the update event connection 87 | 88 | private: 89 | event::ConnectionPtr updateConnection; 90 | }; 91 | // Register this plugin with the simulator 92 | GZ_REGISTER_MODEL_PLUGIN(Obstacle1) 93 | } // namespace gazebo 94 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/models/turtlebot3_dqn_world/obstacle_plugin/obstacle2.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Open Source Robotics Foundation 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // 15 | // Author: Ryan Shim 16 | 17 | #include 18 | #include 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | 25 | namespace gazebo 26 | { 27 | class Obstacle2: public ModelPlugin 28 | { 29 | public: 30 | void Load(physics::ModelPtr _parent, sdf::ElementPtr /*_sdf*/) 31 | { 32 | // Store the pointer to the model 33 | this->model = _parent; 34 | 35 | // create the animation 36 | gazebo::common::PoseAnimationPtr anim( 37 | // name the animation "move_2", 38 | // make it last 260 seconds, 39 | // and set it on a repeat loop 40 | new gazebo::common::PoseAnimation("move2", 140.0, true)); 41 | 42 | gazebo::common::PoseKeyFrame * key; 43 | 44 | // set starting location of the box 45 | key = anim->CreateKeyFrame(0); 46 | key->Translation(ignition::math::Vector3d(0.0, 0.0, 0.0)); 47 | key->Rotation(ignition::math::Quaterniond(0, 0, 0)); 48 | 49 | key = anim->CreateKeyFrame(10); 50 | key->Translation(ignition::math::Vector3d(0.7, 0.2, 0.0)); 51 | key->Rotation(ignition::math::Quaterniond(0, 0, 0)); 52 | 53 | key = anim->CreateKeyFrame(40); 54 | key->Translation(ignition::math::Vector3d(2.5, 3.5, 0.0)); 55 | key->Rotation(ignition::math::Quaterniond(0, 0, 0)); 56 | 57 | key = anim->CreateKeyFrame(55); 58 | key->Translation(ignition::math::Vector3d(0.3, 3.5, 0.0)); 59 | key->Rotation(ignition::math::Quaterniond(0, 0, 0)); 60 | 61 | key = anim->CreateKeyFrame(85); 62 | key->Translation(ignition::math::Vector3d(3.5, 1.8, 0.0)); 63 | key->Rotation(ignition::math::Quaterniond(0, 0, 0)); 64 | 65 | key = anim->CreateKeyFrame(100); 66 | key->Translation(ignition::math::Vector3d(3.5, 0.0, 0.0)); 67 | key->Rotation(ignition::math::Quaterniond(0, 0, 0)); 68 | 69 | key = anim->CreateKeyFrame(110); 70 | key->Translation(ignition::math::Vector3d(2.0, 0.5, 0.0)); 71 | key->Rotation(ignition::math::Quaterniond(0, 0, 0)); 72 | 73 | key = anim->CreateKeyFrame(115); 74 | key->Translation(ignition::math::Vector3d(1.5, 1.0, 0.0)); 75 | key->Rotation(ignition::math::Quaterniond(0, 0, 0)); 76 | 77 | key = anim->CreateKeyFrame(120); 78 | key->Translation(ignition::math::Vector3d(1.0, 0.5, 0.0)); 79 | key->Rotation(ignition::math::Quaterniond(0, 0, 0)); 80 | 81 | key = anim->CreateKeyFrame(125); 82 | key->Translation(ignition::math::Vector3d(0.5, 0.1, 0.0)); 83 | key->Rotation(ignition::math::Quaterniond(0, 0, 0)); 84 | 85 | key = anim->CreateKeyFrame(130); 86 | key->Translation(ignition::math::Vector3d(0.0, 0.0, 0.0)); 87 | key->Rotation(ignition::math::Quaterniond(0, 0, 0)); 88 | 89 | key = anim->CreateKeyFrame(140); 90 | key->Translation(ignition::math::Vector3d(0.0, 0.0, 0.0)); 91 | key->Rotation(ignition::math::Quaterniond(0, 0, 0)); 92 | 93 | // set the animation 94 | _parent->SetAnimation(anim); 95 | } 96 | 97 | // Pointer to the model 98 | 99 | private: 100 | physics::ModelPtr model; 101 | 102 | // Pointer to the update event connection 103 | 104 | private: 105 | event::ConnectionPtr updateConnection; 106 | }; 107 | // Register this plugin with the simulator 108 | GZ_REGISTER_MODEL_PLUGIN(Obstacle2) 109 | } // namespace gazebo 110 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/models/turtlebot3_dqn_world/obstacle_plugin/obstacles.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Open Source Robotics Foundation 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // 15 | // Author: Ryan Shim 16 | 17 | #include 18 | #include 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #define PI 3.141592 25 | 26 | 27 | namespace gazebo 28 | { 29 | class Obstacles: public ModelPlugin 30 | { 31 | public: 32 | void Load(physics::ModelPtr _parent, sdf::ElementPtr /*_sdf*/) 33 | { 34 | // Store the pointer to the model 35 | this->model = _parent; 36 | 37 | // create the animation 38 | gazebo::common::PoseAnimationPtr anim( 39 | // name the animation "move", 40 | // make it last 40 seconds, 41 | // and set it on a repeat loop 42 | new gazebo::common::PoseAnimation("move", 40.0, true)); 43 | 44 | gazebo::common::PoseKeyFrame * key; 45 | 46 | // set starting location of the box 47 | key = anim->CreateKeyFrame(0); 48 | key->Translation(ignition::math::Vector3d(0.0, 0.0, 0.0)); 49 | key->Rotation(ignition::math::Quaterniond(0, 0, 0)); 50 | 51 | key = anim->CreateKeyFrame(20); 52 | key->Translation(ignition::math::Vector3d(0.0, 0.0, 0.0)); 53 | key->Rotation(ignition::math::Quaterniond(0, 0, PI)); 54 | 55 | key = anim->CreateKeyFrame(40); 56 | key->Translation(ignition::math::Vector3d(0.0, 0.0, 0.0)); 57 | key->Rotation(ignition::math::Quaterniond(0, 0, 2 * PI)); 58 | 59 | // set the animation 60 | _parent->SetAnimation(anim); 61 | } 62 | 63 | // Pointer to the model 64 | 65 | private: 66 | physics::ModelPtr model; 67 | 68 | // Pointer to the update event connection 69 | 70 | private: 71 | event::ConnectionPtr updateConnection; 72 | }; 73 | // Register this plugin with the simulator 74 | GZ_REGISTER_MODEL_PLUGIN(Obstacles) 75 | } // namespace gazebo 76 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/models/turtlebot3_dqn_world/obstacles/model.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | obstacles 4 | 1.0 5 | model.sdf 6 | 7 | 8 | Ryan Shim 9 | jhshim@robotis.com 10 | 11 | 12 | 13 | TurtleBot3 DQN World 14 | 15 | 16 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/models/turtlebot3_dqn_world/obstacles/model.sdf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0 0 0 0 0 0 5 | 6 | 7 | -1.0 -1.0 0.25 0 0 0 8 | 9 | 10 | 0.15 11 | 0.5 12 | 13 | 14 | 10 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -1.0 -1.0 0.25 0 0 0 28 | 29 | 30 | 0.15 31 | 0.5 32 | 33 | 34 | 35 | 39 | 40 | 41 | 42 | 43 | -1.0 1.0 0.25 0 0 0 44 | 45 | 46 | 0.15 47 | 0.5 48 | 49 | 50 | 10 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -1.0 1.0 0.25 0 0 0 64 | 65 | 66 | 0.15 67 | 0.5 68 | 69 | 70 | 71 | 75 | 76 | 77 | 78 | 79 | 1.0 -1.0 0.25 0 0 0 80 | 81 | 82 | 0.15 83 | 0.5 84 | 85 | 86 | 10 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 1.0 -1.0 0.25 0 0 0 100 | 101 | 102 | 0.15 103 | 0.5 104 | 105 | 106 | 107 | 111 | 112 | 113 | 114 | 115 | 1.0 1.0 0.25 0 0 0 116 | 117 | 118 | 0.15 119 | 0.5 120 | 121 | 122 | 10 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 1.0 1.0 0.25 0 0 0 136 | 137 | 138 | 0.15 139 | 0.5 140 | 141 | 142 | 143 | 147 | 148 | 149 | 150 | 1 151 | 152 | 153 | 154 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/models/turtlebot3_house/model.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Turtlebot3 House 5 | 1.0 6 | model.sdf 7 | 8 | 9 | Taehun Lim(Darby) 10 | thlim@robotis.com 11 | 12 | 13 | 14 | Turtlebot3 House 15 | 16 | 17 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/models/turtlebot3_waffle/model.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | TurtleBot3(Waffle) 5 | 2.0 6 | model-1_4.sdf 7 | model.sdf 8 | 9 | 10 | Taehun Lim(Darby) 11 | thlim@robotis.com 12 | 13 | 14 | 15 | TurtleBot3 Waffle 16 | 17 | 18 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/models/turtlebot3_waffle_pi/model.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | TurtleBot3(Waffle Pi) 5 | 2.0 6 | model-1_4.sdf 7 | model.sdf 8 | 9 | 10 | Taehun Lim(Darby) 11 | thlim@robotis.com 12 | 13 | 14 | 15 | TurtleBot3 Waffle Pi 16 | 17 | 18 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/models/turtlebot3_world/meshes/hexagon.dae: -------------------------------------------------------------------------------- 1 | 2 | 3 | 2017-03-30T01:06:40 4 | 2017-03-30T01:06:40 5 | 6 | Y_UP 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -28.8675 50 100 -57.735 9.66338e-13 0 -57.735 1.13687e-12 100 -28.8675 50 0 -57.735 1.13687e-12 100 -28.8675 -50 0 -28.8675 -50 100 -57.735 9.66338e-13 0 -28.8675 -50 100 28.8675 -50 0 28.8675 -50 100 -28.8675 -50 0 28.8675 -50 100 57.735 1.7053e-12 0 57.735 1.36424e-12 100 28.8675 -50 0 57.735 1.36424e-12 100 28.8675 50 2.498e-13 28.8675 50 100 57.735 1.7053e-12 0 28.8675 50 100 -28.8675 50 0 -28.8675 50 100 28.8675 50 2.498e-13 -57.735 1.13687e-12 100 57.735 1.36424e-12 100 -28.8675 50 100 -28.8675 -50 100 28.8675 -50 100 28.8675 50 100 -57.735 9.66338e-13 0 28.8675 -50 0 -28.8675 -50 0 57.735 1.7053e-12 0 -28.8675 50 0 28.8675 50 2.498e-13 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -0.866025 0.5 0 -0.866025 0.5 0 -0.866025 0.5 0 -0.866025 0.5 0 -0.866025 -0.5 0 -0.866025 -0.5 0 -0.866025 -0.5 0 -0.866025 -0.5 0 5.51091e-16 -1 0 5.51091e-16 -1 0 5.51091e-16 -1 0 5.51091e-16 -1 0 0.866025 -0.5 0 0.866025 -0.5 0 0.866025 -0.5 0 0.866025 -0.5 0 0.866025 0.5 0 0.866025 0.5 0 0.866025 0.5 0 0.866025 0.5 0 -4.28626e-16 1 0 -4.28626e-16 1 0 -4.28626e-16 1 0 -4.28626e-16 1 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 -0 -0 -1 -0 -0 -1 -0 -0 -1 -0 -0 -1 -0 -0 -1 -0 -0 -1 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 |

0 1 2 1 0 3 4 5 6 5 4 7 8 9 10 9 8 11 12 13 14 13 12 15 16 17 18 17 16 19 20 21 22 21 20 23 24 25 26 24 27 28 28 25 24 26 25 29 30 31 32 31 30 33 33 34 35 33 30 34

51 |
52 |
53 |
54 |
55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 0.392157 0.976471 0.121569 1 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 |
77 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/models/turtlebot3_world/meshes/wall.dae: -------------------------------------------------------------------------------- 1 | 2 | 3 | 2017-03-30T02:35:53 4 | 2017-03-30T02:35:53 5 | 6 | Y_UP 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -400 230.94 0 -400 230.94 200 4.54747e-13 461.88 200 6.25278e-13 461.88 0 6.25278e-13 461.88 0 4.54747e-13 461.88 200 400 230.94 200 400 230.94 0 400 230.94 0 400 230.94 200 400 -230.94 200 400 -230.94 0 400 -230.94 0 400 -230.94 200 -1.7053e-13 -461.88 200 2.27374e-13 -461.88 0 2.27374e-13 -461.88 0 -1.7053e-13 -461.88 200 -400 -230.94 200 -400 -230.94 0 450 259.808 200 -3.69482e-13 519.615 200 -2.27374e-13 519.615 0 450 259.808 0 -3.69482e-13 519.615 200 -450 259.808 200 -450 259.808 0 -2.27374e-13 519.615 0 -450 259.808 200 -450 -259.808 200 -450 -259.808 0 -450 259.808 0 -450 -259.808 200 -1.13687e-13 -519.615 200 -2.27374e-13 -519.615 0 -450 -259.808 0 -1.13687e-13 -519.615 200 450 -259.808 200 450 -259.808 0 -2.27374e-13 -519.615 0 450 -259.808 0 450 259.808 200 450 259.808 0 450 -259.808 200 -400 -230.94 0 -400 -230.94 200 -400 230.94 200 -400 230.94 0 -1.7053e-13 -461.88 200 -1.13687e-13 -519.615 200 -400 -230.94 200 -450 -259.808 200 -450 259.808 200 450 -259.808 200 400 -230.94 200 400 230.94 200 4.54747e-13 461.88 200 -3.69482e-13 519.615 200 -400 230.94 200 450 259.808 200 -2.27374e-13 -519.615 0 400 -230.94 0 2.27374e-13 -461.88 0 400 230.94 0 -2.27374e-13 519.615 0 6.25278e-13 461.88 0 450 -259.808 0 450 259.808 0 -400 230.94 0 -450 259.808 0 -400 -230.94 0 -450 -259.808 0 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 0.5 -0.866025 0 0.5 -0.866025 0 0.5 -0.866025 0 0.5 -0.866025 0 -0.5 -0.866025 -0 -0.5 -0.866025 -0 -0.5 -0.866025 -0 -0.5 -0.866025 -0 -1 -6.12323e-17 -0 -1 -6.12323e-17 -0 -1 -6.12323e-17 -0 -1 -6.12323e-17 -0 -0.5 0.866025 0 -0.5 0.866025 0 -0.5 0.866025 0 -0.5 0.866025 0 0.5 0.866025 0 0.5 0.866025 0 0.5 0.866025 0 0.5 0.866025 0 0.5 0.866025 0 0.5 0.866025 0 0.5 0.866025 0 0.5 0.866025 0 -0.5 0.866025 0 -0.5 0.866025 0 -0.5 0.866025 0 -0.5 0.866025 0 -1 -5.21642e-16 0 -1 -5.21642e-16 0 -1 -5.21642e-16 0 -1 -5.21642e-16 0 -0.5 -0.866025 0 -0.5 -0.866025 0 -0.5 -0.866025 0 -0.5 -0.866025 0 0.5 -0.866025 0 0.5 -0.866025 0 0.5 -0.866025 0 0.5 -0.866025 0 1 0 0 1 0 0 1 0 0 1 0 0 1 1.83697e-16 0 1 1.83697e-16 0 1 1.83697e-16 0 1 1.83697e-16 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 -0 -0 -1 -0 -0 -1 -0 -0 -1 -0 -0 -1 -0 -0 -1 -0 -0 -1 -0 -0 -1 -0 -0 -1 -0 -0 -1 -0 -0 -1 -0 -0 -1 -0 -0 -1 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 |

0 2 1 0 3 2 4 6 5 4 7 6 8 10 9 8 11 10 12 14 13 12 15 14 16 18 17 16 19 18 20 22 21 22 20 23 24 26 25 26 24 27 28 30 29 30 28 31 32 34 33 34 32 35 36 38 37 38 36 39 40 42 41 40 41 43 44 46 45 44 47 46 48 50 49 50 52 51 53 54 49 55 57 56 48 49 54 57 52 58 58 56 57 53 59 55 57 55 59 53 55 54 49 50 51 52 50 58 60 62 61 63 65 64 63 67 66 68 69 64 66 61 63 64 67 63 60 61 66 60 70 62 69 70 71 60 71 70 64 65 68 69 68 70

51 |
52 |
53 |
54 |
55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 0.603922 0.647059 0.686275 1 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 |
77 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/models/turtlebot3_world/model.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | TurtleBot3 World 5 | 1.0 6 | model-1_4.sdf 7 | model.sdf 8 | 9 | 10 | Taehun Lim(Darby) 11 | thlim@robotis.com 12 | 13 | 14 | 15 | World of TurtleBot3 with ROS symbol 16 | 17 | 18 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | turtlebot3_gazebo 5 | 2.2.6 6 | 7 | Gazebo simulation package for the TurtleBot3 8 | 9 | Will Son 10 | Apache 2.0 11 | http://turtlebot3.robotis.com 12 | https://github.com/ROBOTIS-GIT/turtlebot3_simulations 13 | https://github.com/ROBOTIS-GIT/turtlebot3_simulations/issues 14 | Darby Lim 15 | Pyo 16 | Ryan Shim 17 | ament_cmake 18 | gazebo_ros_pkgs 19 | geometry_msgs 20 | nav_msgs 21 | rclcpp 22 | sensor_msgs 23 | tf2 24 | 25 | ament_cmake 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/src/turtlebot3_drive.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2019 ROBOTIS CO., LTD. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // 15 | // Authors: Taehun Lim (Darby), Ryan Shim 16 | 17 | #include "turtlebot3_gazebo/turtlebot3_drive.hpp" 18 | 19 | #include 20 | 21 | using namespace std::chrono_literals; 22 | 23 | Turtlebot3Drive::Turtlebot3Drive() 24 | : Node("turtlebot3_drive_node") 25 | { 26 | /************************************************************ 27 | ** Initialise variables 28 | ************************************************************/ 29 | scan_data_[0] = 0.0; 30 | scan_data_[1] = 0.0; 31 | scan_data_[2] = 0.0; 32 | 33 | robot_pose_ = 0.0; 34 | prev_robot_pose_ = 0.0; 35 | 36 | /************************************************************ 37 | ** Initialise ROS publishers and subscribers 38 | ************************************************************/ 39 | auto qos = rclcpp::QoS(rclcpp::KeepLast(10)); 40 | 41 | // Initialise publishers 42 | cmd_vel_pub_ = this->create_publisher("cmd_vel", qos); 43 | 44 | // Initialise subscribers 45 | scan_sub_ = this->create_subscription( 46 | "scan", \ 47 | rclcpp::SensorDataQoS(), \ 48 | std::bind( 49 | &Turtlebot3Drive::scan_callback, \ 50 | this, \ 51 | std::placeholders::_1)); 52 | odom_sub_ = this->create_subscription( 53 | "odom", qos, std::bind(&Turtlebot3Drive::odom_callback, this, std::placeholders::_1)); 54 | 55 | /************************************************************ 56 | ** Initialise ROS timers 57 | ************************************************************/ 58 | update_timer_ = this->create_wall_timer(10ms, std::bind(&Turtlebot3Drive::update_callback, this)); 59 | 60 | RCLCPP_INFO(this->get_logger(), "Turtlebot3 simulation node has been initialised"); 61 | } 62 | 63 | Turtlebot3Drive::~Turtlebot3Drive() 64 | { 65 | RCLCPP_INFO(this->get_logger(), "Turtlebot3 simulation node has been terminated"); 66 | } 67 | 68 | /******************************************************************************** 69 | ** Callback functions for ROS subscribers 70 | ********************************************************************************/ 71 | void Turtlebot3Drive::odom_callback(const nav_msgs::msg::Odometry::SharedPtr msg) 72 | { 73 | tf2::Quaternion q( 74 | msg->pose.pose.orientation.x, 75 | msg->pose.pose.orientation.y, 76 | msg->pose.pose.orientation.z, 77 | msg->pose.pose.orientation.w); 78 | tf2::Matrix3x3 m(q); 79 | double roll, pitch, yaw; 80 | m.getRPY(roll, pitch, yaw); 81 | 82 | robot_pose_ = yaw; 83 | } 84 | 85 | void Turtlebot3Drive::scan_callback(const sensor_msgs::msg::LaserScan::SharedPtr msg) 86 | { 87 | uint16_t scan_angle[3] = {0, 30, 330}; 88 | 89 | for (int num = 0; num < 3; num++) { 90 | if (std::isinf(msg->ranges.at(scan_angle[num]))) { 91 | scan_data_[num] = msg->range_max; 92 | } else { 93 | scan_data_[num] = msg->ranges.at(scan_angle[num]); 94 | } 95 | } 96 | } 97 | 98 | void Turtlebot3Drive::update_cmd_vel(double linear, double angular) 99 | { 100 | geometry_msgs::msg::Twist cmd_vel; 101 | cmd_vel.linear.x = linear; 102 | cmd_vel.angular.z = angular; 103 | 104 | cmd_vel_pub_->publish(cmd_vel); 105 | } 106 | 107 | /******************************************************************************** 108 | ** Update functions 109 | ********************************************************************************/ 110 | void Turtlebot3Drive::update_callback() 111 | { 112 | static uint8_t turtlebot3_state_num = 0; 113 | double escape_range = 30.0 * DEG2RAD; 114 | double check_forward_dist = 0.7; 115 | double check_side_dist = 0.6; 116 | 117 | switch (turtlebot3_state_num) { 118 | case GET_TB3_DIRECTION: 119 | if (scan_data_[CENTER] > check_forward_dist) { 120 | if (scan_data_[LEFT] < check_side_dist) { 121 | prev_robot_pose_ = robot_pose_; 122 | turtlebot3_state_num = TB3_RIGHT_TURN; 123 | } else if (scan_data_[RIGHT] < check_side_dist) { 124 | prev_robot_pose_ = robot_pose_; 125 | turtlebot3_state_num = TB3_LEFT_TURN; 126 | } else { 127 | turtlebot3_state_num = TB3_DRIVE_FORWARD; 128 | } 129 | } 130 | 131 | if (scan_data_[CENTER] < check_forward_dist) { 132 | prev_robot_pose_ = robot_pose_; 133 | turtlebot3_state_num = TB3_RIGHT_TURN; 134 | } 135 | break; 136 | 137 | case TB3_DRIVE_FORWARD: 138 | update_cmd_vel(LINEAR_VELOCITY, 0.0); 139 | turtlebot3_state_num = GET_TB3_DIRECTION; 140 | break; 141 | 142 | case TB3_RIGHT_TURN: 143 | if (fabs(prev_robot_pose_ - robot_pose_) >= escape_range) { 144 | turtlebot3_state_num = GET_TB3_DIRECTION; 145 | } else { 146 | update_cmd_vel(0.0, -1 * ANGULAR_VELOCITY); 147 | } 148 | break; 149 | 150 | case TB3_LEFT_TURN: 151 | if (fabs(prev_robot_pose_ - robot_pose_) >= escape_range) { 152 | turtlebot3_state_num = GET_TB3_DIRECTION; 153 | } else { 154 | update_cmd_vel(0.0, ANGULAR_VELOCITY); 155 | } 156 | break; 157 | 158 | default: 159 | turtlebot3_state_num = GET_TB3_DIRECTION; 160 | break; 161 | } 162 | } 163 | 164 | /******************************************************************************* 165 | ** Main 166 | *******************************************************************************/ 167 | int main(int argc, char ** argv) 168 | { 169 | rclcpp::init(argc, argv); 170 | rclcpp::spin(std::make_shared()); 171 | rclcpp::shutdown(); 172 | 173 | return 0; 174 | } 175 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/urdf/common_properties.urdf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/urdf/turtlebot3_burger.urdf: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/urdf/turtlebot3_waffle_pi.urdf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/worlds/empty_world.world: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | model://ground_plane 7 | 8 | 9 | 10 | model://sun 11 | 12 | 13 | 14 | false 15 | 16 | 17 | 18 | 19 | 0.319654 -0.235002 9.29441 0 1.5138 0.009599 20 | orbit 21 | perspective 22 | 23 | 24 | 25 | 26 | 1000.0 27 | 0.001 28 | 1 29 | 30 | 31 | quick 32 | 150 33 | 0 34 | 1.400000 35 | 1 36 | 37 | 38 | 0.00001 39 | 0.2 40 | 2000.000000 41 | 0.01000 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/worlds/turtlebot3_dqn_stage1.world: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | model://ground_plane 7 | 8 | 9 | 10 | model://sun 11 | 12 | 13 | 14 | false 15 | 16 | 17 | 18 | 19 | 0.319654 -0.235002 9.29441 0 1.5138 0.009599 20 | orbit 21 | perspective 22 | 23 | 24 | 25 | 26 | 1000.0 27 | 0.001 28 | 1 29 | 30 | 31 | quick 32 | 150 33 | 0 34 | 1.400000 35 | 1 36 | 37 | 38 | 0.00001 39 | 0.2 40 | 2000.000000 41 | 0.01000 42 | 43 | 44 | 45 | 46 | 47 | 1 48 | 49 | model://turtlebot3_dqn_world 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/worlds/turtlebot3_dqn_stage2.world: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | model://ground_plane 7 | 8 | 9 | 10 | model://sun 11 | 12 | 13 | 14 | false 15 | 16 | 17 | 18 | 19 | 0.319654 -0.235002 9.29441 0 1.5138 0.009599 20 | orbit 21 | perspective 22 | 23 | 24 | 25 | 26 | 1000.0 27 | 0.001 28 | 1 29 | 30 | 31 | quick 32 | 150 33 | 0 34 | 1.400000 35 | 1 36 | 37 | 38 | 0.00001 39 | 0.2 40 | 2000.000000 41 | 0.01000 42 | 43 | 44 | 45 | 46 | 47 | 1 48 | 49 | model://turtlebot3_dqn_world 50 | 51 | 52 | 53 | 54 | model://turtlebot3_dqn_world/obstacles 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/worlds/turtlebot3_dqn_stage3.world: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | model://ground_plane 7 | 8 | 9 | 10 | model://sun 11 | 12 | 13 | 14 | false 15 | 16 | 17 | 18 | 19 | 0.319654 -0.235002 9.29441 0 1.5138 0.009599 20 | orbit 21 | perspective 22 | 23 | 24 | 25 | 26 | 1000.0 27 | 0.001 28 | 1 29 | 30 | 31 | quick 32 | 150 33 | 0 34 | 1.400000 35 | 1 36 | 37 | 38 | 0.00001 39 | 0.2 40 | 2000.000000 41 | 0.01000 42 | 43 | 44 | 45 | 46 | 47 | 1 48 | 49 | model://turtlebot3_dqn_world 50 | 51 | 52 | 53 | 54 | 55 | 1 56 | 57 | model://turtlebot3_dqn_world/obstacles 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/worlds/turtlebot3_dqn_stage4.world: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | model://ground_plane 7 | 8 | 9 | 10 | model://sun 11 | 12 | 13 | 14 | false 15 | 16 | 17 | 18 | 19 | 0.319654 -0.235002 9.29441 0 1.5138 0.009599 20 | orbit 21 | perspective 22 | 23 | 24 | 25 | 26 | 1000.0 27 | 0.001 28 | 1 29 | 30 | 31 | quick 32 | 150 33 | 0 34 | 1.400000 35 | 1 36 | 37 | 38 | 0.00001 39 | 0.2 40 | 2000.000000 41 | 0.01000 42 | 43 | 44 | 45 | 46 | 47 | 1 48 | 49 | model://turtlebot3_dqn_world 50 | 51 | 52 | 53 | 54 | 0 0 0 0 0 0 55 | model://turtlebot3_dqn_world/inner_walls 56 | 57 | 58 | 59 | 60 | 61 | 2 2 0 0 0 0 62 | model://turtlebot3_dqn_world/obstacle1 63 | 64 | 65 | 66 | 67 | 68 | 69 | -2 -2 0 0 0 0 70 | model://turtlebot3_dqn_world/obstacle2 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/worlds/turtlebot3_house.world: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | model://ground_plane 7 | 8 | 9 | 10 | model://sun 11 | 12 | 13 | 14 | false 15 | 16 | 17 | 18 | 19 | 0.319654 -0.235002 9.29441 0 1.5138 0.009599 20 | orbit 21 | perspective 22 | 23 | 24 | 25 | 26 | 1000.0 27 | 0.001 28 | 1 29 | 30 | 31 | quick 32 | 150 33 | 0 34 | 1.400000 35 | 1 36 | 37 | 38 | 0.00001 39 | 0.2 40 | 2000.000000 41 | 0.01000 42 | 43 | 44 | 45 | 46 | 47 | 1 48 | 49 | model://turtlebot3_house 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/worlds/turtlebot3_world.world: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | model://ground_plane 7 | 8 | 9 | 10 | model://sun 11 | 12 | 13 | 14 | false 15 | 16 | 17 | 18 | 19 | 0.319654 -0.235002 9.29441 0 1.5138 0.009599 20 | orbit 21 | perspective 22 | 23 | 24 | 25 | 26 | 1000.0 27 | 0.001 28 | 1 29 | 30 | 31 | quick 32 | 150 33 | 0 34 | 1.400000 35 | 1 36 | 37 | 38 | 0.00001 39 | 0.2 40 | 2000.000000 41 | 0.01000 42 | 43 | 44 | 45 | 46 | 47 | 1 48 | 49 | model://turtlebot3_world 50 | 51 | 52 | 53 | 54 | 55 | --------------------------------------------------------------------------------