├── turtlebot3_gazebo ├── models │ ├── turtlebot3_house │ │ ├── materials │ │ │ └── textures │ │ │ │ ├── wood.jpg │ │ │ │ └── bricks.png │ │ └── model.config │ ├── turtlebot3_dqn_world │ │ ├── goal_box │ │ │ ├── model.config │ │ │ └── model.sdf │ │ ├── model.config │ │ ├── obstacle1 │ │ │ ├── model.config │ │ │ └── model.sdf │ │ ├── obstacle2 │ │ │ ├── model.config │ │ │ └── model.sdf │ │ ├── obstacles │ │ │ ├── model.config │ │ │ └── model.sdf │ │ ├── inner_walls │ │ │ ├── model.config │ │ │ └── model.sdf │ │ ├── obstacle_plugin │ │ │ ├── ObstacleAnimator.hh │ │ │ ├── obstacles.cc │ │ │ ├── obstacle1.cc │ │ │ └── obstacle2.cc │ │ └── model.sdf │ ├── turtlebot3_common │ │ ├── model.config │ │ └── meshes │ │ │ └── waffle_base.dae │ ├── turtlebot3_burger │ │ └── model.config │ ├── turtlebot3_waffle │ │ └── model.config │ ├── turtlebot3_world │ │ ├── model.config │ │ └── meshes │ │ │ ├── hexagon.dae │ │ │ └── wall.dae │ └── turtlebot3_waffle_pi │ │ └── model.config ├── urdf │ ├── common_properties.urdf │ ├── turtlebot3_burger.urdf │ ├── turtlebot3_waffle_pi.urdf │ └── turtlebot3_waffle.urdf ├── package.xml ├── worlds │ ├── turtlebot3_dqn_stage1.world │ ├── turtlebot3_dqn_stage2.world │ ├── turtlebot3_dqn_stage3.world │ ├── empty_world.world │ ├── turtlebot3_house.world │ ├── turtlebot3_dqn_stage4.world │ └── turtlebot3_world.world ├── params │ └── turtlebot3_waffle_bridge.yaml ├── launch │ ├── robot_state_publisher.launch.py │ ├── turtlebot3_dqn_stage1.launch.py │ ├── turtlebot3_dqn_stage2.launch.py │ ├── turtlebot3_dqn_stage3.launch.py │ ├── turtlebot3_dqn_stage4.launch.py │ ├── turtlebot3_house.launch.py │ ├── turtlebot3_world.launch.py │ ├── spawn_turtlebot3.launch.py │ └── empty_world.launch.py ├── include │ └── turtlebot3_gazebo │ │ └── turtlebot3_drive.hpp ├── CMakeLists.txt ├── CHANGELOG.rst ├── src │ └── turtlebot3_drive.cpp └── rviz │ └── tb3_gazebo.rviz ├── turtlebot3_simulations ├── CMakeLists.txt ├── package.xml └── CHANGELOG.rst ├── turtlebot3_fake_node ├── param │ ├── burger.yaml │ ├── waffle.yaml │ └── waffle_pi.yaml ├── launch │ ├── rviz2.launch.py │ └── turtlebot3_fake_node.launch.py ├── package.xml ├── CMakeLists.txt ├── include │ └── turtlebot3_fake_node │ │ └── turtlebot3_fake_node.hpp ├── CHANGELOG.rst └── src │ └── turtlebot3_fake_node.cpp ├── turtlebot3_simulations_ci.repos ├── CONTRIBUTING.md ├── .github └── workflows │ └── ros-ci.yml ├── README.md └── LICENSE /turtlebot3_gazebo/models/turtlebot3_house/materials/textures/wood.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azeey/turtlebot3_simulations/HEAD/turtlebot3_gazebo/models/turtlebot3_house/materials/textures/wood.jpg -------------------------------------------------------------------------------- /turtlebot3_gazebo/models/turtlebot3_house/materials/textures/bricks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azeey/turtlebot3_simulations/HEAD/turtlebot3_gazebo/models/turtlebot3_house/materials/textures/bricks.png -------------------------------------------------------------------------------- /turtlebot3_simulations/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | project(turtlebot3_simulations) 3 | 4 | if(NOT CMAKE_CXX_STANDARD) 5 | set(CMAKE_CXX_STANDARD 17) 6 | endif() 7 | 8 | find_package(ament_cmake REQUIRED) 9 | ament_package() 10 | -------------------------------------------------------------------------------- /turtlebot3_fake_node/param/burger.yaml: -------------------------------------------------------------------------------- 1 | turtlebot3_fake_node: 2 | ros__parameters: 3 | wheels: 4 | separation: 0.160 5 | radius: 0.033 6 | 7 | joint_states_frame: "base_footprint" 8 | odom_frame: "odom" 9 | base_frame: "base_footprint" 10 | -------------------------------------------------------------------------------- /turtlebot3_fake_node/param/waffle.yaml: -------------------------------------------------------------------------------- 1 | turtlebot3_fake_node: 2 | ros__parameters: 3 | wheels: 4 | separation: 0.287 5 | radius: 0.033 6 | 7 | joint_states_frame: "base_footprint" 8 | odom_frame: "odom" 9 | base_frame: "base_footprint" 10 | -------------------------------------------------------------------------------- /turtlebot3_fake_node/param/waffle_pi.yaml: -------------------------------------------------------------------------------- 1 | turtlebot3_fake_node: 2 | ros__parameters: 3 | wheels: 4 | separation: 0.287 5 | radius: 0.033 6 | 7 | joint_states_frame: "base_footprint" 8 | odom_frame: "odom" 9 | base_frame: "base_footprint" 10 | -------------------------------------------------------------------------------- /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_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_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_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/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/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/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/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_burger/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_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_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/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_simulations_ci.repos: -------------------------------------------------------------------------------- 1 | repositories: 2 | turtlebot3/turtlebot3: 3 | type: git 4 | url: https://github.com/ROBOTIS-GIT/turtlebot3.git 5 | version: ros2-devel 6 | turtlebot3/turtlebot3_msgs: 7 | type: git 8 | url: https://github.com/ROBOTIS-GIT/turtlebot3_msgs.git 9 | version: ros2-devel 10 | utils/DynamixelSDK: 11 | type: git 12 | url: https://github.com/ROBOTIS-GIT/DynamixelSDK.git 13 | version: ros2-devel 14 | utils/hls_lfcd_lds_driver: 15 | type: git 16 | url: https://github.com/ROBOTIS-GIT/hls_lfcd_lds_driver.git 17 | version: ros2-devel 18 | -------------------------------------------------------------------------------- /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/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/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 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Any contribution that you make to this repository will 2 | be under the Apache 2 License, as dictated by that 3 | [license](http://www.apache.org/licenses/LICENSE-2.0.html): 4 | 5 | ~~~ 6 | 5. Submission of Contributions. Unless You explicitly state otherwise, 7 | any Contribution intentionally submitted for inclusion in the Work 8 | by You to the Licensor shall be under the terms and conditions of 9 | this License, without any additional terms or conditions. 10 | Notwithstanding the above, nothing herein shall supersede or modify 11 | the terms of any separate license agreement you may have executed 12 | with Licensor regarding such Contributions. 13 | ~~~ 14 | 15 | Contributors must sign-off each commit by adding a `Signed-off-by: ...` 16 | line to commit messages to certify that they have the right to submit 17 | the code they are contributing to the project according to the 18 | [Developer Certificate of Origin (DCO)](https://developercertificate.org/). 19 | -------------------------------------------------------------------------------- /turtlebot3_simulations/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | turtlebot3_simulations 5 | 2.2.6 6 | 7 | ROS 2 packages for TurtleBot3 simulations 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 | turtlebot3_fake_node 19 | turtlebot3_gazebo 20 | 21 | ament_cmake 22 | 23 | 24 | -------------------------------------------------------------------------------- /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/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 | geometry_msgs 19 | nav_msgs 20 | rclcpp 21 | ros_gz_bridge 22 | ros_gz_image 23 | ros_gz_sim 24 | sensor_msgs 25 | tf2 26 | 27 | ament_cmake 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /turtlebot3_fake_node/launch/rviz2.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 | # Author: Ryan Shim 16 | 17 | import os 18 | 19 | from ament_index_python.packages import get_package_share_directory 20 | from launch import LaunchDescription 21 | from launch_ros.actions import Node 22 | 23 | 24 | def generate_launch_description(): 25 | rviz_config_dir = os.path.join( 26 | get_package_share_directory('turtlebot3_gazebo'), 27 | 'rviz', 28 | 'tb3_gazebo.rviz' 29 | ) 30 | 31 | return LaunchDescription([ 32 | Node( 33 | package='rviz2', 34 | executable='rviz2', 35 | name='rviz2', 36 | arguments=['-d', rviz_config_dir], 37 | output='screen'), 38 | ]) 39 | -------------------------------------------------------------------------------- /turtlebot3_fake_node/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | turtlebot3_fake_node 5 | 2.2.6 6 | 7 | Package for TurtleBot3 fake node. With this package, simple tests can be done without a robot. 8 | You can do simple tests using this package on rviz without real robots. 9 | 10 | Will Son 11 | Apache 2.0 12 | http://turtlebot3.robotis.com 13 | https://github.com/ROBOTIS-GIT/turtlebot3_simulations 14 | https://github.com/ROBOTIS-GIT/turtlebot3_simulations/issues 15 | Pyo 16 | Darby Lim 17 | Ryan Shim 18 | ament_cmake 19 | geometry_msgs 20 | nav_msgs 21 | rclcpp 22 | sensor_msgs 23 | tf2 24 | tf2_msgs 25 | turtlebot3_msgs 26 | robot_state_publisher 27 | 28 | ament_cmake 29 | 30 | 31 | -------------------------------------------------------------------------------- /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/params/turtlebot3_waffle_bridge.yaml: -------------------------------------------------------------------------------- 1 | - ros_topic_name: "clock" 2 | gz_topic_name: "clock" 3 | ros_type_name: "rosgraph_msgs/msg/Clock" 4 | gz_type_name: "gz.msgs.Clock" 5 | direction: GZ_TO_ROS 6 | 7 | # gz topic published by JointState plugin 8 | - ros_topic_name: "joint_states" 9 | gz_topic_name: "joint_states" 10 | ros_type_name: "sensor_msgs/msg/JointState" 11 | gz_type_name: "gz.msgs.Model" 12 | direction: GZ_TO_ROS 13 | 14 | # gz topic published by DiffDrive plugin 15 | - ros_topic_name: "odom" 16 | gz_topic_name: "odom" 17 | ros_type_name: "nav_msgs/msg/Odometry" 18 | gz_type_name: "gz.msgs.Odometry" 19 | direction: GZ_TO_ROS 20 | 21 | # gz topic published by DiffDrive plugin 22 | - ros_topic_name: "tf" 23 | gz_topic_name: "tf" 24 | ros_type_name: "tf2_msgs/msg/TFMessage" 25 | gz_type_name: "gz.msgs.Pose_V" 26 | direction: GZ_TO_ROS 27 | 28 | # gz topic subscribed to by DiffDrive plugin 29 | - ros_topic_name: "cmd_vel" 30 | gz_topic_name: "cmd_vel" 31 | ros_type_name: "geometry_msgs/msg/Twist" 32 | gz_type_name: "gz.msgs.Twist" 33 | direction: ROS_TO_GZ 34 | 35 | 36 | # gz topic published by IMU plugin 37 | - ros_topic_name: "imu" 38 | gz_topic_name: "imu" 39 | ros_type_name: "sensor_msgs/msg/Imu" 40 | gz_type_name: "gz.msgs.IMU" 41 | direction: GZ_TO_ROS 42 | 43 | # gz topic published by Sensors plugin (LIDAR) 44 | - ros_topic_name: "scan" 45 | gz_topic_name: "scan" 46 | ros_type_name: "sensor_msgs/msg/LaserScan" 47 | gz_type_name: "gz.msgs.LaserScan" 48 | direction: GZ_TO_ROS 49 | 50 | # gz topic published by Sensors plugin (Camera) 51 | - ros_topic_name: "camera/camera_info" 52 | gz_topic_name: "camera/camera_info" 53 | ros_type_name: "sensor_msgs/msg/CameraInfo" 54 | gz_type_name: "gz.msgs.CameraInfo" 55 | direction: GZ_TO_ROS 56 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /.github/workflows/ros-ci.yml: -------------------------------------------------------------------------------- 1 | name: humble-devel 2 | 3 | # Controls when the action will run. Triggers the workflow on push or pull request 4 | on: 5 | push: 6 | branches: [ humble-devel ] 7 | pull_request: 8 | branches: [ humble-devel ] 9 | 10 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 11 | jobs: 12 | humble-devel: 13 | runs-on: ubuntu-latest 14 | strategy: 15 | fail-fast: false 16 | matrix: 17 | ros_distribution: 18 | #- foxy 19 | # - galactic 20 | - humble 21 | # - rolling 22 | include: 23 | # Foxy Fitzroy (June 2020 - May 2023) 24 | # - docker_image: ubuntu:focal 25 | # ros_distribution: foxy 26 | # ros_version: 2 27 | # # Galactic Geochelone (May 2021) 28 | # - docker_image: ubuntu:focal 29 | # ros_distribution: galactic 30 | # ros_version: 2 31 | # Humble Hawksbill (May 2027) 32 | - docker_image: ubuntu:jammy 33 | ros_distribution: humble 34 | ros_version: 2 35 | # # Rolling 36 | # - docker_image: ubuntu:jammy 37 | # ros_distribution: rolling 38 | # ros_version: 2 39 | container: 40 | image: ${{ matrix.docker_image }} 41 | steps: 42 | - name: Setup directories 43 | run: mkdir -p ros_ws/src 44 | - name: checkout 45 | uses: actions/checkout@v3 46 | with: 47 | path: ros_ws/src 48 | - name: Setup ROS environment 49 | uses: ros-tooling/setup-ros@0.3.3 50 | with: 51 | required-ros-distributions: ${{ matrix.ros_distribution }} 52 | - name: Build and Test 53 | uses: ros-tooling/action-ros-ci@0.2.5 54 | with: 55 | package-name: turtlebot3_simulations 56 | target-ros2-distro: ${{ matrix.ros_distribution }} 57 | vcs-repo-file-url: "https://raw.githubusercontent.com/ROBOTIS-GIT/turtlebot3_simulations/ros2-devel/turtlebot3_simulations_ci.repos" 58 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/worlds/turtlebot3_dqn_stage3.world: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | https://fuel.gazebosim.org/1.0/OpenRobotics/models/Ground Plane 8 | 9 | 10 | 11 | 12 | 13 | https://fuel.gazebosim.org/1.0/OpenRobotics/models/Sun 14 | 15 | 16 | 17 | 18 | false 19 | 20 | 21 | 22 | 23 | 0.319654 -0.235002 9.29441 0 1.5138 0.009599 24 | orbit 25 | perspective 26 | 27 | 28 | 29 | 30 | 1000.0 31 | 0.001 32 | 1 33 | 34 | 35 | quick 36 | 150 37 | 0 38 | 1.400000 39 | 1 40 | 41 | 42 | 0.00001 43 | 0.2 44 | 2000.000000 45 | 0.01000 46 | 47 | 48 | 49 | 50 | 51 | 1 52 | 53 | model://turtlebot3_dqn_world 54 | 55 | 56 | 57 | 58 | 59 | 1 60 | 61 | model://turtlebot3_dqn_world/obstacles 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/models/turtlebot3_dqn_world/obstacle_plugin/ObstacleAnimator.hh: -------------------------------------------------------------------------------- 1 | // Copyright 2024 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 | #pragma once 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | class ObstacleAnimator : public gz::sim::System, 23 | public gz::sim::ISystemConfigure, 24 | public gz::sim::ISystemPreUpdate { 25 | public: 26 | ObstacleAnimator(gz::common::PoseAnimation _animator) 27 | : animator(std::move(_animator)) {} 28 | 29 | virtual void Configure(const gz::sim::Entity &_entity, 30 | const std::shared_ptr &, 31 | gz::sim::EntityComponentManager &, 32 | gz::sim::EventManager &) override { 33 | this->entity = _entity; 34 | } 35 | 36 | virtual void PreUpdate(const gz::sim::UpdateInfo &_info, 37 | gz::sim::EntityComponentManager &_ecm) override { 38 | if (_info.paused) 39 | return; 40 | 41 | this->animator.Time(std::chrono::duration(_info.simTime).count()); 42 | gz::common::PoseKeyFrame keyFrame(0); 43 | this->animator.InterpolatedKeyFrame(keyFrame); 44 | gz::math::Pose3d newPose(keyFrame.Translation(), keyFrame.Rotation()); 45 | _ecm.SetComponentData(this->entity, 46 | newPose); 47 | } 48 | 49 | private: 50 | gz::sim::Entity entity; 51 | gz::common::PoseAnimation animator; 52 | }; 53 | -------------------------------------------------------------------------------- /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/worlds/empty_world.world: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 11 | 12 | 15 | 16 | 19 | ogre2 20 | 21 | 24 | 25 | 26 | 27 | 28 | https://fuel.gazebosim.org/1.0/OpenRobotics/models/Ground Plane 29 | 30 | 31 | 32 | 33 | 34 | https://fuel.gazebosim.org/1.0/OpenRobotics/models/Sun 35 | 36 | 37 | 38 | 39 | false 40 | 41 | 42 | 43 | 44 | 0.319654 -0.235002 9.29441 0 1.5138 0.009599 45 | orbit 46 | perspective 47 | 48 | 49 | 50 | 51 | 1000.0 52 | 0.001 53 | 1 54 | 55 | 56 | quick 57 | 150 58 | 0 59 | 1.400000 60 | 1 61 | 62 | 63 | 0.00001 64 | 0.2 65 | 2000.000000 66 | 0.01000 67 | 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /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 "ObstacleAnimator.hh" 18 | 19 | #include 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | #define PI 3.141592 26 | 27 | namespace gazebo { 28 | class Obstacles : public ObstacleAnimator { 29 | public: 30 | Obstacles() : ObstacleAnimator(CreateAnimation()) {} 31 | 32 | // create the animation 33 | gz::common::PoseAnimation CreateAnimation() { 34 | 35 | // name the animation "move", 36 | // make it last 40 seconds, 37 | // and set it on a repeat loop 38 | gz::common::PoseAnimation anim = 39 | gz::common::PoseAnimation("move", 40.0, true); 40 | 41 | gz::common::PoseKeyFrame *key; 42 | 43 | // set starting location of the box 44 | key = anim.CreateKeyFrame(0); 45 | key->Translation(gz::math::Vector3d(0.0, 0.0, 0.0)); 46 | key->Rotation(gz::math::Quaterniond(0, 0, 0)); 47 | 48 | key = anim.CreateKeyFrame(20); 49 | key->Translation(gz::math::Vector3d(0.0, 0.0, 0.0)); 50 | key->Rotation(gz::math::Quaterniond(0, 0, PI)); 51 | 52 | key = anim.CreateKeyFrame(40); 53 | key->Translation(gz::math::Vector3d(0.0, 0.0, 0.0)); 54 | key->Rotation(gz::math::Quaterniond(0, 0, 2 * PI)); 55 | 56 | return anim; 57 | } 58 | }; 59 | // Register this plugin with the simulator 60 | GZ_ADD_PLUGIN(Obstacles, ::gz::sim::System, ::gz::sim::ISystemConfigure, 61 | ::gz::sim::ISystemPreUpdate) 62 | GZ_ADD_PLUGIN_ALIAS(Obstacles, "obstacles") 63 | } // namespace gazebo 64 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/worlds/turtlebot3_house.world: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 11 | 12 | 15 | 16 | 19 | ogre2 20 | 21 | 24 | 25 | 26 | 27 | 28 | https://fuel.gazebosim.org/1.0/OpenRobotics/models/Ground Plane 29 | 30 | 31 | 32 | 33 | 34 | https://fuel.gazebosim.org/1.0/OpenRobotics/models/Sun 35 | 36 | 37 | 38 | 39 | 40 | 0.319654 -0.235002 9.29441 0 1.5138 0.009599 41 | orbit 42 | perspective 43 | 44 | 45 | 46 | 47 | 1000.0 48 | 0.001 49 | 1 50 | 51 | 52 | quick 53 | 150 54 | 0 55 | 1.400000 56 | 1 57 | 58 | 59 | 0.00001 60 | 0.2 61 | 2000.000000 62 | 0.01000 63 | 64 | 65 | 66 | 67 | 68 | 1 69 | 70 | model://turtlebot3_house 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /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/worlds/turtlebot3_dqn_stage4.world: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | https://fuel.gazebosim.org/1.0/OpenRobotics/models/Ground Plane 8 | 9 | 10 | 11 | 12 | 13 | https://fuel.gazebosim.org/1.0/OpenRobotics/models/Sun 14 | 15 | 16 | 17 | 18 | false 19 | 20 | 21 | 22 | 23 | 0.319654 -0.235002 9.29441 0 1.5138 0.009599 24 | orbit 25 | perspective 26 | 27 | 28 | 29 | 30 | 1000.0 31 | 0.001 32 | 1 33 | 34 | 35 | quick 36 | 150 37 | 0 38 | 1.400000 39 | 1 40 | 41 | 42 | 0.00001 43 | 0.2 44 | 2000.000000 45 | 0.01000 46 | 47 | 48 | 49 | 50 | 51 | 1 52 | 53 | model://turtlebot3_dqn_world 54 | 55 | 56 | 57 | 58 | 0 0 0 0 0 0 59 | model://turtlebot3_dqn_world/inner_walls 60 | 61 | 62 | 63 | 64 | 65 | 2 2 0 0 0 0 66 | model://turtlebot3_dqn_world/obstacle1 67 | 68 | 69 | 70 | 71 | 72 | 73 | -2 -2 0 0 0 0 74 | model://turtlebot3_dqn_world/obstacle2 75 | 76 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /turtlebot3_fake_node/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_fake_node) 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 | ################################################################################ 16 | # Find and load build settings from external packages 17 | ################################################################################ 18 | find_package(ament_cmake REQUIRED) 19 | find_package(geometry_msgs REQUIRED) 20 | find_package(nav_msgs REQUIRED) 21 | find_package(rclcpp REQUIRED) 22 | find_package(sensor_msgs REQUIRED) 23 | find_package(tf2 REQUIRED) 24 | find_package(tf2_msgs REQUIRED) 25 | find_package(turtlebot3_msgs REQUIRED) 26 | 27 | ################################################################################ 28 | # Build 29 | ################################################################################ 30 | include_directories( 31 | include 32 | ) 33 | 34 | set(dependencies 35 | "geometry_msgs" 36 | "nav_msgs" 37 | "rclcpp" 38 | "sensor_msgs" 39 | "tf2" 40 | "tf2_msgs" 41 | "turtlebot3_msgs" 42 | ) 43 | 44 | set(EXEC_NAME "turtlebot3_fake_node") 45 | 46 | add_executable(${EXEC_NAME} src/turtlebot3_fake_node.cpp) 47 | ament_target_dependencies(${EXEC_NAME} ${dependencies}) 48 | 49 | ################################################################################ 50 | # Install 51 | ################################################################################ 52 | install(TARGETS ${EXEC_NAME} 53 | DESTINATION lib/${PROJECT_NAME} 54 | ) 55 | 56 | install(DIRECTORY launch param 57 | DESTINATION share/${PROJECT_NAME} 58 | ) 59 | 60 | install(DIRECTORY include/ 61 | DESTINATION include/ 62 | ) 63 | 64 | ################################################################################ 65 | # Macro for ament package 66 | ################################################################################ 67 | ament_export_include_directories(include) 68 | ament_export_dependencies(geometry_msgs) 69 | ament_export_dependencies(nav_msgs) 70 | ament_export_dependencies(rclcpp) 71 | ament_export_dependencies(sensor_msgs) 72 | ament_export_dependencies(tf2) 73 | ament_export_dependencies(tf2_msgs) 74 | ament_export_dependencies(turtlebot3_msgs) 75 | ament_package() 76 | -------------------------------------------------------------------------------- /turtlebot3_fake_node/include/turtlebot3_fake_node/turtlebot3_fake_node.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: Yoonseok Pyo, Ryan Shim 16 | 17 | #ifndef TURTLEBOT3_FAKE_NODE__TURTLEBOT3_FAKE_NODE_HPP_ 18 | #define TURTLEBOT3_FAKE_NODE__TURTLEBOT3_FAKE_NODE_HPP_ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #include "geometry_msgs/msg/transform_stamped.hpp" 25 | #include "geometry_msgs/msg/twist.hpp" 26 | #include "nav_msgs/msg/odometry.hpp" 27 | #include "sensor_msgs/msg/joint_state.hpp" 28 | #include "tf2_msgs/msg/tf_message.hpp" 29 | #include "turtlebot3_msgs/msg/sensor_state.hpp" 30 | 31 | #define LEFT 0 32 | #define RIGHT 1 33 | 34 | class Turtlebot3Fake : public rclcpp::Node 35 | { 36 | public: 37 | Turtlebot3Fake(); 38 | ~Turtlebot3Fake(); 39 | 40 | private: 41 | // ROS time 42 | rclcpp::Time last_cmd_vel_time_; 43 | rclcpp::Time prev_update_time_; 44 | 45 | // ROS timer 46 | rclcpp::TimerBase::SharedPtr update_timer_; 47 | 48 | // ROS topic publishers 49 | rclcpp::Publisher::SharedPtr odom_pub_; 50 | rclcpp::Publisher::SharedPtr joint_states_pub_; 51 | rclcpp::Publisher::SharedPtr tf_pub_; 52 | 53 | // ROS topic subscribers 54 | rclcpp::Subscription::SharedPtr cmd_vel_sub_; 55 | 56 | 57 | nav_msgs::msg::Odometry odom_; 58 | sensor_msgs::msg::JointState joint_states_; 59 | 60 | double wheel_speed_cmd_[2]; 61 | double goal_linear_velocity_; 62 | double goal_angular_velocity_; 63 | double cmd_vel_timeout_; 64 | double last_position_[2]; 65 | double last_velocity_[2]; 66 | float odom_pose_[3]; 67 | float odom_vel_[3]; 68 | 69 | double wheel_seperation_; 70 | double wheel_radius_; 71 | 72 | // Function prototypes 73 | void init_parameters(); 74 | void init_variables(); 75 | void command_velocity_callback(const geometry_msgs::msg::Twist::SharedPtr cmd_vel_msg); 76 | void update_callback(); 77 | bool update_odometry(const rclcpp::Duration & diff_time); 78 | void update_joint_state(); 79 | void update_tf(geometry_msgs::msg::TransformStamped & odom_tf); 80 | }; 81 | #endif // TURTLEBOT3_FAKE_NODE__TURTLEBOT3_FAKE_NODE_HPP_ 82 | -------------------------------------------------------------------------------- /turtlebot3_fake_node/launch/turtlebot3_fake_node.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 | # Author: Ryan Shim 16 | 17 | import os 18 | 19 | from ament_index_python.packages import get_package_share_directory 20 | from launch import LaunchDescription 21 | from launch.actions import DeclareLaunchArgument 22 | from launch.actions import IncludeLaunchDescription 23 | from launch.actions import LogInfo 24 | from launch.launch_description_sources import PythonLaunchDescriptionSource 25 | from launch.substitutions import LaunchConfiguration 26 | from launch_ros.actions import Node 27 | 28 | TURTLEBOT3_MODEL = os.environ['TURTLEBOT3_MODEL'] 29 | 30 | 31 | def generate_launch_description(): 32 | param_dir = LaunchConfiguration( 33 | 'param_dir', 34 | default=os.path.join( 35 | get_package_share_directory('turtlebot3_fake_node'), 36 | 'param', 37 | TURTLEBOT3_MODEL + '.yaml')) 38 | 39 | rviz_dir = LaunchConfiguration( 40 | 'rviz_dir', 41 | default=os.path.join( 42 | get_package_share_directory('turtlebot3_fake_node'), 'launch')) 43 | 44 | use_sim_time = LaunchConfiguration('use_sim_time', default='false') 45 | urdf_file_name = 'turtlebot3_' + TURTLEBOT3_MODEL + '.urdf' 46 | 47 | urdf = os.path.join( 48 | get_package_share_directory('turtlebot3_gazebo'), 49 | 'urdf', 50 | urdf_file_name) 51 | 52 | return LaunchDescription([ 53 | LogInfo(msg=['Execute Turtlebot3 Fake Node!!']), 54 | 55 | DeclareLaunchArgument( 56 | 'param_dir', 57 | default_value=param_dir, 58 | description='Specifying parameter direction'), 59 | 60 | IncludeLaunchDescription( 61 | PythonLaunchDescriptionSource([rviz_dir, '/rviz2.launch.py'])), 62 | 63 | Node( 64 | package='turtlebot3_fake_node', 65 | executable='turtlebot3_fake_node', 66 | parameters=[param_dir], 67 | output='screen'), 68 | 69 | Node( 70 | package='robot_state_publisher', 71 | executable='robot_state_publisher', 72 | name='robot_state_publisher', 73 | output='screen', 74 | parameters=[{'use_sim_time': use_sim_time}], 75 | arguments=[urdf]), 76 | ]) 77 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/launch/turtlebot3_dqn_stage1.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: Joep Tool 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 IncludeLaunchDescription 24 | from launch.launch_description_sources import PythonLaunchDescriptionSource 25 | from launch.substitutions import LaunchConfiguration 26 | 27 | 28 | def generate_launch_description(): 29 | launch_file_dir = os.path.join(get_package_share_directory('turtlebot3_gazebo'), 'launch') 30 | pkg_gazebo_ros = get_package_share_directory('gazebo_ros') 31 | 32 | use_sim_time = LaunchConfiguration('use_sim_time', default='true') 33 | x_pose = LaunchConfiguration('x_pose', default='0.0') 34 | y_pose = LaunchConfiguration('y_pose', default='0.0') 35 | 36 | world = os.path.join( 37 | get_package_share_directory('turtlebot3_gazebo'), 38 | 'worlds', 39 | 'turtlebot3_dqn_stage1.world' 40 | ) 41 | 42 | gzserver_cmd = IncludeLaunchDescription( 43 | PythonLaunchDescriptionSource( 44 | os.path.join(pkg_gazebo_ros, 'launch', 'gzserver.launch.py') 45 | ), 46 | launch_arguments={'world': world}.items() 47 | ) 48 | 49 | gzclient_cmd = IncludeLaunchDescription( 50 | PythonLaunchDescriptionSource( 51 | os.path.join(pkg_gazebo_ros, 'launch', 'gzclient.launch.py') 52 | ) 53 | ) 54 | 55 | robot_state_publisher_cmd = IncludeLaunchDescription( 56 | PythonLaunchDescriptionSource( 57 | os.path.join(launch_file_dir, 'robot_state_publisher.launch.py') 58 | ), 59 | launch_arguments={'use_sim_time': use_sim_time}.items() 60 | ) 61 | 62 | spawn_turtlebot_cmd = IncludeLaunchDescription( 63 | PythonLaunchDescriptionSource( 64 | os.path.join(launch_file_dir, 'spawn_turtlebot3.launch.py') 65 | ), 66 | launch_arguments={ 67 | 'x_pose': x_pose, 68 | 'y_pose': y_pose 69 | }.items() 70 | ) 71 | 72 | ld = LaunchDescription() 73 | 74 | # Add the commands to the launch description 75 | ld.add_action(gzserver_cmd) 76 | ld.add_action(gzclient_cmd) 77 | ld.add_action(robot_state_publisher_cmd) 78 | ld.add_action(spawn_turtlebot_cmd) 79 | 80 | return ld 81 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/launch/turtlebot3_dqn_stage2.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: Joep Tool 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 IncludeLaunchDescription 24 | from launch.launch_description_sources import PythonLaunchDescriptionSource 25 | from launch.substitutions import LaunchConfiguration 26 | 27 | 28 | def generate_launch_description(): 29 | launch_file_dir = os.path.join(get_package_share_directory('turtlebot3_gazebo'), 'launch') 30 | pkg_gazebo_ros = get_package_share_directory('gazebo_ros') 31 | 32 | use_sim_time = LaunchConfiguration('use_sim_time', default='true') 33 | x_pose = LaunchConfiguration('x_pose', default='0.0') 34 | y_pose = LaunchConfiguration('y_pose', default='0.0') 35 | 36 | world = os.path.join( 37 | get_package_share_directory('turtlebot3_gazebo'), 38 | 'worlds', 39 | 'turtlebot3_dqn_stage2.world' 40 | ) 41 | 42 | gzserver_cmd = IncludeLaunchDescription( 43 | PythonLaunchDescriptionSource( 44 | os.path.join(pkg_gazebo_ros, 'launch', 'gzserver.launch.py') 45 | ), 46 | launch_arguments={'world': world}.items() 47 | ) 48 | 49 | gzclient_cmd = IncludeLaunchDescription( 50 | PythonLaunchDescriptionSource( 51 | os.path.join(pkg_gazebo_ros, 'launch', 'gzclient.launch.py') 52 | ) 53 | ) 54 | 55 | robot_state_publisher_cmd = IncludeLaunchDescription( 56 | PythonLaunchDescriptionSource( 57 | os.path.join(launch_file_dir, 'robot_state_publisher.launch.py') 58 | ), 59 | launch_arguments={'use_sim_time': use_sim_time}.items() 60 | ) 61 | 62 | spawn_turtlebot_cmd = IncludeLaunchDescription( 63 | PythonLaunchDescriptionSource( 64 | os.path.join(launch_file_dir, 'spawn_turtlebot3.launch.py') 65 | ), 66 | launch_arguments={ 67 | 'x_pose': x_pose, 68 | 'y_pose': y_pose 69 | }.items() 70 | ) 71 | 72 | ld = LaunchDescription() 73 | 74 | # Add the commands to the launch description 75 | ld.add_action(gzserver_cmd) 76 | ld.add_action(gzclient_cmd) 77 | ld.add_action(robot_state_publisher_cmd) 78 | ld.add_action(spawn_turtlebot_cmd) 79 | 80 | return ld 81 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/launch/turtlebot3_dqn_stage3.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: Joep Tool 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 IncludeLaunchDescription 24 | from launch.launch_description_sources import PythonLaunchDescriptionSource 25 | from launch.substitutions import LaunchConfiguration 26 | 27 | 28 | def generate_launch_description(): 29 | launch_file_dir = os.path.join(get_package_share_directory('turtlebot3_gazebo'), 'launch') 30 | pkg_gazebo_ros = get_package_share_directory('gazebo_ros') 31 | 32 | use_sim_time = LaunchConfiguration('use_sim_time', default='true') 33 | x_pose = LaunchConfiguration('x_pose', default='0.0') 34 | y_pose = LaunchConfiguration('y_pose', default='0.0') 35 | 36 | world = os.path.join( 37 | get_package_share_directory('turtlebot3_gazebo'), 38 | 'worlds', 39 | 'turtlebot3_dqn_stage3.world' 40 | ) 41 | 42 | gzserver_cmd = IncludeLaunchDescription( 43 | PythonLaunchDescriptionSource( 44 | os.path.join(pkg_gazebo_ros, 'launch', 'gzserver.launch.py') 45 | ), 46 | launch_arguments={'world': world}.items() 47 | ) 48 | 49 | gzclient_cmd = IncludeLaunchDescription( 50 | PythonLaunchDescriptionSource( 51 | os.path.join(pkg_gazebo_ros, 'launch', 'gzclient.launch.py') 52 | ) 53 | ) 54 | 55 | robot_state_publisher_cmd = IncludeLaunchDescription( 56 | PythonLaunchDescriptionSource( 57 | os.path.join(launch_file_dir, 'robot_state_publisher.launch.py') 58 | ), 59 | launch_arguments={'use_sim_time': use_sim_time}.items() 60 | ) 61 | 62 | spawn_turtlebot_cmd = IncludeLaunchDescription( 63 | PythonLaunchDescriptionSource( 64 | os.path.join(launch_file_dir, 'spawn_turtlebot3.launch.py') 65 | ), 66 | launch_arguments={ 67 | 'x_pose': x_pose, 68 | 'y_pose': y_pose 69 | }.items() 70 | ) 71 | 72 | ld = LaunchDescription() 73 | 74 | # Add the commands to the launch description 75 | ld.add_action(gzserver_cmd) 76 | ld.add_action(gzclient_cmd) 77 | ld.add_action(robot_state_publisher_cmd) 78 | ld.add_action(spawn_turtlebot_cmd) 79 | 80 | return ld 81 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/launch/turtlebot3_dqn_stage4.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: Joep Tool 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 IncludeLaunchDescription 24 | from launch.launch_description_sources import PythonLaunchDescriptionSource 25 | from launch.substitutions import LaunchConfiguration 26 | 27 | 28 | def generate_launch_description(): 29 | launch_file_dir = os.path.join(get_package_share_directory('turtlebot3_gazebo'), 'launch') 30 | pkg_gazebo_ros = get_package_share_directory('gazebo_ros') 31 | 32 | use_sim_time = LaunchConfiguration('use_sim_time', default='true') 33 | x_pose = LaunchConfiguration('x_pose', default='0.0') 34 | y_pose = LaunchConfiguration('y_pose', default='0.0') 35 | 36 | world = os.path.join( 37 | get_package_share_directory('turtlebot3_gazebo'), 38 | 'worlds', 39 | 'turtlebot3_dqn_stage4.world' 40 | ) 41 | 42 | gzserver_cmd = IncludeLaunchDescription( 43 | PythonLaunchDescriptionSource( 44 | os.path.join(pkg_gazebo_ros, 'launch', 'gzserver.launch.py') 45 | ), 46 | launch_arguments={'world': world}.items() 47 | ) 48 | 49 | gzclient_cmd = IncludeLaunchDescription( 50 | PythonLaunchDescriptionSource( 51 | os.path.join(pkg_gazebo_ros, 'launch', 'gzclient.launch.py') 52 | ) 53 | ) 54 | 55 | robot_state_publisher_cmd = IncludeLaunchDescription( 56 | PythonLaunchDescriptionSource( 57 | os.path.join(launch_file_dir, 'robot_state_publisher.launch.py') 58 | ), 59 | launch_arguments={'use_sim_time': use_sim_time}.items() 60 | ) 61 | 62 | spawn_turtlebot_cmd = IncludeLaunchDescription( 63 | PythonLaunchDescriptionSource( 64 | os.path.join(launch_file_dir, 'spawn_turtlebot3.launch.py') 65 | ), 66 | launch_arguments={ 67 | 'x_pose': x_pose, 68 | 'y_pose': y_pose 69 | }.items() 70 | ) 71 | 72 | ld = LaunchDescription() 73 | 74 | # Add the commands to the launch description 75 | ld.add_action(gzserver_cmd) 76 | ld.add_action(gzclient_cmd) 77 | ld.add_action(robot_state_publisher_cmd) 78 | ld.add_action(spawn_turtlebot_cmd) 79 | 80 | return ld 81 | -------------------------------------------------------------------------------- /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 "ObstacleAnimator.hh" 18 | 19 | #include 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | namespace gazebo { 26 | class Obstacle1 : public ObstacleAnimator { 27 | public: 28 | Obstacle1() : ObstacleAnimator(CreateAnimation()) {} 29 | 30 | gz::common::PoseAnimation CreateAnimation() { 31 | // create the animation 32 | // name the animation "move_1", 33 | // make it last 260 seconds, 34 | // and set it on a repeat loop 35 | gz::common::PoseAnimation anim("move1", 160.0, true); 36 | 37 | gz::common::PoseKeyFrame *key; 38 | 39 | // set starting location of the box 40 | key = anim.CreateKeyFrame(0); 41 | key->Translation(gz::math::Vector3d(0.0, 0.0, 0.0)); 42 | key->Rotation(gz::math::Quaterniond(0, 0, 0)); 43 | 44 | key = anim.CreateKeyFrame(10); 45 | key->Translation(gz::math::Vector3d(-0.5, -1.0, 0.0)); 46 | key->Rotation(gz::math::Quaterniond(0, 0, 0)); 47 | 48 | key = anim.CreateKeyFrame(50); 49 | key->Translation(gz::math::Vector3d(-3.5, -1.0, 0.0)); 50 | key->Rotation(gz::math::Quaterniond(0, 0, 0)); 51 | 52 | key = anim.CreateKeyFrame(70); 53 | key->Translation(gz::math::Vector3d(-3.7, -3.0, 0.0)); 54 | key->Rotation(gz::math::Quaterniond(0, 0, 0)); 55 | 56 | key = anim.CreateKeyFrame(90); 57 | key->Translation(gz::math::Vector3d(-3.5, -1.0, 0.0)); 58 | key->Rotation(gz::math::Quaterniond(0, 0, 0)); 59 | 60 | key = anim.CreateKeyFrame(130); 61 | key->Translation(gz::math::Vector3d(-0.5, -1.0, 0.0)); 62 | key->Rotation(gz::math::Quaterniond(0, 0, 0)); 63 | 64 | key = anim.CreateKeyFrame(140); 65 | key->Translation(gz::math::Vector3d(0.0, 0.0, 0.0)); 66 | key->Rotation(gz::math::Quaterniond(0, 0, 0)); 67 | 68 | key = anim.CreateKeyFrame(160); 69 | key->Translation(gz::math::Vector3d(0.0, 0.0, 0.0)); 70 | key->Rotation(gz::math::Quaterniond(0, 0, 0)); 71 | 72 | return anim; 73 | } 74 | }; 75 | // Register this plugin with the simulator 76 | GZ_ADD_PLUGIN(Obstacle1, ::gz::sim::System, ::gz::sim::ISystemConfigure, 77 | ::gz::sim::ISystemPreUpdate) 78 | GZ_ADD_PLUGIN_ALIAS(Obstacle1, "obstacle1") 79 | } // namespace gazebo 80 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/launch/turtlebot3_house.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: Joep Tool 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 AppendEnvironmentVariable 24 | from launch.actions import IncludeLaunchDescription 25 | from launch.launch_description_sources import PythonLaunchDescriptionSource 26 | from launch.substitutions import LaunchConfiguration 27 | 28 | 29 | def generate_launch_description(): 30 | launch_file_dir = os.path.join(get_package_share_directory('turtlebot3_gazebo'), 'launch') 31 | ros_gz_sim = get_package_share_directory('ros_gz_sim') 32 | 33 | use_sim_time = LaunchConfiguration('use_sim_time', default='true') 34 | x_pose = LaunchConfiguration('x_pose', default='-2.0') 35 | y_pose = LaunchConfiguration('y_pose', default='-0.5') 36 | 37 | world = os.path.join( 38 | get_package_share_directory('turtlebot3_gazebo'), 39 | 'worlds', 40 | 'turtlebot3_house.world' 41 | ) 42 | set_env_vars_resources = AppendEnvironmentVariable( 43 | 'GZ_SIM_RESOURCE_PATH', 44 | os.path.join(get_package_share_directory('turtlebot3_gazebo'), 45 | 'models')) 46 | 47 | gzserver_cmd = IncludeLaunchDescription( 48 | PythonLaunchDescriptionSource( 49 | os.path.join(ros_gz_sim, 'launch', 'gz_sim.launch.py') 50 | ), 51 | launch_arguments={'gz_args': ['-r -s -v4 ', world]}.items() 52 | ) 53 | gzclient_cmd = IncludeLaunchDescription( 54 | PythonLaunchDescriptionSource( 55 | os.path.join(ros_gz_sim, 'launch', 'gz_sim.launch.py') 56 | ), 57 | launch_arguments={'gz_args': '-g -v4 '}.items() 58 | ) 59 | 60 | robot_state_publisher_cmd = IncludeLaunchDescription( 61 | PythonLaunchDescriptionSource( 62 | os.path.join(launch_file_dir, 'robot_state_publisher.launch.py') 63 | ), 64 | launch_arguments={'use_sim_time': use_sim_time}.items() 65 | ) 66 | 67 | spawn_turtlebot_cmd = IncludeLaunchDescription( 68 | PythonLaunchDescriptionSource( 69 | os.path.join(launch_file_dir, 'spawn_turtlebot3.launch.py') 70 | ), 71 | launch_arguments={ 72 | 'x_pose': x_pose, 73 | 'y_pose': y_pose 74 | }.items() 75 | ) 76 | 77 | ld = LaunchDescription() 78 | 79 | # Add the commands to the launch description 80 | ld.add_action(set_env_vars_resources) 81 | ld.add_action(gzserver_cmd) 82 | ld.add_action(gzclient_cmd) 83 | ld.add_action(robot_state_publisher_cmd) 84 | ld.add_action(spawn_turtlebot_cmd) 85 | 86 | return ld 87 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/launch/turtlebot3_world.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: Joep Tool 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 AppendEnvironmentVariable 24 | from launch.actions import IncludeLaunchDescription 25 | from launch.launch_description_sources import PythonLaunchDescriptionSource 26 | from launch.substitutions import LaunchConfiguration 27 | 28 | 29 | def generate_launch_description(): 30 | launch_file_dir = os.path.join(get_package_share_directory('turtlebot3_gazebo'), 'launch') 31 | ros_gz_sim = get_package_share_directory('ros_gz_sim') 32 | 33 | use_sim_time = LaunchConfiguration('use_sim_time', default='true') 34 | x_pose = LaunchConfiguration('x_pose', default='-2.0') 35 | y_pose = LaunchConfiguration('y_pose', default='-0.5') 36 | 37 | world = os.path.join( 38 | get_package_share_directory('turtlebot3_gazebo'), 39 | 'worlds', 40 | 'turtlebot3_world.world' 41 | ) 42 | set_env_vars_resources = AppendEnvironmentVariable( 43 | 'GZ_SIM_RESOURCE_PATH', 44 | os.path.join(get_package_share_directory('turtlebot3_gazebo'), 45 | 'models')) 46 | 47 | gzserver_cmd = IncludeLaunchDescription( 48 | PythonLaunchDescriptionSource( 49 | os.path.join(ros_gz_sim, 'launch', 'gz_sim.launch.py') 50 | ), 51 | launch_arguments={'gz_args': ['-r -s -v4 ', world]}.items() 52 | ) 53 | gzclient_cmd = IncludeLaunchDescription( 54 | PythonLaunchDescriptionSource( 55 | os.path.join(ros_gz_sim, 'launch', 'gz_sim.launch.py') 56 | ), 57 | launch_arguments={'gz_args': '-g -v4 '}.items() 58 | ) 59 | 60 | robot_state_publisher_cmd = IncludeLaunchDescription( 61 | PythonLaunchDescriptionSource( 62 | os.path.join(launch_file_dir, 'robot_state_publisher.launch.py') 63 | ), 64 | launch_arguments={'use_sim_time': use_sim_time}.items() 65 | ) 66 | 67 | spawn_turtlebot_cmd = IncludeLaunchDescription( 68 | PythonLaunchDescriptionSource( 69 | os.path.join(launch_file_dir, 'spawn_turtlebot3.launch.py') 70 | ), 71 | launch_arguments={ 72 | 'x_pose': x_pose, 73 | 'y_pose': y_pose 74 | }.items() 75 | ) 76 | 77 | ld = LaunchDescription() 78 | 79 | # Add the commands to the launch description 80 | ld.add_action(set_env_vars_resources) 81 | ld.add_action(gzserver_cmd) 82 | ld.add_action(gzclient_cmd) 83 | ld.add_action(robot_state_publisher_cmd) 84 | ld.add_action(spawn_turtlebot_cmd) 85 | 86 | return ld 87 | -------------------------------------------------------------------------------- /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='ros_gz_sim', 50 | executable='create', 51 | arguments=[ 52 | '-name', 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 | bridge_params = os.path.join( 62 | get_package_share_directory('turtlebot3_gazebo'), 63 | 'params', 64 | 'turtlebot3_waffle_bridge.yaml' 65 | ) 66 | 67 | start_gazebo_ros_bridge_cmd = Node( 68 | package='ros_gz_bridge', 69 | executable='parameter_bridge', 70 | arguments=[ 71 | '--ros-args', 72 | '-p', 73 | f'config_file:={bridge_params}', 74 | ], 75 | output='screen', 76 | ) 77 | 78 | start_gazebo_ros_image_bridge_cmd = Node( 79 | package='ros_gz_image', 80 | executable='image_bridge', 81 | arguments=['/camera/image_raw'], 82 | output='screen', 83 | ) 84 | 85 | ld = LaunchDescription() 86 | 87 | # Declare the launch options 88 | ld.add_action(declare_x_position_cmd) 89 | ld.add_action(declare_y_position_cmd) 90 | 91 | # Add any conditioned actions 92 | ld.add_action(start_gazebo_ros_spawner_cmd) 93 | ld.add_action(start_gazebo_ros_bridge_cmd) 94 | ld.add_action(start_gazebo_ros_image_bridge_cmd) 95 | 96 | return ld 97 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/launch/empty_world.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: Joep Tool 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 AppendEnvironmentVariable 24 | from launch.actions import IncludeLaunchDescription 25 | from launch.launch_description_sources import PythonLaunchDescriptionSource 26 | from launch.substitutions import LaunchConfiguration 27 | 28 | 29 | def generate_launch_description(): 30 | launch_file_dir = os.path.join(get_package_share_directory('turtlebot3_gazebo'), 'launch') 31 | ros_gz_sim = get_package_share_directory('ros_gz_sim') 32 | 33 | use_sim_time = LaunchConfiguration('use_sim_time', default='true') 34 | x_pose = LaunchConfiguration('x_pose', default='0.0') 35 | y_pose = LaunchConfiguration('y_pose', default='0.0') 36 | 37 | world = os.path.join( 38 | get_package_share_directory('turtlebot3_gazebo'), 39 | 'worlds', 40 | 'empty_world.world' 41 | ) 42 | set_env_vars_resources = AppendEnvironmentVariable( 43 | 'GZ_SIM_RESOURCE_PATH', 44 | os.path.join(get_package_share_directory('turtlebot3_gazebo'), 45 | 'models')) 46 | 47 | gzserver_cmd = IncludeLaunchDescription( 48 | PythonLaunchDescriptionSource( 49 | os.path.join(ros_gz_sim, 'launch', 'gz_sim.launch.py') 50 | ), 51 | launch_arguments={'gz_args': ['-r -s -v4 ', world], 'on_exit_shutdown': 'true'}.items() 52 | ) 53 | gzclient_cmd = IncludeLaunchDescription( 54 | PythonLaunchDescriptionSource( 55 | os.path.join(ros_gz_sim, 'launch', 'gz_sim.launch.py') 56 | ), 57 | launch_arguments={'gz_args': '-g -v4 '}.items() 58 | ) 59 | 60 | robot_state_publisher_cmd = IncludeLaunchDescription( 61 | PythonLaunchDescriptionSource( 62 | os.path.join(launch_file_dir, 'robot_state_publisher.launch.py') 63 | ), 64 | launch_arguments={'use_sim_time': use_sim_time}.items() 65 | ) 66 | 67 | spawn_turtlebot_cmd = IncludeLaunchDescription( 68 | PythonLaunchDescriptionSource( 69 | os.path.join(launch_file_dir, 'spawn_turtlebot3.launch.py') 70 | ), 71 | launch_arguments={ 72 | 'x_pose': x_pose, 73 | 'y_pose': y_pose 74 | }.items() 75 | ) 76 | 77 | ld = LaunchDescription() 78 | 79 | # Add the commands to the launch description 80 | ld.add_action(set_env_vars_resources) 81 | ld.add_action(gzserver_cmd) 82 | ld.add_action(gzclient_cmd) 83 | ld.add_action(robot_state_publisher_cmd) 84 | ld.add_action(spawn_turtlebot_cmd) 85 | 86 | return ld 87 | -------------------------------------------------------------------------------- /turtlebot3_fake_node/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package turtlebot3_fake 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 | * Clean up unncessary files 18 | * Use turtlebot3_common mesh modeling 19 | * Independent turtlebot3_simulations package 20 | * Contributors: Will Son 21 | 22 | 2.2.3 (2021-04-12) 23 | ------------------ 24 | * Update required keyword arguments 25 | * Contributors: ruffsl 26 | 27 | 2.2.2 (2021-02-24) 28 | ------------------ 29 | * none 30 | 31 | 2.2.1 (2021-01-13) 32 | ------------------ 33 | * Eloquent Elusor EOL 34 | * Ament lint applied 35 | * Contributors: ashe Kim, Will Son 36 | 37 | 2.2.0 (2020-06-29) 38 | ------------------ 39 | * none 40 | 41 | 2.1.0 (2019-09-10) 42 | ------------------ 43 | * ROS 2 migration of turtlebot3_fake_node package 44 | * Modified rviz config (background colour changed to white, tf display disabled) 45 | * Contributors: Ryan Shim, Darby Lim, Pyo 46 | 47 | 2.0.1 (2019-09-05) 48 | ------------------ 49 | * none 50 | 51 | 2.0.0 (2019-08-20) 52 | ------------------ 53 | * none 54 | 55 | 1.3.0 (2020-06-29) 56 | ------------------ 57 | * none 58 | 59 | 1.2.0 (2019-01-22) 60 | ------------------ 61 | * move out the init() from ROS_ASSERT `#68 `_ 62 | * Contributors: Sean Yen, Darby Lim, Pyo 63 | 64 | 1.1.0 (2018-07-20) 65 | ------------------ 66 | * added TurtleBot3 Waffle Pi 67 | * Contributors: Darby Lim, Pyo 68 | 69 | 1.0.2 (2018-06-01) 70 | ------------------ 71 | * none 72 | 73 | 1.0.1 (2018-05-30) 74 | ------------------ 75 | * none 76 | 77 | 1.0.0 (2018-05-29) 78 | ------------------ 79 | * none 80 | 81 | 0.2.4 (2018-03-14) 82 | ------------------ 83 | * none 84 | 85 | 0.2.3 (2018-03-14) 86 | ------------------ 87 | * none 88 | 89 | 0.2.2 (2018-03-14) 90 | ------------------ 91 | * none 92 | 93 | 0.2.1 (2018-03-14) 94 | ------------------ 95 | * none 96 | 97 | 0.2.0 (2018-03-13) 98 | ------------------ 99 | * added TurtleBot3 Waffle Pi 100 | * Contributors: Darby Lim 101 | 102 | 0.1.7 (2017-08-16) 103 | ------------------ 104 | * none 105 | 106 | 0.1.6 (2017-08-14) 107 | ------------------ 108 | * updated rviz and add static tf publisher for depth camera 109 | * Contributors: Darby Lim 110 | 111 | 0.1.5 (2017-06-09) 112 | ------------------ 113 | * none 114 | 115 | 0.1.4 (2017-05-23) 116 | ------------------ 117 | * added as new meta-packages and version update (0.1.4) 118 | * Contributors: Darby Lim, Pyo 119 | 120 | 0.1.3 (2017-04-24) 121 | ------------------ 122 | * modified the package information for release 123 | * modified SLAM param 124 | * modified the description, authors, depend option and delete the core package 125 | * modified the turtlebot bringup files 126 | * modified pkg setting for turtlebot3_core 127 | * modified the navigation package and turtlebot3 node for demo 128 | * modified the wheel speed gain 129 | * added Intel RealSense R200 130 | * added LDS sensor 131 | * Contributors: Darby Lim, Pyo 132 | -------------------------------------------------------------------------------- /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(gz_math_vendor REQUIRED) 24 | find_package(gz-math REQUIRED) 25 | find_package(gz_sim_vendor REQUIRED) 26 | find_package(gz-sim REQUIRED) 27 | find_package(gz_common_vendor REQUIRED) 28 | find_package(gz-common REQUIRED COMPONENTS graphics) 29 | find_package(geometry_msgs REQUIRED) 30 | find_package(nav_msgs REQUIRED) 31 | find_package(rclcpp REQUIRED) 32 | find_package(sensor_msgs REQUIRED) 33 | find_package(tf2 REQUIRED) 34 | 35 | ################################################################################ 36 | # Build 37 | ################################################################################ 38 | link_directories( 39 | ) 40 | 41 | include_directories( 42 | include 43 | ) 44 | 45 | set(dependencies 46 | "geometry_msgs" 47 | "nav_msgs" 48 | "rclcpp" 49 | "sensor_msgs" 50 | "tf2" 51 | ) 52 | 53 | set(EXEC_NAME "turtlebot3_drive") 54 | 55 | add_executable(${EXEC_NAME} src/turtlebot3_drive.cpp) 56 | ament_target_dependencies(${EXEC_NAME} ${dependencies}) 57 | 58 | set(GAZEBO_LIBRARIES gz-math::gz-math gz-sim::gz-sim gz-common::graphics) 59 | add_library(obstacle1 SHARED models/turtlebot3_dqn_world/obstacle_plugin/obstacle1.cc) 60 | target_link_libraries(obstacle1 ${GAZEBO_LIBRARIES}) 61 | 62 | add_library(obstacle2 SHARED models/turtlebot3_dqn_world/obstacle_plugin/obstacle2.cc) 63 | target_link_libraries(obstacle2 ${GAZEBO_LIBRARIES}) 64 | 65 | add_library(obstacles SHARED models/turtlebot3_dqn_world/obstacle_plugin/obstacles.cc) 66 | target_link_libraries(obstacles ${GAZEBO_LIBRARIES}) 67 | 68 | ################################################################################ 69 | # Install 70 | ################################################################################ 71 | install(TARGETS ${EXEC_NAME} 72 | DESTINATION lib/${PROJECT_NAME} 73 | ) 74 | 75 | install(DIRECTORY launch models params rviz urdf worlds 76 | DESTINATION share/${PROJECT_NAME}/ 77 | ) 78 | 79 | install(DIRECTORY include/ 80 | DESTINATION include/ 81 | ) 82 | 83 | ################################################################################ 84 | # Macro for ament package 85 | ################################################################################ 86 | ament_export_include_directories(include) 87 | ament_export_dependencies(ros_gz_bridge) 88 | ament_export_dependencies(ros_gz_sim) 89 | ament_export_dependencies(geometry_msgs) 90 | ament_export_dependencies(nav_msgs) 91 | ament_export_dependencies(rclcpp) 92 | ament_export_dependencies(sensor_msgs) 93 | ament_export_dependencies(tf2) 94 | ament_package() 95 | -------------------------------------------------------------------------------- /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_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 "ObstacleAnimator.hh" 18 | 19 | #include 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | namespace gazebo { 26 | class Obstacle2 : public ObstacleAnimator { 27 | public: 28 | Obstacle2() : ObstacleAnimator(CreateAnimation()) {} 29 | 30 | // create the animation 31 | gz::common::PoseAnimation CreateAnimation() { 32 | // name the animation "move_2", 33 | // make it last 260 seconds, 34 | // and set it on a repeat loop 35 | gz::common::PoseAnimation anim = gz::common::PoseAnimation("move2", 140.0, true); 36 | 37 | gz::common::PoseKeyFrame *key; 38 | 39 | // set starting location of the box 40 | key = anim.CreateKeyFrame(0); 41 | key->Translation(gz::math::Vector3d(0.0, 0.0, 0.0)); 42 | key->Rotation(gz::math::Quaterniond(0, 0, 0)); 43 | 44 | key = anim.CreateKeyFrame(10); 45 | key->Translation(gz::math::Vector3d(0.7, 0.2, 0.0)); 46 | key->Rotation(gz::math::Quaterniond(0, 0, 0)); 47 | 48 | key = anim.CreateKeyFrame(40); 49 | key->Translation(gz::math::Vector3d(2.5, 3.5, 0.0)); 50 | key->Rotation(gz::math::Quaterniond(0, 0, 0)); 51 | 52 | key = anim.CreateKeyFrame(55); 53 | key->Translation(gz::math::Vector3d(0.3, 3.5, 0.0)); 54 | key->Rotation(gz::math::Quaterniond(0, 0, 0)); 55 | 56 | key = anim.CreateKeyFrame(85); 57 | key->Translation(gz::math::Vector3d(3.5, 1.8, 0.0)); 58 | key->Rotation(gz::math::Quaterniond(0, 0, 0)); 59 | 60 | key = anim.CreateKeyFrame(100); 61 | key->Translation(gz::math::Vector3d(3.5, 0.0, 0.0)); 62 | key->Rotation(gz::math::Quaterniond(0, 0, 0)); 63 | 64 | key = anim.CreateKeyFrame(110); 65 | key->Translation(gz::math::Vector3d(2.0, 0.5, 0.0)); 66 | key->Rotation(gz::math::Quaterniond(0, 0, 0)); 67 | 68 | key = anim.CreateKeyFrame(115); 69 | key->Translation(gz::math::Vector3d(1.5, 1.0, 0.0)); 70 | key->Rotation(gz::math::Quaterniond(0, 0, 0)); 71 | 72 | key = anim.CreateKeyFrame(120); 73 | key->Translation(gz::math::Vector3d(1.0, 0.5, 0.0)); 74 | key->Rotation(gz::math::Quaterniond(0, 0, 0)); 75 | 76 | key = anim.CreateKeyFrame(125); 77 | key->Translation(gz::math::Vector3d(0.5, 0.1, 0.0)); 78 | key->Rotation(gz::math::Quaterniond(0, 0, 0)); 79 | 80 | key = anim.CreateKeyFrame(130); 81 | key->Translation(gz::math::Vector3d(0.0, 0.0, 0.0)); 82 | key->Rotation(gz::math::Quaterniond(0, 0, 0)); 83 | 84 | key = anim.CreateKeyFrame(140); 85 | key->Translation(gz::math::Vector3d(0.0, 0.0, 0.0)); 86 | key->Rotation(gz::math::Quaterniond(0, 0, 0)); 87 | 88 | return anim; 89 | } 90 | }; 91 | // Register this plugin with the simulator 92 | GZ_ADD_PLUGIN(Obstacle2, ::gz::sim::System, ::gz::sim::ISystemConfigure, 93 | ::gz::sim::ISystemPreUpdate) 94 | GZ_ADD_PLUGIN_ALIAS(Obstacle2, "obstacle2") 95 | } // namespace gazebo 96 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TurtleBot3 2 | 3 | 4 | [![kinetic-devel Status](https://github.com/ROBOTIS-GIT/turtlebot3_simulations/workflows/kinetic-devel/badge.svg)](https://github.com/ROBOTIS-GIT/turtlebot3_simulations/tree/kinetic-devel) 5 | [![melodic-devel Status](https://github.com/ROBOTIS-GIT/turtlebot3_simulations/workflows/melodic-devel/badge.svg)](https://github.com/ROBOTIS-GIT/turtlebot3_simulations/tree/melodic-devel) 6 | [![noetic-devel Status](https://github.com/ROBOTIS-GIT/turtlebot3_simulations/workflows/noetic-devel/badge.svg)](https://github.com/ROBOTIS-GIT/turtlebot3_simulations/tree/noetic-devel) 7 | 8 | [![dashing-devel Status](https://github.com/ROBOTIS-GIT/turtlebot3_simulations/workflows/dashing-devel/badge.svg)](https://github.com/ROBOTIS-GIT/turtlebot3_simulations/tree/dashing-devel) 9 | [![foxy-devel Status](https://github.com/ROBOTIS-GIT/turtlebot3_simulations/workflows/foxy-devel/badge.svg)](https://github.com/ROBOTIS-GIT/turtlebot3_simulations/tree/foxy-devel) 10 | [![galactic-devel Status](https://github.com/ROBOTIS-GIT/turtlebot3_simulations/workflows/galactic-devel/badge.svg)](https://github.com/ROBOTIS-GIT/turtlebot3_simulations/tree/galactic-devel) 11 | [![humble-devel Status](https://github.com/ROBOTIS-GIT/turtlebot3_simulations/workflows/humble-devel/badge.svg)](https://github.com/ROBOTIS-GIT/turtlebot3_simulations/tree/humble-devel) 12 | 13 | ## ROBOTIS e-Manual for TurtleBot3 14 | - [ROBOTIS e-Manual for TurtleBot3](http://turtlebot3.robotis.com/) 15 | 16 | ## Wiki for turtlebot3_simulations Packages 17 | - http://wiki.ros.org/turtlebot3_simulations (metapackage) 18 | - http://wiki.ros.org/turtlebot3_fake 19 | - http://wiki.ros.org/turtlebot3_gazebo 20 | 21 | ## Open Source related to TurtleBot3 22 | - [turtlebot3](https://github.com/ROBOTIS-GIT/turtlebot3) 23 | - [turtlebot3_msgs](https://github.com/ROBOTIS-GIT/turtlebot3_msgs) 24 | - [turtlebot3_simulations](https://github.com/ROBOTIS-GIT/turtlebot3_simulations) 25 | - [turtlebot3_applications_msgs](https://github.com/ROBOTIS-GIT/turtlebot3_applications_msgs) 26 | - [turtlebot3_applications](https://github.com/ROBOTIS-GIT/turtlebot3_applications) 27 | - [turtlebot3_autorace](https://github.com/ROBOTIS-GIT/turtlebot3_autorace) 28 | - [turtlebot3_deliver](https://github.com/ROBOTIS-GIT/turtlebot3_deliver) 29 | - [hls_lfcd_lds_driver](https://github.com/ROBOTIS-GIT/hls_lfcd_lds_driver) 30 | - [ld08_driver](https://github.com/ROBOTIS-GIT/ld08_driver) 31 | - [open_manipulator_msgs](https://github.com/ROBOTIS-GIT/open_manipulator_msgs) 32 | - [open_manipulator](https://github.com/ROBOTIS-GIT/open_manipulator) 33 | - [open_manipulator_simulations](https://github.com/ROBOTIS-GIT/open_manipulator_simulations) 34 | - [open_manipulator_perceptions](https://github.com/ROBOTIS-GIT/open_manipulator_perceptions) 35 | - [open_manipulator_with_tb3_msgs](https://github.com/ROBOTIS-GIT/open_manipulator_with_tb3_msgs) 36 | - [open_manipulator_with_tb3](https://github.com/ROBOTIS-GIT/open_manipulator_with_tb3) 37 | - [open_manipulator_with_tb3_simulations](https://github.com/ROBOTIS-GIT/open_manipulator_with_tb3_simulations) 38 | - [dynamixel_sdk](https://github.com/ROBOTIS-GIT/DynamixelSDK) 39 | - [OpenCR-Hardware](https://github.com/ROBOTIS-GIT/OpenCR-Hardware) 40 | - [OpenCR](https://github.com/ROBOTIS-GIT/OpenCR) 41 | 42 | ## Documents and Videos related to TurtleBot3 43 | - [ROBOTIS e-Manual for TurtleBot3](http://turtlebot3.robotis.com/) 44 | - [ROBOTIS e-Manual for OpenManipulator](http://emanual.robotis.com/docs/en/platform/openmanipulator/) 45 | - [ROBOTIS e-Manual for Dynamixel SDK](http://emanual.robotis.com/docs/en/software/dynamixel/dynamixel_sdk/overview/) 46 | - [Website for TurtleBot Series](http://www.turtlebot.com/) 47 | - [e-Book for TurtleBot3](https://community.robotsource.org/t/download-the-ros-robot-programming-book-for-free/51/) 48 | - [Videos for TurtleBot3 ](https://www.youtube.com/playlist?list=PLRG6WP3c31_XI3wlvHlx2Mp8BYqgqDURU) 49 | -------------------------------------------------------------------------------- /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_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/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/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/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/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_simulations/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package turtlebot3_simulations 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 | * ROS 2 migration of turtlebot3_fake_node package 55 | * Modified rviz config (background colour changed to white, tf display disabled) 56 | * Added turtlebot3_house and related world, model files 57 | * Contributors: Ryan Shim, Darby Lim, Pyo 58 | 59 | 2.0.1 (2019-09-05) 60 | ------------------ 61 | * Modified dependency packages 62 | * Modified launch directory 63 | * Added a launch file for robot state publisher 64 | * Contributors: Darby Lim, Pyo 65 | 66 | 2.0.0 (2019-08-20) 67 | ------------------ 68 | * Supported ROS 2 Dashing Diademata 69 | * Updated the CHANGELOG and version to release binary packages 70 | * Contributors: Darby Lim, Pyo 71 | 72 | 1.3.0 (2020-06-29) 73 | ------------------ 74 | * Turtlebot3 Autorace 2020 implemented 75 | * Remove the plugin_path from gazebo_ros export 76 | * Remove *nix path separator 77 | * Contributors: Ashe Kim, Ben Wolsieffer, Sean Yen 78 | 79 | 1.2.0 (2019-01-22) 80 | ------------------ 81 | * move out the init() from ROS_ASSERT `#68 `_ 82 | * moved into `#65 `_ 83 | * modified ML stage 84 | * delete unused param 85 | * update algorithm and modified variable more clearly 86 | * Contributors: Darby Lim, Gilbert, Louise Poubel, Pyo 87 | 88 | 1.1.0 (2018-07-20) 89 | ------------------ 90 | * added TurtleBot3 Waffle Pi 91 | * modified uri path 92 | * modified autorace 93 | * delete remap 94 | * Contributors: Darby Lim, Gilbert, Pyo 95 | 96 | 1.0.2 (2018-06-01) 97 | ------------------ 98 | * added mission.launch modified model.sdf 99 | * deleted turtlebot3's gazebo plugins 100 | * modified autorace gazebo 101 | * merged pull request `#53 `_ `#52 `_ `#51 `_ `#50 `_ `#49 `_ 102 | * Contributors: Gilbert, Darby Lim, Pyo 103 | 104 | 1.0.1 (2018-05-30) 105 | ------------------ 106 | * resolving dependency issues: 107 | http://build.ros.org/job/Kbin_dj_dJ64__turtlebot3_gazebo__debian_jessie_amd64__binary/2/ 108 | * Contributors: Pyo 109 | 110 | 1.0.0 (2018-05-29) 111 | ------------------ 112 | * added world for turtlebot3_autorace 113 | * added world for turtlebot3_machine_learning 114 | * merged pull request `#46 `_ from AuTURBO/develop 115 | add turtlebot3_autorace world' 116 | * merged pull request `#48 `_ `#47 `_ `#44 `_ `#42 `_ `#41 `_ 117 | * Contributors: Darby Lim, Gilbert, hyunoklee, Pyo 118 | 119 | 0.2.4 (2018-03-14) 120 | ------------------ 121 | * solved DuplicateVersionsException error 122 | * Contributors: Pyo 123 | 124 | 0.2.3 (2018-03-14) 125 | ------------------ 126 | * solved DuplicateVersionsException error 127 | * Contributors: Pyo 128 | 129 | 0.2.2 (2018-03-14) 130 | ------------------ 131 | * added line feed into metapackage 132 | * Contributors: Pyo 133 | 134 | 0.2.1 (2018-03-14) 135 | ------------------ 136 | * added worlds for gazebo and turtlebot3 137 | * deleted turtlebot3_gazebo_plugin and merged into turtlebot3_gazebo_ros package 138 | * Contributors: Darby Lim 139 | 140 | 0.2.0 (2018-03-13) 141 | ------------------ 142 | * added TurtleBot3 Waffle Pi 143 | * added slam with multiple tb3 144 | * added multi example 145 | * added turtlebot3_house 146 | * added turtlebot3_house 147 | * added msg function 148 | * modified gazebo plugin 149 | * modified tb3 control 150 | * modified sensor param 151 | * modified camera position 152 | * modified image_listener 153 | * modified cmake file 154 | * modified spwn model name 155 | * modified multi slam param 156 | * modified camera position 157 | * modified folder name 158 | * Contributors: Darby Lim 159 | 160 | 0.1.7 (2017-08-16) 161 | ------------------ 162 | * renamed missed the install rule (worlds -> models) 163 | * Contributors: Darby Lim, Tully Foote 164 | 165 | 0.1.6 (2017-08-14) 166 | ------------------ 167 | * modified folder name and model path 168 | * updated rviz and add static tf publisher for depth camera 169 | * Contributors: Darby Lim 170 | 171 | 0.1.5 (2017-06-09) 172 | ------------------ 173 | * modified make files for dependencies 174 | * updated turtlebot3 sim 175 | * updated world config 176 | * Contributors: Darby Lim 177 | 178 | 0.1.4 (2017-05-23) 179 | ------------------ 180 | * added as new meta-packages and version update (0.1.4) 181 | * Contributors: Darby Lim, Pyo 182 | -------------------------------------------------------------------------------- /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/urdf/turtlebot3_waffle.urdf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 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 | 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 | 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 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 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 | 223 | 224 | 225 | 226 | 227 | 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 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | -------------------------------------------------------------------------------- /turtlebot3_fake_node/src/turtlebot3_fake_node.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: Yoonseok Pyo, Ryan Shim 16 | 17 | #include "turtlebot3_fake_node/turtlebot3_fake_node.hpp" 18 | 19 | #include 20 | #include 21 | 22 | using namespace std::chrono_literals; 23 | 24 | Turtlebot3Fake::Turtlebot3Fake() 25 | : Node("turtlebot3_fake_node") 26 | { 27 | /************************************************************ 28 | ** Initialise ROS parameters 29 | ************************************************************/ 30 | init_parameters(); 31 | 32 | /************************************************************ 33 | ** Initialise variables 34 | ************************************************************/ 35 | init_variables(); 36 | 37 | /************************************************************ 38 | ** Initialise ROS publishers and subscribers 39 | ************************************************************/ 40 | auto qos = rclcpp::QoS(rclcpp::KeepLast(10)); 41 | 42 | // Initialise publishers 43 | odom_pub_ = this->create_publisher("odom", qos); 44 | joint_states_pub_ = this->create_publisher("joint_states", qos); 45 | tf_pub_ = this->create_publisher("tf", qos); 46 | 47 | // Initialise subscribers 48 | cmd_vel_sub_ = this->create_subscription( 49 | "cmd_vel", \ 50 | qos, \ 51 | std::bind( 52 | &Turtlebot3Fake::command_velocity_callback, \ 53 | this, \ 54 | std::placeholders::_1)); 55 | 56 | /************************************************************ 57 | ** initialise ROS timers 58 | ************************************************************/ 59 | update_timer_ = this->create_wall_timer(10ms, std::bind(&Turtlebot3Fake::update_callback, this)); 60 | 61 | RCLCPP_INFO(this->get_logger(), "Turtlebot3 fake node has been initialised"); 62 | } 63 | 64 | Turtlebot3Fake::~Turtlebot3Fake() 65 | { 66 | RCLCPP_INFO(this->get_logger(), "Turtlebot3 fake node has been terminated"); 67 | } 68 | 69 | /******************************************************************************** 70 | ** Init functions 71 | ********************************************************************************/ 72 | void Turtlebot3Fake::init_parameters() 73 | { 74 | // Declare parameters that may be set on this node 75 | this->declare_parameter("joint_states_frame"); 76 | this->declare_parameter("odom_frame"); 77 | this->declare_parameter("base_frame"); 78 | this->declare_parameter("wheels.separation"); 79 | this->declare_parameter("wheels.radius"); 80 | 81 | // Get parameters from yaml 82 | this->get_parameter_or( 83 | "joint_states_frame", \ 84 | joint_states_.header.frame_id, \ 85 | "base_footprint"); 86 | this->get_parameter_or("odom_frame", odom_.header.frame_id, "odom"); 87 | this->get_parameter_or("base_frame", odom_.child_frame_id, "base_footprint"); 88 | this->get_parameter_or("wheels.separation", wheel_seperation_, 0.0); 89 | this->get_parameter_or("wheels.radius", wheel_radius_, 0.0); 90 | } 91 | 92 | void Turtlebot3Fake::init_variables() 93 | { 94 | // Initialise variables 95 | wheel_speed_cmd_[LEFT] = 0.0; 96 | wheel_speed_cmd_[RIGHT] = 0.0; 97 | goal_linear_velocity_ = 0.0; 98 | goal_angular_velocity_ = 0.0; 99 | cmd_vel_timeout_ = 1.0; 100 | last_position_[LEFT] = 0.0; 101 | last_position_[RIGHT] = 0.0; 102 | last_velocity_[LEFT] = 0.0; 103 | last_velocity_[RIGHT] = 0.0; 104 | 105 | // TODO(Will Son): Find more accurate covariance 106 | // double pcov[36] = { 0.1, 0, 0, 0, 0, 0, 107 | // 0, 0.1, 0, 0, 0, 0, 108 | // 0, 0, 1e6, 0, 0, 0, 109 | // 0, 0, 0, 1e6, 0, 0, 110 | // 0, 0, 0, 0, 1e6, 0, 111 | // 0, 0, 0, 0, 0, 0.2}; 112 | // memcpy(&(odom_.pose.covariance), pcov, sizeof(double)*36); 113 | // memcpy(&(odom_.twist.covariance), pcov, sizeof(double)*36); 114 | 115 | odom_pose_[0] = 0.0; 116 | odom_pose_[1] = 0.0; 117 | odom_pose_[2] = 0.0; 118 | odom_vel_[0] = 0.0; 119 | odom_vel_[1] = 0.0; 120 | odom_vel_[2] = 0.0; 121 | 122 | joint_states_.name.push_back("wheel_left_joint"); 123 | joint_states_.name.push_back("wheel_right_joint"); 124 | joint_states_.position.resize(2, 0.0); 125 | joint_states_.velocity.resize(2, 0.0); 126 | joint_states_.effort.resize(2, 0.0); 127 | 128 | prev_update_time_ = this->now(); 129 | last_cmd_vel_time_ = this->now(); 130 | } 131 | 132 | /******************************************************************************** 133 | ** Callback functions for ROS subscribers 134 | ********************************************************************************/ 135 | void Turtlebot3Fake::command_velocity_callback( 136 | const geometry_msgs::msg::Twist::SharedPtr cmd_vel_msg) 137 | { 138 | last_cmd_vel_time_ = this->now(); 139 | 140 | goal_linear_velocity_ = cmd_vel_msg->linear.x; 141 | goal_angular_velocity_ = cmd_vel_msg->angular.z; 142 | 143 | wheel_speed_cmd_[LEFT] = goal_linear_velocity_ - (goal_angular_velocity_ * wheel_seperation_ / 2); 144 | wheel_speed_cmd_[RIGHT] = goal_linear_velocity_ + \ 145 | (goal_angular_velocity_ * wheel_seperation_ / 2); 146 | } 147 | 148 | /******************************************************************************** 149 | ** Update functions 150 | ********************************************************************************/ 151 | void Turtlebot3Fake::update_callback() 152 | { 153 | rclcpp::Time time_now = this->now(); 154 | rclcpp::Duration duration(time_now - prev_update_time_); 155 | prev_update_time_ = time_now; 156 | 157 | // zero-ing after timeout (stop the robot if no cmd_vel) 158 | if ((time_now - last_cmd_vel_time_).nanoseconds() / 1e9 > cmd_vel_timeout_) { 159 | wheel_speed_cmd_[LEFT] = 0.0; 160 | wheel_speed_cmd_[RIGHT] = 0.0; 161 | } 162 | 163 | // odom 164 | update_odometry(duration); 165 | odom_.header.stamp = time_now; 166 | odom_pub_->publish(odom_); 167 | 168 | // joint_states 169 | update_joint_state(); 170 | joint_states_.header.stamp = time_now; 171 | joint_states_pub_->publish(joint_states_); 172 | 173 | // tf 174 | geometry_msgs::msg::TransformStamped odom_tf; 175 | update_tf(odom_tf); 176 | tf2_msgs::msg::TFMessage odom_tf_msg; 177 | odom_tf_msg.transforms.push_back(odom_tf); 178 | tf_pub_->publish(odom_tf_msg); 179 | } 180 | 181 | bool Turtlebot3Fake::update_odometry(const rclcpp::Duration & duration) 182 | { 183 | double wheel_l, wheel_r; // rotation value of wheel [rad] 184 | double delta_s, delta_theta; 185 | double v[2], w[2]; 186 | double step_time = duration.nanoseconds() / 1e9; // [sec] 187 | 188 | wheel_l = wheel_r = 0.0; 189 | delta_s = delta_theta = 0.0; 190 | 191 | // v = translational velocity [m/s] 192 | // w = rotational velocity [rad/s] 193 | v[LEFT] = wheel_speed_cmd_[LEFT]; 194 | w[LEFT] = v[LEFT] / wheel_radius_; // w = v / r 195 | v[RIGHT] = wheel_speed_cmd_[RIGHT]; 196 | w[RIGHT] = v[RIGHT] / wheel_radius_; 197 | 198 | last_velocity_[LEFT] = w[LEFT]; 199 | last_velocity_[RIGHT] = w[RIGHT]; 200 | 201 | wheel_l = w[LEFT] * step_time; 202 | wheel_r = w[RIGHT] * step_time; 203 | 204 | if (isnan(wheel_l)) { 205 | wheel_l = 0.0; 206 | } 207 | 208 | if (isnan(wheel_r)) { 209 | wheel_r = 0.0; 210 | } 211 | 212 | last_position_[LEFT] += wheel_l; 213 | last_position_[RIGHT] += wheel_r; 214 | 215 | delta_s = wheel_radius_ * (wheel_r + wheel_l) / 2.0; 216 | delta_theta = wheel_radius_ * (wheel_r - wheel_l) / wheel_seperation_; 217 | 218 | // compute odometric pose 219 | odom_pose_[0] += delta_s * cos(odom_pose_[2] + (delta_theta / 2.0)); 220 | odom_pose_[1] += delta_s * sin(odom_pose_[2] + (delta_theta / 2.0)); 221 | odom_pose_[2] += delta_theta; 222 | 223 | // compute odometric instantaneouse velocity 224 | odom_vel_[0] = delta_s / step_time; // v 225 | odom_vel_[1] = 0.0; 226 | odom_vel_[2] = delta_theta / step_time; // w 227 | 228 | odom_.pose.pose.position.x = odom_pose_[0]; 229 | odom_.pose.pose.position.y = odom_pose_[1]; 230 | odom_.pose.pose.position.z = 0; 231 | 232 | tf2::Quaternion q; 233 | q.setRPY(0, 0, odom_pose_[2]); 234 | 235 | odom_.pose.pose.orientation.x = q.x(); 236 | odom_.pose.pose.orientation.y = q.y(); 237 | odom_.pose.pose.orientation.z = q.z(); 238 | odom_.pose.pose.orientation.w = q.w(); 239 | 240 | // We should update the twist of the odometry 241 | odom_.twist.twist.linear.x = odom_vel_[0]; 242 | odom_.twist.twist.angular.z = odom_vel_[2]; 243 | 244 | return true; 245 | } 246 | 247 | void Turtlebot3Fake::update_joint_state() 248 | { 249 | joint_states_.position[LEFT] = last_position_[LEFT]; 250 | joint_states_.position[RIGHT] = last_position_[RIGHT]; 251 | joint_states_.velocity[LEFT] = last_velocity_[LEFT]; 252 | joint_states_.velocity[RIGHT] = last_velocity_[RIGHT]; 253 | } 254 | 255 | void Turtlebot3Fake::update_tf(geometry_msgs::msg::TransformStamped & odom_tf) 256 | { 257 | odom_tf.header = odom_.header; 258 | odom_tf.child_frame_id = odom_.child_frame_id; 259 | odom_tf.transform.translation.x = odom_.pose.pose.position.x; 260 | odom_tf.transform.translation.y = odom_.pose.pose.position.y; 261 | odom_tf.transform.translation.z = odom_.pose.pose.position.z; 262 | odom_tf.transform.rotation = odom_.pose.pose.orientation; 263 | } 264 | 265 | /***************************************************************************** 266 | ** Main 267 | *****************************************************************************/ 268 | int main(int argc, char ** argv) 269 | { 270 | rclcpp::init(argc, argv); 271 | rclcpp::spin(std::make_shared()); 272 | rclcpp::shutdown(); 273 | 274 | return 0; 275 | } 276 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/rviz/tb3_gazebo.rviz: -------------------------------------------------------------------------------- 1 | Panels: 2 | - Class: rviz_common/Displays 3 | Help Height: 78 4 | Name: Displays 5 | Property Tree Widget: 6 | Expanded: 7 | - /TF1/Frames1 8 | Splitter Ratio: 0.5 9 | Tree Height: 694 10 | - Class: rviz_common/Selection 11 | Name: Selection 12 | - Class: rviz_common/Tool Properties 13 | Expanded: 14 | - /Publish Point1 15 | Name: Tool Properties 16 | Splitter Ratio: 0.5886790156364441 17 | - Class: rviz_common/Views 18 | Expanded: 19 | - /Current View1 20 | Name: Views 21 | Splitter Ratio: 0.5 22 | Visualization Manager: 23 | Class: "" 24 | Displays: 25 | - Alpha: 0.5 26 | Cell Size: 1 27 | Class: rviz_default_plugins/Grid 28 | Color: 160; 160; 164 29 | Enabled: true 30 | Line Style: 31 | Line Width: 0.029999999329447746 32 | Value: Lines 33 | Name: Grid 34 | Normal Cell Count: 0 35 | Offset: 36 | X: 0 37 | Y: 0 38 | Z: 0 39 | Plane: XY 40 | Plane Cell Count: 10 41 | Reference Frame: 42 | Value: true 43 | - Class: rviz_default_plugins/TF 44 | Enabled: true 45 | Frame Timeout: 15 46 | Frames: 47 | All Enabled: true 48 | base_footprint: 49 | Value: true 50 | base_link: 51 | Value: true 52 | base_scan: 53 | Value: true 54 | camera_link: 55 | Value: true 56 | camera_rgb_frame: 57 | Value: true 58 | camera_rgb_optical_frame: 59 | Value: true 60 | caster_back_left_link: 61 | Value: true 62 | caster_back_right_link: 63 | Value: true 64 | imu_link: 65 | Value: true 66 | odom: 67 | Value: true 68 | wheel_left_link: 69 | Value: true 70 | wheel_right_link: 71 | Value: true 72 | Marker Scale: 0.699999988079071 73 | Name: TF 74 | Show Arrows: true 75 | Show Axes: true 76 | Show Names: true 77 | Tree: 78 | odom: 79 | base_footprint: 80 | base_link: 81 | base_scan: 82 | {} 83 | camera_link: 84 | camera_rgb_frame: 85 | camera_rgb_optical_frame: 86 | {} 87 | caster_back_left_link: 88 | {} 89 | caster_back_right_link: 90 | {} 91 | imu_link: 92 | {} 93 | wheel_left_link: 94 | {} 95 | wheel_right_link: 96 | {} 97 | Update Interval: 0 98 | Value: true 99 | - Alpha: 1 100 | Autocompute Intensity Bounds: true 101 | Autocompute Value Bounds: 102 | Max Value: 10 103 | Min Value: -10 104 | Value: true 105 | Axis: Z 106 | Channel Name: intensity 107 | Class: rviz_default_plugins/LaserScan 108 | Color: 255; 255; 255 109 | Color Transformer: Intensity 110 | Decay Time: 0 111 | Enabled: true 112 | Invert Rainbow: false 113 | Max Color: 255; 255; 255 114 | Max Intensity: 0 115 | Min Color: 0; 0; 0 116 | Min Intensity: 0 117 | Name: LaserScan 118 | Position Transformer: XYZ 119 | Selectable: true 120 | Size (Pixels): 3 121 | Size (m): 0.019999999552965164 122 | Style: Flat Squares 123 | Topic: 124 | Depth: 5 125 | Durability Policy: Volatile 126 | Filter size: 10 127 | History Policy: Keep Last 128 | Reliability Policy: Reliable 129 | Value: /scan 130 | Use Fixed Frame: true 131 | Use rainbow: true 132 | Value: true 133 | - Angle Tolerance: 0.10000000149011612 134 | Class: rviz_default_plugins/Odometry 135 | Covariance: 136 | Orientation: 137 | Alpha: 0.5 138 | Color: 255; 255; 127 139 | Color Style: Unique 140 | Frame: Local 141 | Offset: 1 142 | Scale: 1 143 | Value: true 144 | Position: 145 | Alpha: 0.30000001192092896 146 | Color: 204; 51; 204 147 | Scale: 1 148 | Value: true 149 | Value: false 150 | Enabled: true 151 | Keep: 100 152 | Name: Odometry 153 | Position Tolerance: 0.10000000149011612 154 | Shape: 155 | Alpha: 1 156 | Axes Length: 1 157 | Axes Radius: 0.10000000149011612 158 | Color: 255; 25; 0 159 | Head Length: 0.30000001192092896 160 | Head Radius: 0.10000000149011612 161 | Shaft Length: 1 162 | Shaft Radius: 0.05000000074505806 163 | Value: Arrow 164 | Topic: 165 | Depth: 5 166 | Durability Policy: Volatile 167 | Filter size: 10 168 | History Policy: Keep Last 169 | Reliability Policy: Reliable 170 | Value: /odom 171 | Value: true 172 | - Alpha: 1 173 | Class: rviz_default_plugins/RobotModel 174 | Collision Enabled: false 175 | Description File: "" 176 | Description Source: Topic 177 | Description Topic: 178 | Depth: 5 179 | Durability Policy: Volatile 180 | History Policy: Keep Last 181 | Reliability Policy: Reliable 182 | Value: robot_description 183 | Enabled: true 184 | Links: 185 | All Links Enabled: true 186 | Expand Joint Details: false 187 | Expand Link Details: false 188 | Expand Tree: false 189 | Link Tree Style: Links in Alphabetic Order 190 | base_footprint: 191 | Alpha: 1 192 | Show Axes: false 193 | Show Trail: false 194 | base_link: 195 | Alpha: 1 196 | Show Axes: false 197 | Show Trail: false 198 | Value: true 199 | base_scan: 200 | Alpha: 1 201 | Show Axes: false 202 | Show Trail: false 203 | Value: true 204 | camera_link: 205 | Alpha: 1 206 | Show Axes: false 207 | Show Trail: false 208 | Value: true 209 | camera_rgb_frame: 210 | Alpha: 1 211 | Show Axes: false 212 | Show Trail: false 213 | camera_rgb_optical_frame: 214 | Alpha: 1 215 | Show Axes: false 216 | Show Trail: false 217 | caster_back_left_link: 218 | Alpha: 1 219 | Show Axes: false 220 | Show Trail: false 221 | Value: true 222 | caster_back_right_link: 223 | Alpha: 1 224 | Show Axes: false 225 | Show Trail: false 226 | Value: true 227 | imu_link: 228 | Alpha: 1 229 | Show Axes: false 230 | Show Trail: false 231 | wheel_left_link: 232 | Alpha: 1 233 | Show Axes: false 234 | Show Trail: false 235 | Value: true 236 | wheel_right_link: 237 | Alpha: 1 238 | Show Axes: false 239 | Show Trail: false 240 | Value: true 241 | Name: RobotModel 242 | TF Prefix: "" 243 | Update Interval: 0 244 | Value: true 245 | Visual Enabled: true 246 | Enabled: true 247 | Global Options: 248 | Background Color: 48; 48; 48 249 | Fixed Frame: odom 250 | Frame Rate: 30 251 | Name: root 252 | Tools: 253 | - Class: rviz_default_plugins/MoveCamera 254 | - Class: rviz_default_plugins/Select 255 | - Class: rviz_default_plugins/FocusCamera 256 | - Class: rviz_default_plugins/Measure 257 | Line color: 128; 128; 0 258 | - Class: rviz_default_plugins/SetGoal 259 | Topic: 260 | Depth: 5 261 | Durability Policy: Volatile 262 | History Policy: Keep Last 263 | Reliability Policy: Reliable 264 | Value: /move_base_simple/goal 265 | - Class: rviz_default_plugins/PublishPoint 266 | Single click: true 267 | Topic: 268 | Depth: 5 269 | Durability Policy: Volatile 270 | History Policy: Keep Last 271 | Reliability Policy: Reliable 272 | Value: /clicked_point 273 | Transformation: 274 | Current: 275 | Class: rviz_default_plugins/TF 276 | Value: true 277 | Views: 278 | Current: 279 | Class: rviz_default_plugins/Orbit 280 | Distance: 5 281 | Enable Stereo Rendering: 282 | Stereo Eye Separation: 0.05999999865889549 283 | Stereo Focal Distance: 1 284 | Swap Stereo Eyes: false 285 | Value: false 286 | Focal Point: 287 | X: 0 288 | Y: 0 289 | Z: 0 290 | Focal Shape Fixed Size: false 291 | Focal Shape Size: 0.05000000074505806 292 | Invert Z Axis: false 293 | Name: Current View 294 | Near Clip Distance: 0.009999999776482582 295 | Pitch: 0.7853981852531433 296 | Target Frame: 297 | Value: Orbit (rviz_default_plugins) 298 | Yaw: 0.7853981852531433 299 | Saved: 300 | - Class: rviz_default_plugins/Orbit 301 | Distance: 5 302 | Enable Stereo Rendering: 303 | Stereo Eye Separation: 0.05999999865889549 304 | Stereo Focal Distance: 1 305 | Swap Stereo Eyes: false 306 | Value: false 307 | Focal Point: 308 | X: 0 309 | Y: 0 310 | Z: 0 311 | Focal Shape Fixed Size: false 312 | Focal Shape Size: 0.05000000074505806 313 | Invert Z Axis: false 314 | Name: Orbit 315 | Near Clip Distance: 0.009999999776482582 316 | Pitch: 0.7853981852531433 317 | Target Frame: 318 | Value: Orbit (rviz_default_plugins) 319 | Yaw: 0.7853981852531433 320 | Window Geometry: 321 | Displays: 322 | collapsed: false 323 | Height: 923 324 | Hide Left Dock: false 325 | Hide Right Dock: false 326 | QMainWindow State: 000000ff00000000fd00000004000000000000019300000341fc0200000008fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003d00000341000000c900fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261000000010000010f00000341fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000003d00000341000000a400fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000004420000003efc0100000002fb0000000800540069006d00650100000000000004420000000000000000fb0000000800540069006d00650100000000000004500000000000000000000002820000034100000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 327 | Selection: 328 | collapsed: false 329 | Tool Properties: 330 | collapsed: false 331 | Views: 332 | collapsed: false 333 | Width: 1328 334 | X: 168 335 | Y: 71 336 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/worlds/turtlebot3_world.world: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 12 | 13 | 16 | 17 | 20 | ogre2 21 | 22 | 25 | 26 | 27 | 28 | https://fuel.gazebosim.org/1.0/OpenRobotics/models/Ground Plane 29 | 30 | 31 | 32 | 33 | 34 | https://fuel.gazebosim.org/1.0/OpenRobotics/models/Sun 35 | 36 | 37 | 38 | 39 | 0.319654 -0.235002 9.29441 0 1.5138 0.009599 40 | orbit 41 | perspective 42 | 43 | 44 | 45 | 3D View 46 | false 47 | docked 48 | 49 | 50 | ogre2 51 | scene 52 | 0.4 0.4 0.4 53 | 0.8 0.8 0.8 54 | 0.319654 -0.235002 9.29441 0 1.5138 0.009599 55 | 56 | 57 | 58 | 59 | floating 60 | 5 61 | 5 62 | false 63 | 64 | 65 | 66 | 67 | false 68 | 5 69 | 5 70 | floating 71 | false 72 | 73 | 74 | 75 | 76 | false 77 | 5 78 | 5 79 | floating 80 | false 81 | 82 | 83 | 84 | 85 | false 86 | 5 87 | 5 88 | floating 89 | false 90 | 91 | 92 | 93 | 94 | false 95 | 5 96 | 5 97 | floating 98 | false 99 | 100 | 101 | 102 | 103 | false 104 | 5 105 | 5 106 | floating 107 | false 108 | 109 | 110 | 111 | 112 | 113 | false 114 | 5 115 | 5 116 | floating 117 | false 118 | 119 | 120 | 121 | 122 | 123 | false 124 | 5 125 | 5 126 | floating 127 | false 128 | 129 | 130 | 131 | 132 | 133 | 134 | World control 135 | false 136 | false 137 | 72 138 | 1 139 | 140 | floating 141 | 142 | 143 | 144 | 145 | 146 | 147 | true 148 | true 149 | true 150 | true 151 | 152 | 153 | 154 | 155 | 156 | 157 | World stats 158 | false 159 | false 160 | 110 161 | 290 162 | 1 163 | 164 | floating 165 | 166 | 167 | 168 | 169 | 170 | 171 | true 172 | true 173 | true 174 | true 175 | 176 | 177 | 178 | 179 | 180 | false 181 | 0 182 | 0 183 | 250 184 | 50 185 | floating 186 | false 187 | #666666 188 | 189 | 190 | 191 | 192 | 193 | 194 | false 195 | 250 196 | 0 197 | 150 198 | 50 199 | floating 200 | false 201 | #666666 202 | 203 | 204 | 205 | 206 | 207 | 208 | false 209 | 0 210 | 50 211 | 250 212 | 50 213 | floating 214 | false 215 | #777777 216 | 217 | 218 | 219 | 220 | 221 | 222 | false 223 | 250 224 | 50 225 | 50 226 | 50 227 | floating 228 | false 229 | #777777 230 | 231 | 232 | 233 | 234 | 235 | 236 | false 237 | 300 238 | 50 239 | 100 240 | 50 241 | floating 242 | false 243 | #777777 244 | 245 | 246 | 247 | 248 | 249 | 250 | false 251 | docked 252 | 253 | 254 | 255 | 256 | 257 | 258 | false 259 | docked 260 | 261 | 262 | 263 | 264 | 265 | 1000.0 266 | 0.001 267 | 1 268 | 269 | 270 | quick 271 | 150 272 | 0 273 | 1.400000 274 | 1 275 | 276 | 277 | 0.00001 278 | 0.2 279 | 2000.000000 280 | 0.01000 281 | 282 | 283 | 284 | 285 | 286 | 1 287 | 288 | model://turtlebot3_world 289 | 290 | 291 | 292 | 293 | 294 | -------------------------------------------------------------------------------- /turtlebot3_gazebo/models/turtlebot3_common/meshes/waffle_base.dae: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Blender User 6 | Blender 2.83.0 commit date:2020-06-03, commit time:14:38, hash:211b6c29f771 7 | 8 | 2020-06-29T17:22:52 9 | 2020-06-29T17:22:52 10 | 11 | Z_UP 12 | 13 | 14 | 15 | 16 | 17 | 18 | 39.59775 19 | 1.777778 20 | 0.1 21 | 100 22 | 23 | 24 | 25 | 26 | 27 | 0 28 | 0 29 | 10 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 1000 1000 1000 39 | 1 40 | 0 41 | 0.00111109 42 | 43 | 44 | 45 | 46 | 0 47 | 0 48 | 1 49 | 1 50 | 1 51 | 1 52 | 1 53 | 0 54 | 0 55 | 0 56 | 1000 57 | 29.99998 58 | 75 59 | 0.15 60 | 0 61 | 1 62 | 2 63 | 0.04999995 64 | 30.002 65 | 1 66 | 3 67 | 2880 68 | 3 69 | 1 70 | 1 71 | 0.1 72 | 0.1 73 | 1 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 0 0 0 1 85 | 86 | 87 | 0.8 0.8 0.8 1 88 | 89 | 90 | 1.45 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | -0.7789794 -1 -1 -1 -0.7789794 -1 -1 -0.7789794 1 -0.7789794 -1 1 -1 0.7789794 -1 -0.7789794 1 -1 -0.7789794 1 1 -1 0.7789794 1 1 -0.7789794 -1 0.7789794 -1 -1 0.7789794 -1 1 1 -0.7789794 1 0.7789794 1 -1 1 0.7789794 -1 1 0.7789794 1 0.7789794 1 1 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 0 -1 0 1 0 0 0 0 1 -1 0 0 0 1 0 -0.7071068 -0.7071068 0 -0.7071068 0.7071068 0 0.7071068 0.7071068 0 0.7071068 -0.7071068 0 0 0 -1 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 0.625 0.7776276 0.375 0.9723724 0.375 0.7776276 0.625 0.5276276 0.375 0.7223724 0.375 0.5276276 0.6526276 0.75 0.625 0.7223724 0.875 0.5276276 0.625 0.02762752 0.375 0.2223724 0.375 0.02762752 0.625 0.2776276 0.375 0.4723724 0.375 0.2776276 0.625 0.9723724 0.375 1 0.375 0.9723724 0.375 0.2776276 0.625 0.2223724 0.625 0.2776276 0.375 0.5276276 0.625 0.4723724 0.625 0.5276276 0.375 0.7776276 0.625 0.7223724 0.625 0.7776276 0.1526275 0.75 0.125 0.7223724 0.375 0.5276276 0.625 0.7776276 0.625 0.9723724 0.375 0.9723724 0.625 0.5276276 0.625 0.7223724 0.375 0.7223724 0.625 0.7223724 0.625 0.5276276 0.6526276 0.5 0.6526276 0.5 0.8473724 0.5 0.625 0.7223724 0.8473724 0.5 0.875 0.5276276 0.625 0.7223724 0.875 0.5276276 0.875 0.7223724 0.8473724 0.75 0.8473724 0.75 0.6526276 0.75 0.875 0.5276276 0.625 0.02762752 0.625 0.2223724 0.375 0.2223724 0.625 0.2776276 0.625 0.4723724 0.375 0.4723724 0.625 0.9723724 0.625 1 0.375 1 0.375 0.2776276 0.375 0.2223724 0.625 0.2223724 0.375 0.5276276 0.375 0.4723724 0.625 0.4723724 0.375 0.7776276 0.375 0.7223724 0.625 0.7223724 0.125 0.7223724 0.125 0.5276276 0.1526275 0.5 0.1526275 0.5 0.3473724 0.5 0.125 0.7223724 0.3473724 0.5 0.375 0.5276276 0.125 0.7223724 0.375 0.5276276 0.375 0.7223724 0.3473724 0.75 0.3473724 0.75 0.1526275 0.75 0.375 0.5276276 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 |

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

143 |
144 |
145 |
146 | 147 | 148 | 149 | 1 1 1 1 1 -1 1 -1 1 1 -1 -1 -1 1 1 -1 1 -1 -1 -1 1 -1 -1 -1 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 0 0 1 0 -1 0 -1 0 0 0 0 -1 1 0 0 0 1 0 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 0.875 0.5 0.625 0.75 0.625 0.5 0.625 0.75 0.375 1 0.375 0.75 0.625 0 0.375 0.25 0.375 0 0.375 0.5 0.125 0.75 0.125 0.5 0.625 0.5 0.375 0.75 0.375 0.5 0.625 0.25 0.375 0.5 0.375 0.25 0.875 0.5 0.875 0.75 0.625 0.75 0.625 0.75 0.625 1 0.375 1 0.625 0 0.625 0.25 0.375 0.25 0.375 0.5 0.375 0.75 0.125 0.75 0.625 0.5 0.625 0.75 0.375 0.75 0.625 0.25 0.625 0.5 0.375 0.5 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 |

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

185 |
186 |
187 |
188 |
189 | 190 | 191 | 192 | 132.5 0 0 0 0 132.5 0 0 0 0 46 46.12724 0 0 0 1 193 | 194 | 195 | 196 | 0.6859207 -0.3240135 0.6515582 7.358891 0.7276763 0.3054208 -0.6141704 -6.925791 0 0.8953956 0.4452714 4.958309 0 0 0 1 197 | 198 | 199 | 200 | -0.2908646 -0.7711008 0.5663932 4.076245 0.9551712 -0.1998834 0.2183912 1.005454 -0.05518906 0.6045247 0.7946723 5.903862 0 0 0 1 201 | 202 | 203 | 204 | 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 |
--------------------------------------------------------------------------------