├── .gitattributes ├── .github └── workflows │ ├── build-and-test.sh │ └── ci.yml ├── .gitignore ├── LICENSE ├── README.md ├── dolly ├── CHANGELOG.rst ├── CMakeLists.txt └── package.xml ├── dolly_follow ├── CHANGELOG.rst ├── CMakeLists.txt ├── package.xml └── src │ └── dolly_follow.cpp ├── dolly_gazebo ├── CHANGELOG.rst ├── CMakeLists.txt ├── env-hooks │ ├── dolly_gazebo.dsv.in │ └── dolly_gazebo.sh.in ├── launch │ └── dolly.launch.py ├── models │ ├── casual_female │ │ ├── materials │ │ │ └── textures │ │ │ │ ├── brown_eye.png │ │ │ │ ├── casual_female.png │ │ │ │ ├── eyebrow002.png │ │ │ │ ├── eyelashes01.png │ │ │ │ ├── female_casualsuit01_diffuse.png │ │ │ │ ├── female_casualsuit01_normal.png │ │ │ │ ├── female_casualsuit02_diffuse.png │ │ │ │ ├── female_casualsuit02_normal.png │ │ │ │ ├── ponytail01_diffuse.png │ │ │ │ ├── shoes05_diffuse.png │ │ │ │ ├── tongue01_diffuse.png │ │ │ │ └── young_lightskinned_female_diffuse.png │ │ ├── meshes │ │ │ └── casual_female.dae │ │ ├── model.config │ │ ├── model.sdf │ │ └── thumbnails │ │ │ ├── 1.png │ │ │ ├── 2.png │ │ │ ├── 3.png │ │ │ ├── 4.png │ │ │ └── 5.png │ ├── city_terrain │ │ ├── materials │ │ │ └── textures │ │ │ │ ├── city_terrain (original).jpg │ │ │ │ ├── city_terrain.jpg │ │ │ │ └── forest.jpg │ │ ├── model.config │ │ └── model.sdf │ ├── dolly │ │ ├── materials │ │ │ ├── scripts │ │ │ │ └── script.material │ │ │ └── textures │ │ │ │ └── sheep.jpg │ │ ├── model.config │ │ └── model.sdf │ └── ocean │ │ ├── materials │ │ ├── programs │ │ │ └── GLSL │ │ │ │ ├── Waves.frag │ │ │ │ └── Waves.vert │ │ ├── scripts │ │ │ └── ocean.material │ │ └── textures │ │ │ ├── License and source soil_sand_0045_01.txt │ │ │ ├── clouds.jpg │ │ │ ├── clouds_bk.jpg │ │ │ ├── clouds_dn.jpg │ │ │ ├── clouds_fr.jpg │ │ │ ├── clouds_lf.jpg │ │ │ ├── clouds_rt.jpg │ │ │ ├── clouds_up.jpg │ │ │ ├── normals.dds │ │ │ └── soil_sand_0045_01.jpg │ │ ├── mesh-simple.dae │ │ ├── mesh.blend │ │ ├── mesh.dae │ │ ├── mesh_below.dae │ │ ├── model.config │ │ └── model.sdf ├── package.xml ├── rviz │ └── dolly_gazebo.rviz └── worlds │ ├── dolly_city.world │ └── dolly_empty.world ├── dolly_ignition ├── CHANGELOG.rst ├── CMakeLists.txt ├── env-hooks │ ├── dolly_ignition.dsv.in │ └── dolly_ignition.sh.in ├── ign │ └── gui.config ├── launch │ └── dolly.launch.py ├── models │ ├── casual_female │ │ ├── materials │ │ │ └── textures │ │ │ │ ├── brown_eye.png │ │ │ │ ├── casual_female.png │ │ │ │ ├── eyebrow002.png │ │ │ │ ├── eyelashes01.png │ │ │ │ ├── female_casualsuit01_diffuse.png │ │ │ │ ├── female_casualsuit01_normal.png │ │ │ │ ├── female_casualsuit02_diffuse.png │ │ │ │ ├── female_casualsuit02_normal.png │ │ │ │ ├── ponytail01_diffuse.png │ │ │ │ ├── shoes05_diffuse.png │ │ │ │ ├── tongue01_diffuse.png │ │ │ │ └── young_lightskinned_female_diffuse.png │ │ ├── meshes │ │ │ └── casual_female.dae │ │ ├── model.config │ │ ├── model.sdf │ │ └── thumbnails │ │ │ ├── 1.png │ │ │ ├── 2.png │ │ │ ├── 3.png │ │ │ ├── 4.png │ │ │ └── 5.png │ └── dolly_ignition │ │ ├── materials │ │ └── textures │ │ │ ├── cardboard_box.png │ │ │ └── sheep.jpg │ │ ├── meshes │ │ └── cardboard_box.dae │ │ ├── model.config │ │ └── model.sdf ├── package.xml ├── rviz │ └── dolly_ignition.rviz └── worlds │ └── station.sdf ├── dolly_tests ├── CHANGELOG.rst ├── CMakeLists.txt ├── launch │ └── follow_ignition_TEST.launch.py ├── package.xml ├── test │ ├── constants.hh.in │ └── follow_ignition_TEST.cpp └── worlds │ └── empty.sdf └── images ├── dolly.gif └── dolly_ign.gif /.gitattributes: -------------------------------------------------------------------------------- 1 | dolly-gazebo/models/ocean/* linguist-vendored 2 | -------------------------------------------------------------------------------- /.github/workflows/build-and-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | set -x 4 | 5 | # Configuration. 6 | export COLCON_WS=~/ws 7 | export COLCON_WS_SRC=${COLCON_WS}/src 8 | export DEBIAN_FRONTEND=noninteractive 9 | export ROS_PYTHON_VERSION=3 10 | 11 | # For headless rendering 12 | export DISPLAY=:1.0 13 | export MESA_GL_VERSION_OVERRIDE=3.3 14 | 15 | apt update -qq 16 | apt install -qq -y lsb-release wget curl build-essential 17 | 18 | # Tools and dependencies 19 | echo "deb http://packages.ros.org/ros2/ubuntu `lsb_release -cs` main" > /etc/apt/sources.list.d/ros2-latest.list 20 | curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add - 21 | apt-get update -qq 22 | apt-get install -y $IGN_DEPS \ 23 | python3-colcon-common-extensions \ 24 | python3-rosdep 25 | 26 | rosdep init 27 | rosdep update 28 | 29 | # Create workspace and copy Dolly code there 30 | mkdir -p $COLCON_WS_SRC 31 | cp -r $GITHUB_WORKSPACE $COLCON_WS_SRC 32 | 33 | # Install ROS dependencies 34 | rosdep install --from-paths $COLCON_WS_SRC -i -y -r --rosdistro $ROS_DISTRO 35 | 36 | # Build 37 | source /opt/ros/$ROS_DISTRO/setup.bash 38 | cd $COLCON_WS 39 | colcon build --event-handlers console_direct+ --packages-up-to dolly 40 | 41 | # Test 42 | colcon test --event-handlers console_direct+ --packages-select-regex dolly 43 | colcon test-result 44 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: Build and test 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | build_and_test: 7 | name: Build and test 8 | runs-on: ubuntu-latest 9 | strategy: 10 | matrix: 11 | include: 12 | - docker-image: "ubuntu:20.04" 13 | ignition-version: "fortress" 14 | ros-distro: "rolling" 15 | container: 16 | image: ${{ matrix.docker-image }} 17 | steps: 18 | - name: Checkout dolly 19 | uses: actions/checkout@v2 20 | with: 21 | path: main 22 | # Compiling ros_ign from source because Rolling isn't using Fortress yet 23 | - name: Checkout ros_ign 24 | uses: actions/checkout@v2 25 | with: 26 | repository: ignitionrobotics/ros_ign 27 | ref: ros2 28 | path: ros_ign 29 | - name: Build and test 30 | run: main/.github/workflows/build-and-test.sh 31 | env: 32 | DOCKER_IMAGE: ${{ matrix.docker-image }} 33 | IGNITION_VERSION: ${{ matrix.ignition-version }} 34 | ROS_DISTRO: ${{ matrix.ros-distro }} 35 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__/ 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build and test](https://github.com/chapulina/dolly/actions/workflows/ci.yml/badge.svg)](https://github.com/chapulina/dolly/actions/workflows/ci.yml) 2 | 3 | # Dolly the robot 4 | 5 | _It's a sheep, it's a dolly, it's a following robot. Born to be cloned._ 6 | 7 | Packages for launching Dolly demo, which uses ROS 2 and either 8 | [Gazebo](https://gazebosim.org) or [Ignition](https://ignitionrobotics.org). 9 | 10 | Gazebo | Ignition 11 | -- | -- 12 | ![Dolly Gazebo](images/dolly.gif) | ![Dolly Ignition](images/dolly_ign.gif) 13 | 14 | ## Versions 15 | 16 | Dolly is known to work on the following systems. 17 | 18 | Branch | ROS | Gazebo-classic | Ignition | OS 19 | -- | -- | -- | -- | -- 20 | [crystal](https://github.com/chapulina/dolly/tree/crystal) | Crystal | Gazebo 9 | :x: | Ubuntu Bionic 21 | [dashing](https://github.com/chapulina/dolly/tree/dashing) | Dashing | Gazebo 9 | :x: | Ubuntu Bionic, macOS Sierra 22 | [eloquent](https://github.com/chapulina/dolly/tree/eloquent) | Eloquent | Gazebo 9, Gazebo 11 | Citadel | Ubuntu Bionic 23 | [foxy](https://github.com/chapulina/dolly/tree/foxy) | Foxy | Gazebo 11 | Citadel | Ubuntu Focal 24 | [galactic](https://github.com/chapulina/dolly/tree/galactic) | Galactic, Rolling | Gazebo 11 | Edifice, Fortress | Ubuntu Focal 25 | 26 | ## Packages 27 | 28 | This repository contains the following packages: 29 | 30 | * `dolly`: Metapackage which provides all other packages. 31 | * `dolly_follow`: Provides node with follow logic. 32 | * `dolly_gazebo`: Robot model, simulation world and launch scripts for Gazebo-classic. 33 | * `dolly_ignition`: Robot model, simulation world and launch scripts for Ignition. 34 | * `dolly_tests`: Simulation-based automated tests 35 | 36 | ## Install 37 | 38 | It's encouraged that you build Dolly from source, to learn about how to 39 | develop your own packages. But in case you just want to give it a quick 40 | try, there are binaries available too. 41 | 42 | ### From binaries 43 | 44 | Dolly has been released into several ROS distros. These are the currently 45 | supported ones: 46 | 47 | | ROS | Packages | 48 | |----------|--------------------------------| 49 | | Foxy | `ros-foxy-dolly` | 50 | | | `ros-foxy-dolly-follow` | 51 | | | `ros-foxy-dolly-gazebo` | 52 | | | `ros-foxy-dolly-ignition ` | 53 | | Galactic | `ros-galactic-dolly` | 54 | | | `ros-galactic-dolly-follow` | 55 | | | `ros-galactic-dolly-gazebo` | 56 | | | `ros-galactic-dolly-ignition ` | 57 | | Rolling | `ros-rolling-dolly` | 58 | | | `ros-rolling-dolly-follow` | 59 | | | `ros-rolling-dolly-gazebo` | 60 | | | `ros-rolling-dolly-ignition ` | 61 | 62 | ### From source 63 | 64 | Install instructions for Ubuntu Bionic. 65 | 66 | 1. Install at least one simulator, 67 | [Gazebo](http://gazebosim.org/tutorials?cat=install) or 68 | [Ignition](https://ignitionrobotics.org/docs/edifice/install) 69 | 70 | 1. Install the appropriate ROS 2 version as instructed 71 | [here](https://index.ros.org/doc/ros2/Installation/Linux-Install-Debians/). 72 | 73 | 1. Clone Dolly, choose the branch according to your ROS distro: 74 | 75 | mkdir -p ~/ws/src 76 | cd ~/ws/src 77 | git clone https://github.com/chapulina/dolly -b 78 | 79 | 1. Install dependencies: 80 | 81 | cd ~/ws 82 | rosdep install --from-paths src --ignore-src -r -y 83 | 84 | 1. Build and install: 85 | 86 | cd ~/ws 87 | colcon build 88 | 89 | ## Run 90 | 91 | ### Gazebo-classic 92 | 93 | If you had Gazebo installed when compiling Dolly's packages, Gazebo support 94 | should be enabled. 95 | 96 | 1. Setup environment variables (the order is important): 97 | 98 | . /usr/share/gazebo/setup.sh 99 | . ~/ws/install/setup.bash 100 | 101 | > *Tip*: If the command `ros2 pkg list | grep dolly_gazebo` comes up empty 102 | after setting up the environment, Gazebo support wasn't correctly setup. 103 | 104 | 1. Launch Dolly in a city (this will take some time to download models): 105 | 106 | ros2 launch dolly_gazebo dolly.launch.py world:=dolly_city.world 107 | 108 | 1. Launch Dolly in an empty world: 109 | 110 | ros2 launch dolly_gazebo dolly.launch.py world:=dolly_empty.world 111 | 112 | ### Ignition 113 | 114 | 1. Setup environment variables: 115 | 116 | . ~/ws/install/setup.bash 117 | 118 | > *Tip*: If the command `ros2 pkg list | grep dolly_ignition` comes up empty 119 | after setting up the environment, Ignition support wasn't correctly setup. 120 | 121 | 1. Launch Dolly in a station: 122 | 123 | ros2 launch dolly_ignition dolly.launch.py 124 | 125 | ## Featured 126 | 127 | * QConSF 2018 128 | * 🎥 [Open Source Robotics: Hands on with Gazebo and ROS 2](https://www.youtube.com/watch?v=Gwbk6Qf_TqY) 129 | * ⌨️ [Source code](https://github.com/chapulina/simslides/tree/QConSF_Nov2018) 130 | * InfoQ 131 | * 📰 [Open Source Robotics: Getting Started with Gazebo and ROS 2](https://www.infoq.com/articles/ros-2-gazebo-tutorial/) 132 | * The Construct's ROS tutorials 133 | * 🎥 [ROS Developers LIVE Class #70: How to Control a Robot with ROS2 (Dashing)](https://www.youtube.com/watch?v=qB4SaP3TZog) 134 | * 🎥 [ROS Developers Live Class n.71: How to visualize sensor data in ROS2](https://www.youtube.com/watch?v=s3fBGSpmER0) 135 | * 🎥 [Exploring ROS2 with wheeled robot - #1 - Launch ROS2 Simulation](https://www.youtube.com/watch?v=T4iRJqESQAk) 136 | * 🎥 [Exploring ROS2 with wheeled robot - #2 - How to subscribe to ROS2 laser scan topic](https://www.youtube.com/watch?v=2-qO79V_Cik) 137 | * 🎥 [Exploring ROS2 using wheeled Robot - #3 - Moving the Robot](https://www.youtube.com/watch?v=SinvFQ9Vobg) 138 | * ROSConJP 2019 139 | * 🎥 [これからのGazebo: ROSのシミュレーションの次世代](https://vimeo.com/370247782) 140 | * ⌨️ [Source code](https://github.com/chapulina/rosconjp_2019) 141 | * ROS Developers Day 2020 142 | * 🎥 [Hands-on with Ignition and ROS2 | ROSDevDay2020 Trailer #1](https://www.youtube.com/watch?v=VO0ZUrr7ib8) 143 | * 🎥 [Hands-on with Ignition and ROS2](https://youtu.be/nLp4uzN5NMs?t=622) 144 | -------------------------------------------------------------------------------- /dolly/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package dolly 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 0.4.0 (2021-10-10) 6 | ------------------ 7 | 8 | 0.3.0 (2020-08-09) 9 | ------------------ 10 | * Ignition support (`#13 `_) 11 | * Contributors: Louise Poubel 12 | 13 | 0.2.0 (2020-01-06) 14 | ------------------ 15 | 16 | 0.1.1 (2020-01-06) 17 | ------------------ 18 | * First Dolly release 19 | * Contributors: chapulina 20 | -------------------------------------------------------------------------------- /dolly/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | project(dolly) 3 | find_package(ament_cmake REQUIRED) 4 | 5 | if(BUILD_TESTING) 6 | find_package(ament_lint_auto REQUIRED) 7 | ament_lint_auto_find_test_dependencies() 8 | endif() 9 | 10 | ament_package() 11 | -------------------------------------------------------------------------------- /dolly/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | dolly 7 | 0.4.0 8 | Meta-package for Dolly, the robot sheep. 9 | Louise Poubel 10 | Apache 2.0 11 | 12 | ament_cmake 13 | 14 | dolly_follow 15 | dolly_gazebo 16 | dolly_ignition 17 | dolly_tests 18 | 19 | ament_lint_auto 20 | ament_lint_common 21 | 22 | 23 | ament_cmake 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /dolly_follow/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package dolly_follow 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 0.4.0 (2021-10-10) 6 | ------------------ 7 | * Galactic + Edifice support 8 | * Contributors: Louise Poubel 9 | 10 | 0.3.0 (2020-08-09) 11 | ------------------ 12 | 13 | 0.2.0 (2020-01-06) 14 | ------------------ 15 | 16 | 0.1.1 (2020-01-06) 17 | ------------------ 18 | * First Dolly release 19 | * Contributors: Karsten Knese, chapulina 20 | -------------------------------------------------------------------------------- /dolly_follow/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | 3 | project(dolly_follow) 4 | 5 | # Default to C++14 6 | if(NOT CMAKE_CXX_STANDARD) 7 | set(CMAKE_CXX_STANDARD 14) 8 | endif() 9 | if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") 10 | add_compile_options(-Wall -Wextra -Wpedantic) 11 | endif() 12 | 13 | find_package(ament_cmake REQUIRED) 14 | find_package(geometry_msgs REQUIRED) 15 | find_package(rclcpp REQUIRED) 16 | find_package(sensor_msgs REQUIRED) 17 | 18 | set(target "dolly_follow") 19 | 20 | add_executable(${target} src/${target}.cpp) 21 | 22 | ament_target_dependencies(${target} 23 | "rclcpp" 24 | "geometry_msgs" 25 | "sensor_msgs") 26 | 27 | if(BUILD_TESTING) 28 | find_package(ament_lint_auto REQUIRED) 29 | ament_lint_auto_find_test_dependencies() 30 | endif() 31 | 32 | install(TARGETS ${target} 33 | DESTINATION lib/${PROJECT_NAME}) 34 | 35 | ament_package() 36 | -------------------------------------------------------------------------------- /dolly_follow/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | dolly_follow 5 | 0.4.0 6 | 7 | Follow node for Dolly, the robot sheep. 8 | 9 | Louise Poubel 10 | Apache 2.0 11 | 12 | ament_cmake 13 | 14 | geometry_msgs 15 | rclcpp 16 | sensor_msgs 17 | 18 | geometry_msgs 19 | rclcpp 20 | sensor_msgs 21 | 22 | ament_lint_auto 23 | ament_lint_common 24 | 25 | 26 | ament_cmake 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /dolly_follow/src/dolly_follow.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Louise Poubel. 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 | #include 16 | #include 17 | #include 18 | 19 | #include 20 | #include 21 | 22 | class Follow : public rclcpp::Node 23 | { 24 | public: 25 | /// \brief Follow node, which subscribes to laser scan messages and publishes 26 | /// velocity commands. 27 | Follow() 28 | : Node("follow") 29 | { 30 | // Subscribe to sensor messages 31 | auto sensor_qos = rclcpp::QoS(rclcpp::SensorDataQoS()); 32 | laser_sub_ = this->create_subscription( 33 | "laser_scan", sensor_qos, 34 | std::bind(&Follow::OnSensorMsg, this, std::placeholders::_1)); 35 | 36 | // Advertise velocity commands 37 | auto default_qos = rclcpp::QoS(rclcpp::SystemDefaultsQoS()); 38 | cmd_pub_ = this->create_publisher("cmd_vel", default_qos); 39 | } 40 | 41 | private: 42 | /// \brief Callback for sensor message subscriber 43 | /// \param[in] _msg Laser scan message 44 | void OnSensorMsg(const sensor_msgs::msg::LaserScan::SharedPtr _msg) 45 | { 46 | // Find closest hit 47 | float min_range = _msg->range_max + 1; 48 | int idx = -1; 49 | for (auto i = 0u; i < _msg->ranges.size(); ++i) { 50 | auto range = _msg->ranges[i]; 51 | if (range > _msg->range_min && range < _msg->range_max && range < min_range) { 52 | min_range = range; 53 | idx = i; 54 | } 55 | } 56 | 57 | // Calculate desired yaw change 58 | double turn = _msg->angle_min + _msg->angle_increment * idx; 59 | 60 | // Populate command message, all weights have been calculated by trial and error 61 | auto cmd_msg = std::make_unique(); 62 | 63 | // Bad readings, stop 64 | if (idx < 0) { 65 | cmd_msg->linear.x = 0; 66 | cmd_msg->angular.z = 0; 67 | } else if (min_range <= min_dist_) { 68 | // Too close, just rotate 69 | cmd_msg->linear.x = 0; 70 | cmd_msg->angular.z = turn * angular_k_; 71 | } else { 72 | cmd_msg->linear.x = linear_k_ / abs(turn); 73 | cmd_msg->angular.z = turn * angular_k_; 74 | } 75 | 76 | cmd_pub_->publish(std::move(cmd_msg)); 77 | } 78 | 79 | /// \brief Laser messages subscriber 80 | rclcpp::Subscription::SharedPtr laser_sub_; 81 | 82 | /// \brief Velocity command publisher 83 | rclcpp::Publisher::SharedPtr cmd_pub_; 84 | 85 | /// \brief Minimum allowed distance from target 86 | double min_dist_ = 1.0; 87 | 88 | /// \brief Scale linear velocity, chosen by trial and error 89 | double linear_k_ = 0.02; 90 | 91 | /// \brief Scale angular velocity, chosen by trial and error 92 | double angular_k_ = 0.08; 93 | }; 94 | 95 | int main(int argc, char * argv[]) 96 | { 97 | // Forward command line arguments to ROS 98 | rclcpp::init(argc, argv); 99 | 100 | // Create a node 101 | auto node = std::make_shared(); 102 | 103 | // Run node until it's exited 104 | rclcpp::spin(node); 105 | 106 | // Clean up 107 | rclcpp::shutdown(); 108 | return 0; 109 | } 110 | -------------------------------------------------------------------------------- /dolly_gazebo/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package dolly_gazebo 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 0.4.0 (2021-10-10) 6 | ------------------ 7 | * Galactic + Edifice support 8 | * Contributors: Louise Poubel 9 | 10 | 0.3.0 (2020-08-09) 11 | ------------------ 12 | * More detailed collision for CPU lidar (`#19 `_) 13 | * Foxy support (`#18 `_) 14 | * Ignition support (`#13 `_) 15 | * Use env hooks to set environment variables (`#12 `_) 16 | also dsv example - only used from eloquent 17 | * Changed gpu_ray to ray in the dolly model, to make laser_scan work on the CPU instead of a GPU. (`#10 `_) 18 | * Contributors: FrankHx9, Louise Poubel 19 | 20 | 0.2.0 (2020-01-06) 21 | ------------------ 22 | * Port to Eloquent (`#9 `_) 23 | * Port to Eloquent 24 | * Update README 25 | Signed-off-by: Louise Poubel 26 | * Contributors: chapulina 27 | 28 | 0.1.1 (2020-01-06) 29 | ------------------ 30 | * First Dolly release 31 | * Contributors: chapulina 32 | -------------------------------------------------------------------------------- /dolly_gazebo/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | 3 | project(dolly_gazebo) 4 | 5 | # Skip if Gazebo not present 6 | find_package(gazebo QUIET) 7 | if(NOT gazebo_FOUND) 8 | message(WARNING "Gazebo not found, proceeding without that simulator.") 9 | return() 10 | endif() 11 | 12 | find_package(ament_cmake REQUIRED) 13 | 14 | if(BUILD_TESTING) 15 | find_package(ament_lint_auto REQUIRED) 16 | ament_lint_auto_find_test_dependencies() 17 | endif() 18 | 19 | install( 20 | DIRECTORY 21 | launch 22 | models 23 | rviz 24 | worlds 25 | DESTINATION 26 | share/${PROJECT_NAME}/ 27 | ) 28 | 29 | ament_environment_hooks("${CMAKE_CURRENT_SOURCE_DIR}/env-hooks/${PROJECT_NAME}.sh.in") 30 | ament_environment_hooks("${CMAKE_CURRENT_SOURCE_DIR}/env-hooks/${PROJECT_NAME}.dsv.in") 31 | 32 | ament_package() 33 | -------------------------------------------------------------------------------- /dolly_gazebo/env-hooks/dolly_gazebo.dsv.in: -------------------------------------------------------------------------------- 1 | prepend-non-duplicate;GAZEBO_MODEL_PATH;share/@PROJECT_NAME@/models 2 | prepend-non-duplicate;GAZEBO_RESOURCE_PATH;share/@PROJECT_NAME@/worlds 3 | -------------------------------------------------------------------------------- /dolly_gazebo/env-hooks/dolly_gazebo.sh.in: -------------------------------------------------------------------------------- 1 | # generated from dolly_gazebo/env-hooks/dolly_gazebo.sh.in 2 | 3 | ament_prepend_unique_value GAZEBO_MODEL_PATH "$AMENT_CURRENT_PREFIX/share/@PROJECT_NAME@/models" 4 | ament_prepend_unique_value GAZEBO_RESOURCE_PATH "$AMENT_CURRENT_PREFIX/share/@PROJECT_NAME@/worlds" 5 | -------------------------------------------------------------------------------- /dolly_gazebo/launch/dolly.launch.py: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Louise Poubel 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 | """Launch Gazebo with a world that has Dolly, as well as the follow node.""" 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.conditions import IfCondition 24 | from launch.launch_description_sources import PythonLaunchDescriptionSource 25 | from launch.substitutions import LaunchConfiguration 26 | from launch_ros.actions import Node 27 | 28 | 29 | def generate_launch_description(): 30 | 31 | pkg_gazebo_ros = get_package_share_directory('gazebo_ros') 32 | pkg_dolly_gazebo = get_package_share_directory('dolly_gazebo') 33 | 34 | # Gazebo launch 35 | gazebo = IncludeLaunchDescription( 36 | PythonLaunchDescriptionSource( 37 | os.path.join(pkg_gazebo_ros, 'launch', 'gazebo.launch.py'), 38 | ) 39 | ) 40 | 41 | # Follow node 42 | follow = Node( 43 | package='dolly_follow', 44 | executable='dolly_follow', 45 | output='screen', 46 | remappings=[ 47 | ('cmd_vel', '/dolly/cmd_vel'), 48 | ('laser_scan', '/dolly/laser_scan') 49 | ] 50 | ) 51 | 52 | # RViz 53 | rviz = Node( 54 | package='rviz2', 55 | executable='rviz2', 56 | arguments=['-d', os.path.join(pkg_dolly_gazebo, 'rviz', 'dolly_gazebo.rviz')], 57 | condition=IfCondition(LaunchConfiguration('rviz')) 58 | ) 59 | 60 | return LaunchDescription([ 61 | DeclareLaunchArgument( 62 | 'world', 63 | default_value=[os.path.join(pkg_dolly_gazebo, 'worlds', 'dolly_empty.world'), ''], 64 | description='SDF world file'), 65 | DeclareLaunchArgument('rviz', default_value='true', 66 | description='Open RViz.'), 67 | gazebo, 68 | follow, 69 | rviz 70 | ]) 71 | -------------------------------------------------------------------------------- /dolly_gazebo/models/casual_female/materials/textures/brown_eye.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_gazebo/models/casual_female/materials/textures/brown_eye.png -------------------------------------------------------------------------------- /dolly_gazebo/models/casual_female/materials/textures/casual_female.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_gazebo/models/casual_female/materials/textures/casual_female.png -------------------------------------------------------------------------------- /dolly_gazebo/models/casual_female/materials/textures/eyebrow002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_gazebo/models/casual_female/materials/textures/eyebrow002.png -------------------------------------------------------------------------------- /dolly_gazebo/models/casual_female/materials/textures/eyelashes01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_gazebo/models/casual_female/materials/textures/eyelashes01.png -------------------------------------------------------------------------------- /dolly_gazebo/models/casual_female/materials/textures/female_casualsuit01_diffuse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_gazebo/models/casual_female/materials/textures/female_casualsuit01_diffuse.png -------------------------------------------------------------------------------- /dolly_gazebo/models/casual_female/materials/textures/female_casualsuit01_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_gazebo/models/casual_female/materials/textures/female_casualsuit01_normal.png -------------------------------------------------------------------------------- /dolly_gazebo/models/casual_female/materials/textures/female_casualsuit02_diffuse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_gazebo/models/casual_female/materials/textures/female_casualsuit02_diffuse.png -------------------------------------------------------------------------------- /dolly_gazebo/models/casual_female/materials/textures/female_casualsuit02_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_gazebo/models/casual_female/materials/textures/female_casualsuit02_normal.png -------------------------------------------------------------------------------- /dolly_gazebo/models/casual_female/materials/textures/ponytail01_diffuse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_gazebo/models/casual_female/materials/textures/ponytail01_diffuse.png -------------------------------------------------------------------------------- /dolly_gazebo/models/casual_female/materials/textures/shoes05_diffuse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_gazebo/models/casual_female/materials/textures/shoes05_diffuse.png -------------------------------------------------------------------------------- /dolly_gazebo/models/casual_female/materials/textures/tongue01_diffuse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_gazebo/models/casual_female/materials/textures/tongue01_diffuse.png -------------------------------------------------------------------------------- /dolly_gazebo/models/casual_female/materials/textures/young_lightskinned_female_diffuse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_gazebo/models/casual_female/materials/textures/young_lightskinned_female_diffuse.png -------------------------------------------------------------------------------- /dolly_gazebo/models/casual_female/model.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | Casual Female 4 | 1.0 5 | model.sdf 6 | 7 | 8 | Rohit Salem 9 | rohitsalem@gmail.com 10 | 11 | 12 | 13 | A standing person-Casual Female. Model created with Makehuman (http://www.makehuman.org/) 14 | 15 | 16 | -------------------------------------------------------------------------------- /dolly_gazebo/models/casual_female/model.sdf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | 6 | 7 | 0 0 0.02 0.04 0 0 8 | 9 | 10 | model://casual_female/meshes/casual_female.dae 11 | 12 | 13 | 14 | 15 | 0 0 0.02 0.04 0 0 16 | 17 | 18 | model://casual_female/meshes/casual_female.dae 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /dolly_gazebo/models/casual_female/thumbnails/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_gazebo/models/casual_female/thumbnails/1.png -------------------------------------------------------------------------------- /dolly_gazebo/models/casual_female/thumbnails/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_gazebo/models/casual_female/thumbnails/2.png -------------------------------------------------------------------------------- /dolly_gazebo/models/casual_female/thumbnails/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_gazebo/models/casual_female/thumbnails/3.png -------------------------------------------------------------------------------- /dolly_gazebo/models/casual_female/thumbnails/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_gazebo/models/casual_female/thumbnails/4.png -------------------------------------------------------------------------------- /dolly_gazebo/models/casual_female/thumbnails/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_gazebo/models/casual_female/thumbnails/5.png -------------------------------------------------------------------------------- /dolly_gazebo/models/city_terrain/materials/textures/city_terrain (original).jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_gazebo/models/city_terrain/materials/textures/city_terrain (original).jpg -------------------------------------------------------------------------------- /dolly_gazebo/models/city_terrain/materials/textures/city_terrain.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_gazebo/models/city_terrain/materials/textures/city_terrain.jpg -------------------------------------------------------------------------------- /dolly_gazebo/models/city_terrain/materials/textures/forest.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_gazebo/models/city_terrain/materials/textures/forest.jpg -------------------------------------------------------------------------------- /dolly_gazebo/models/city_terrain/model.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | City terrain 5 | 1.0 6 | model.sdf 7 | 8 | 9 | Louise Poubel 10 | louise@osrfoundation.org 11 | 12 | 13 | 14 | Terrain for a simple city 15 | 16 | 17 | -------------------------------------------------------------------------------- /dolly_gazebo/models/city_terrain/model.sdf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | 6 | 0 0 -5 0 0 0 7 | 8 | 9 | 10 | 11 | 0 0 1 12 | 500 500 13 | 14 | 15 | 16 | 17 | 18 | 1e+06 19 | 100 20 | 1 21 | 0 22 | 23 | 24 | 25 | 26 | 100 27 | 50 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | false 38 | 39 | 40 | model://ocean/materials/textures/soil_sand_0045_01.jpg 41 | file://media/materials/textures/flat_normal.png 42 | 10 43 | 44 | 45 | 46 | 0 47 | 1.5 48 | 49 | 50 | 51 | model://ocean/materials/textures/soil_sand_0045_01.jpg 52 | file://media/materials/textures/flat_normal.png 53 | 10 54 | 55 | 56 | 57 | 2.5 58 | 5 59 | 60 | 61 | 62 | model://city_terrain/materials/textures/forest.jpg 63 | file://media/materials/textures/flat_normal.png 64 | 10 65 | 66 | 67 | model://city_terrain/materials/textures/city_terrain.jpg 68 | 500 500 75 69 | 40 -20 -5 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /dolly_gazebo/models/dolly/materials/scripts/script.material: -------------------------------------------------------------------------------- 1 | material Dolly/fur 2 | { 3 | receive_shadows off 4 | technique 5 | { 6 | pass 7 | { 8 | texture_unit 9 | { 10 | texture sheep.jpg 11 | filtering anistropic 12 | max_anisotropy 16 13 | } 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /dolly_gazebo/models/dolly/materials/textures/sheep.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_gazebo/models/dolly/materials/textures/sheep.jpg -------------------------------------------------------------------------------- /dolly_gazebo/models/dolly/model.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Dolly 5 | 1.0 6 | model.sdf 7 | 8 | 9 | Louise Poubel 10 | louise@openrobotics.org 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /dolly_gazebo/models/dolly/model.sdf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0 0 0.225 0 -0 0 5 | 6 | 7 | 8 | 1.0 9 | 10 | 0.0227 11 | 0 12 | 0 13 | 0.0852 14 | 0 15 | 0.1041 16 | 17 | 18 | 19 | 20 | 21 | 1.0 0.5 0.15 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 0 0 0.08 0 0 0.24 34 | 35 | 36 | model://cardboard_box/meshes/cardboard_box.dae 37 | 1.25931896 1.007455168 0.755591376 38 | 39 | 40 | 41 | 42 | 0.5 0 0 0 0 0 43 | 44 | 45 | 46 | 200 47 | 1.0 48 | -1.0 49 | 1.0 50 | 51 | 52 | 53 | 0.05 54 | 10.0 55 | 56 | 57 | true 58 | true 59 | 100.0 60 | 61 | 62 | /dolly 63 | ~/out:=laser_scan 64 | 65 | sensor_msgs/LaserScan 66 | 67 | 68 | 69 | 70 | -0.3 0 -0.125 0 0 0 71 | 72 | 0.0415553 73 | 74 | 7.97741e-05 75 | 0 76 | 0 77 | 7.97741e-05 78 | 0 79 | 7.97741e-05 80 | 81 | 82 | 83 | 84 | 85 | 0.1 86 | 87 | 88 | 89 | 0.5 0.5 0.5 1 90 | 0 0 0 1 91 | 1 1 1 1 92 | 0 0 0 1 93 | 94 | 95 | 96 | 97 | 98 | 0.1 99 | 100 | 101 | 102 | 103 | 104 | 1 105 | 1 106 | 0 107 | 0 108 | 109 | 110 | 111 | 112 | 0 113 | 0.2 114 | 1e+13 115 | 1 116 | 0.01 117 | 0 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 0.3 0.3 -0.075 -1.5707 0 0 126 | 127 | 0.5 128 | 129 | 0.0029 130 | 0 131 | 0 132 | 0.0029 133 | 0 134 | 0.0056 135 | 136 | 137 | 138 | 139 | 140 | 0.15 141 | 0.05 142 | 143 | 144 | 145 | 0.5 0.5 0.5 1 146 | 0 0 0 1 147 | 1 1 1 1 148 | 0 0 0 1 149 | 150 | 151 | 152 | 153 | 154 | 0.15 155 | 156 | 157 | 158 | 159 | 160 | 1 161 | 1 162 | 0 163 | 0 164 | 165 | 166 | 167 | 168 | 0 169 | 0.2 170 | 1e+13 171 | 1 172 | 0.01 173 | 0.01 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 0.3 -0.3 -0.075 -1.5707 0 0 182 | 183 | 0.5 184 | 185 | 0.0029 186 | 0 187 | 0 188 | 0.0029 189 | 0 190 | 0.0056 191 | 192 | 193 | 194 | 195 | 196 | 0.15 197 | 0.05 198 | 199 | 200 | 201 | 0.5 0.5 0.5 1 202 | 0 0 0 1 203 | 1 1 1 1 204 | 0 0 0 1 205 | 206 | 207 | 208 | 209 | 210 | 0.15 211 | 212 | 213 | 214 | 215 | 216 | 1 217 | 1 218 | 0 219 | 0 220 | 221 | 222 | 223 | 224 | 0 225 | 0.2 226 | 1e+13 227 | 1 228 | 0.01 229 | 0.01 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | -0.52 0 0 -1.6 0 0 238 | 239 | 0.0254232 240 | 241 | 1.528e-05 242 | 0 243 | 0 244 | 1.528e-05 245 | 0 246 | 3.45e-06 247 | 248 | 0 0 -0.04 0 -0 0 249 | 250 | 251 | 252 | 253 | 0.016468 254 | 0.08 255 | 256 | 257 | 258 | 263 | 264 | 265 | 266 | 267 | 268 | chassis 269 | left_wheel 270 | 271 | 0 0 1 272 | 273 | -1.79769e+308 274 | 1.79769e+308 275 | 276 | 277 | 278 | 279 | 280 | chassis 281 | right_wheel 282 | 283 | 0 0 1 284 | 285 | -1.79769e+308 286 | 1.79769e+308 287 | 288 | 289 | 290 | 291 | 292 | chassis 293 | caster 294 | 295 | 296 | 297 | chassis 298 | tail 299 | 0 0 0.04 0 -0 0 300 | 301 | 1 0 0 302 | 0 303 | 304 | -1.79769e+308 305 | 1.79769e+308 306 | -1 307 | -1 308 | 309 | 310 | 0 311 | 0 312 | 0 313 | 0 314 | 315 | 316 | 317 | 318 | 319 | 0 320 | 0.2 321 | 322 | 323 | 0 324 | 0.2 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | /dolly 334 | 335 | 336 | 337 | left_wheel_joint 338 | right_wheel_joint 339 | 340 | 341 | 1.25 342 | 0.3 343 | 344 | 345 | 20 346 | 1.0 347 | 348 | 349 | true 350 | true 351 | 352 | odom_demo 353 | chassis 354 | 355 | 356 | 357 | 358 | 359 | -------------------------------------------------------------------------------- /dolly_gazebo/models/ocean/materials/programs/GLSL/Waves.frag: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016 The UUV Simulator Authors. 2 | // All rights reserved. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | // Input parameters 17 | uniform sampler2D bumpMap; 18 | uniform samplerCube cubeMap; 19 | uniform vec4 deepColor; 20 | uniform vec4 shallowColor; 21 | uniform float fresnelPower; 22 | uniform float hdrMultiplier; 23 | 24 | // Input computed in vertex shader 25 | varying mat3 rotMatrix; 26 | varying vec3 eyeVec; 27 | varying vec2 bumpCoord; 28 | 29 | void main(void) 30 | { 31 | // Apply bump mapping to normal vector to make waves look more detailed: 32 | vec4 bump = texture2D(bumpMap, bumpCoord)*2.0 - 1.0; 33 | vec3 N = normalize(rotMatrix * bump.xyz); 34 | 35 | // Reflected ray: 36 | vec3 E = normalize(eyeVec); 37 | vec3 R = reflect(E, N); 38 | // Gazebo requires rotated cube map lookup. 39 | R = vec3(R.x, R.z, R.y); 40 | 41 | // Get environment color of reflected ray: 42 | vec4 envColor = textureCube(cubeMap, R, 0.0); 43 | 44 | // Cheap hdr effect: 45 | envColor.rgb *= (envColor.r+envColor.g+envColor.b)*hdrMultiplier; 46 | 47 | // Compute refraction ratio (Fresnel): 48 | float facing = 1.0 - dot(-E, N); 49 | float refractionRatio = clamp(pow(facing, fresnelPower), 0.0, 1.0); 50 | 51 | // Refracted ray only considers deep and shallow water colors: 52 | vec4 waterColor = mix(shallowColor, deepColor, facing); 53 | 54 | // Perform linear interpolation between reflection and refraction. 55 | vec4 color = mix(waterColor, envColor, refractionRatio); 56 | gl_FragColor = vec4(color.xyz, 0.9); 57 | } 58 | -------------------------------------------------------------------------------- /dolly_gazebo/models/ocean/materials/programs/GLSL/Waves.vert: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016 The UUV Simulator Authors. 2 | // All rights reserved. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License.s 15 | 16 | // Input parameters 17 | uniform vec3 eyePos; 18 | uniform float rescale; 19 | uniform vec2 bumpScale; 20 | uniform vec2 bumpSpeed; 21 | uniform float time; 22 | uniform float frequency; 23 | uniform float amplitude; 24 | uniform float steepness; 25 | 26 | // Output variables 27 | varying mat3 rotMatrix; 28 | varying vec3 eyeVec; 29 | varying vec2 bumpCoord; 30 | 31 | // Compute linear combination of Gerstner waves as described in 32 | // GPU Gems, chapter 01: "Effective Water Simulation from Physical Models" 33 | // http://http.developer.nvidia.com/GPUGems/gpugems_ch01.html 34 | 35 | // Information regarding a single wave 36 | struct WaveParameters { 37 | float w; // frequency 38 | float a; // amplitude 39 | float phi; // phase constant of speed 40 | vec2 d; // horizontal direction of wave 41 | float q; // steepness for Gerstner wave (q=0: rolling sine waves) 42 | }; 43 | 44 | void main(void) 45 | { 46 | // Use combination of three waves. Values here are chosen rather arbitrarily. 47 | // Other parameters might lead to better-looking waves. 48 | 49 | #define N_WAVES 3 50 | WaveParameters waves[N_WAVES]; 51 | waves[0] = WaveParameters(frequency, 0.6*amplitude, 0.5, vec2(-1, 0), steepness); 52 | waves[1] = WaveParameters(3.2*frequency, 0.4*amplitude, 1.7, vec2(-0.7, 0.7), 1.5*steepness); 53 | waves[2] = WaveParameters(1.8*frequency, 0.3*amplitude, 1.0, vec2(0.7, 0.7), 0.8*steepness); 54 | 55 | vec4 P = gl_Vertex; 56 | 57 | // Iteratively compute binormal, tangent, and normal vectors: 58 | vec3 B = vec3(1.0, 0.0, 0.0); 59 | vec3 T = vec3(0.0, 1.0, 0.0); 60 | vec3 N = vec3(0.0, 0.0, 1.0); 61 | 62 | // Wave synthesis using linear combination of Gerstner waves 63 | for(int i = 0; i < N_WAVES; ++i) 64 | { 65 | // Evaluate wave equation: 66 | float angle = dot(waves[i].d, P.xy)*waves[i].w + time*waves[i].phi; 67 | float c = cos(angle); 68 | float s = sin(angle); 69 | float q = waves[i].q; 70 | 71 | // Displacement of point due to wave (Eq. 9) 72 | P.x += q*waves[i].a*c*waves[i].d.x; 73 | P.y += q*waves[i].a*c*waves[i].d.y; 74 | P.z += waves[i].a*s; 75 | 76 | // Modify normals due to wave displacement (Eq. 10-12) 77 | float wa = waves[i].a*waves[i].w; 78 | float qwas = q*wa*s; 79 | float wac = wa*c; 80 | float dx = waves[i].d.x; 81 | float dy = waves[i].d.y; 82 | float dxy = dx*dy; 83 | 84 | B += vec3(-qwas*dx*dx, -qwas*dxy, wac*dx); 85 | T += vec3(-qwas*dxy, -qwas*dy*dy, wac*dy); 86 | N += vec3(-dx*wac, -dy*wac, -qwas); 87 | } 88 | 89 | // Compute (Surf2World * Rescale) matrix 90 | B = normalize(B)*rescale; 91 | T = normalize(T)*rescale; 92 | N = normalize(N); 93 | rotMatrix = mat3(B, T, N); 94 | 95 | gl_Position = gl_ModelViewProjectionMatrix*P; 96 | 97 | // Compute texture coordinates for bump map 98 | bumpCoord = gl_MultiTexCoord0.xy*bumpScale + time*bumpSpeed; 99 | 100 | eyeVec = P.xyz - eyePos; // eye position in vertex space 101 | } 102 | -------------------------------------------------------------------------------- /dolly_gazebo/models/ocean/materials/scripts/ocean.material: -------------------------------------------------------------------------------- 1 | material Seabox 2 | { 3 | receive_shadows off 4 | technique 5 | { 6 | pass 7 | { 8 | ambient 0.616687 0.90461 1 0.7 9 | diffuse 0.616687 0.90461 1 0.7 10 | specular 1 1 1 1 20 11 | emissive 0.0 0.0 0.0 1.0 12 | scene_blend alpha_blend 13 | 14 | } 15 | } 16 | } 17 | 18 | material Sand 19 | { 20 | receive_shadows off 21 | technique 22 | { 23 | pass 24 | { 25 | ambient 0.5 0.5 0.5 1.0 26 | diffuse 0.5 0.5 0.5 1.0 27 | specular 0.2 0.2 0.2 1.0 12.5 28 | 29 | texture_unit 30 | { 31 | texture soil_sand_0045_01.jpg 32 | filtering anistropic 33 | max_anisotropy 16 34 | scale 0.5 0.5 35 | } 36 | } 37 | } 38 | } 39 | 40 | vertex_program GLSL/WavesVS glsl 41 | { 42 | source ../programs/GLSL/Waves.vert 43 | } 44 | 45 | fragment_program GLSL/WavesFS glsl 46 | { 47 | source ../programs/GLSL/Waves.frag 48 | } 49 | 50 | material Waves_GLSL 51 | { 52 | technique GLSL 53 | { 54 | pass 55 | { 56 | scene_blend alpha_blend 57 | vertex_program_ref GLSL/WavesVS 58 | { 59 | param_named_auto eyePos camera_position_object_space 60 | param_named_auto time time_0_x 100.0 61 | param_named rescale float 0.5 62 | param_named bumpScale float2 25 25 63 | param_named bumpSpeed float2 0.01 0.01 64 | param_named frequency float 0.028 65 | param_named amplitude float 0.7 66 | param_named steepness float 1.0 67 | } 68 | 69 | fragment_program_ref GLSL/WavesFS 70 | { 71 | param_named deepColor float4 0 0.05 0.1 1.0 72 | param_named shallowColor float4 0 0.2 0.3 1.0 73 | param_named fresnelPower float 5 74 | param_named hdrMultiplier float 0.4 75 | param_named bumpMap int 0 76 | param_named cubeMap int 1 77 | } 78 | 79 | texture_unit 80 | { 81 | texture ../textures/normals.dds 82 | tex_coord_set 0 83 | scale 0.1 0.1 84 | filtering linear linear linear 85 | } 86 | 87 | texture_unit 88 | { 89 | cubic_texture ../textures/clouds.jpg combinedUVW 90 | tex_address_mode clamp 91 | tex_coord_set 1 92 | filtering linear linear linear 93 | } 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /dolly_gazebo/models/ocean/materials/textures/License and source soil_sand_0045_01.txt: -------------------------------------------------------------------------------- 1 | Texture taken from Texture library © 2013 Dmitriy Chugai, admin@texturelib.com 2 | 3 | Direct links: 4 | http://texturelib.com/texture/?path=/Textures/soil/sand/soil_sand_0045 5 | http://texturelib.com/texture/?path=/Textures/water/water/water_water_0076 6 | 7 | License according to http://texturelib.com/license/: 8 | 9 | All images are taken by my own cameras and edited by me. 10 | 11 | They are free for commercial and non-commercial use with the only limitation: you are not allowed to sell or distribute original or slightly modified images alone or in packs. You can only distribute them as an integral part of your product. 12 | 13 | Credit texturelib.com if it is possible. 14 | 15 | -------------------------------------------------------------------------------- /dolly_gazebo/models/ocean/materials/textures/clouds.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_gazebo/models/ocean/materials/textures/clouds.jpg -------------------------------------------------------------------------------- /dolly_gazebo/models/ocean/materials/textures/clouds_bk.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_gazebo/models/ocean/materials/textures/clouds_bk.jpg -------------------------------------------------------------------------------- /dolly_gazebo/models/ocean/materials/textures/clouds_dn.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_gazebo/models/ocean/materials/textures/clouds_dn.jpg -------------------------------------------------------------------------------- /dolly_gazebo/models/ocean/materials/textures/clouds_fr.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_gazebo/models/ocean/materials/textures/clouds_fr.jpg -------------------------------------------------------------------------------- /dolly_gazebo/models/ocean/materials/textures/clouds_lf.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_gazebo/models/ocean/materials/textures/clouds_lf.jpg -------------------------------------------------------------------------------- /dolly_gazebo/models/ocean/materials/textures/clouds_rt.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_gazebo/models/ocean/materials/textures/clouds_rt.jpg -------------------------------------------------------------------------------- /dolly_gazebo/models/ocean/materials/textures/clouds_up.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_gazebo/models/ocean/materials/textures/clouds_up.jpg -------------------------------------------------------------------------------- /dolly_gazebo/models/ocean/materials/textures/normals.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_gazebo/models/ocean/materials/textures/normals.dds -------------------------------------------------------------------------------- /dolly_gazebo/models/ocean/materials/textures/soil_sand_0045_01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_gazebo/models/ocean/materials/textures/soil_sand_0045_01.jpg -------------------------------------------------------------------------------- /dolly_gazebo/models/ocean/mesh.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_gazebo/models/ocean/mesh.blend -------------------------------------------------------------------------------- /dolly_gazebo/models/ocean/model.config: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | ocean 10 | 1.0 11 | model.sdf 12 | 13 | 14 | Sebastian Scherer 15 | sebastian.scherer2@de.bosch.com 16 | 17 | 18 | 19 | Ocean box with rendering of a ocean sea state. 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /dolly_gazebo/models/ocean/model.sdf: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | true 23 | 24 | 25 | 26 | 0 0 0 0 0 0 27 | 28 | model://ocean/mesh.dae0.5 0.5 0.5 29 | 30 | 31 | 35 | 36 | 37 | 38 | 39 | 0 0 0 0 0 0 40 | 41 | model://ocean/mesh_below.dae0.5 0.5 0.5 42 | 43 | 44 | 48 | 49 | 50 | 77 | 78 | 250 0 -3.5 0 -1.5708 0 79 | 0 0 17 500 80 | 81 | 85 | 86 | 87 | 88 | 89 | -250 0 -3.5 0 1.5708 0 90 | 0 0 17 500 91 | 92 | 96 | 97 | 98 | 99 | 100 | 0 250 -3.5 1.5708 0 0 101 | 0 0 1500 7 102 | 103 | 107 | 108 | 109 | 110 | 111 | 0 -250 -3.5 -1.5708 0 0 112 | 0 0 1500 7 113 | 114 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /dolly_gazebo/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | dolly_gazebo 5 | 0.4.0 6 | 7 | Launch Gazebo simulation with Dolly robot. 8 | 9 | Louise Poubel 10 | Apache 2.0 11 | 12 | ament_cmake 13 | 14 | dolly_follow 15 | gazebo_ros_pkgs 16 | ros2launch 17 | rviz2 18 | 19 | ament_lint_auto 20 | ament_lint_common 21 | 22 | 23 | ament_cmake 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /dolly_gazebo/rviz/dolly_gazebo.rviz: -------------------------------------------------------------------------------- 1 | Panels: 2 | - Class: rviz_common/Displays 3 | Help Height: 0 4 | Name: Displays 5 | Property Tree Widget: 6 | Expanded: 7 | - /Global Options1 8 | - /Grid1 9 | - /LaserScan1 10 | - /LaserScan1/Topic1 11 | Splitter Ratio: 0.5 12 | Tree Height: 877 13 | - Class: rviz_common/Selection 14 | Name: Selection 15 | - Class: rviz_common/Tool Properties 16 | Expanded: 17 | - /Publish Point1 18 | Name: Tool Properties 19 | Splitter Ratio: 0.5886790156364441 20 | - Class: rviz_common/Views 21 | Expanded: 22 | - /Current View1 23 | Name: Views 24 | Splitter Ratio: 0.5 25 | Visualization Manager: 26 | Class: "" 27 | Displays: 28 | - Alpha: 0.5 29 | Cell Size: 1 30 | Class: rviz_default_plugins/Grid 31 | Color: 77; 77; 79 32 | Enabled: true 33 | Line Style: 34 | Line Width: 0.029999999329447746 35 | Value: Lines 36 | Name: Grid 37 | Normal Cell Count: 0 38 | Offset: 39 | X: 0 40 | Y: 0 41 | Z: 0 42 | Plane: XY 43 | Plane Cell Count: 50 44 | Reference Frame: 45 | Value: true 46 | - Alpha: 1 47 | Autocompute Intensity Bounds: true 48 | Autocompute Value Bounds: 49 | Max Value: 10 50 | Min Value: -10 51 | Value: true 52 | Axis: Z 53 | Channel Name: intensity 54 | Class: rviz_default_plugins/LaserScan 55 | Color: 255; 255; 255 56 | Color Transformer: Intensity 57 | Decay Time: 0 58 | Enabled: true 59 | Invert Rainbow: false 60 | Max Color: 255; 255; 255 61 | Max Intensity: 0 62 | Min Color: 0; 0; 0 63 | Min Intensity: 0 64 | Name: LaserScan 65 | Position Transformer: XYZ 66 | Selectable: true 67 | Size (Pixels): 3 68 | Size (m): 0.07999999821186066 69 | Style: Flat Squares 70 | Topic: 71 | Depth: 5 72 | Durability Policy: Volatile 73 | Filter size: 10 74 | History Policy: Keep Last 75 | Reliability Policy: Best Effort 76 | Value: /dolly/laser_scan 77 | Use Fixed Frame: true 78 | Use rainbow: true 79 | Value: true 80 | - Class: rviz_default_plugins/TF 81 | Enabled: true 82 | Frame Timeout: 15 83 | Frames: 84 | All Enabled: true 85 | chassis: 86 | Value: true 87 | odom_demo: 88 | Value: true 89 | Marker Scale: 1 90 | Name: TF 91 | Show Arrows: true 92 | Show Axes: true 93 | Show Names: false 94 | Tree: 95 | odom_demo: 96 | chassis: 97 | {} 98 | Update Interval: 0 99 | Value: true 100 | Enabled: true 101 | Global Options: 102 | Background Color: 207; 207; 207 103 | Fixed Frame: chassis 104 | Frame Rate: 30 105 | Name: root 106 | Tools: 107 | - Class: rviz_default_plugins/MoveCamera 108 | - Class: rviz_default_plugins/Select 109 | - Class: rviz_default_plugins/FocusCamera 110 | - Class: rviz_default_plugins/Measure 111 | Line color: 128; 128; 0 112 | - Class: rviz_default_plugins/SetInitialPose 113 | Covariance x: 0.25 114 | Covariance y: 0.25 115 | Covariance yaw: 0.06853891909122467 116 | Topic: 117 | Depth: 5 118 | Durability Policy: Volatile 119 | History Policy: Keep Last 120 | Reliability Policy: Reliable 121 | Value: /initialpose 122 | - Class: rviz_default_plugins/SetGoal 123 | Topic: 124 | Depth: 5 125 | Durability Policy: Volatile 126 | History Policy: Keep Last 127 | Reliability Policy: Reliable 128 | Value: /move_base_simple/goal 129 | - Class: rviz_default_plugins/PublishPoint 130 | Single click: true 131 | Topic: 132 | Depth: 5 133 | Durability Policy: Volatile 134 | History Policy: Keep Last 135 | Reliability Policy: Reliable 136 | Value: /clicked_point 137 | Transformation: 138 | Current: 139 | Class: rviz_default_plugins/TF 140 | Value: true 141 | Views: 142 | Current: 143 | Class: rviz_default_plugins/Orbit 144 | Distance: 18.648193359375 145 | Enable Stereo Rendering: 146 | Stereo Eye Separation: 0.05999999865889549 147 | Stereo Focal Distance: 1 148 | Swap Stereo Eyes: false 149 | Value: false 150 | Focal Point: 151 | X: 0.8779783248901367 152 | Y: 0.15285056829452515 153 | Z: 0.762141764163971 154 | Focal Shape Fixed Size: true 155 | Focal Shape Size: 0.05000000074505806 156 | Invert Z Axis: false 157 | Name: Current View 158 | Near Clip Distance: 0.009999999776482582 159 | Pitch: 0.5202025771141052 160 | Target Frame: 161 | Value: Orbit (rviz) 162 | Yaw: 3.827219009399414 163 | Saved: ~ 164 | Window Geometry: 165 | Displays: 166 | collapsed: false 167 | Height: 1028 168 | Hide Left Dock: false 169 | Hide Right Dock: false 170 | QMainWindow State: 000000ff00000000fd00000004000000000000019a000003aafc0200000008fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003d000003aa000000c900fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261000000010000010f000002f8fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073000000003b000002f8000000a400fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000004420000003efc0100000002fb0000000800540069006d00650100000000000004420000000000000000fb0000000800540069006d0065010000000000000450000000000000000000000220000003aa00000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 171 | Selection: 172 | collapsed: false 173 | Tool Properties: 174 | collapsed: false 175 | Views: 176 | collapsed: false 177 | Width: 960 178 | X: 960 179 | Y: 27 180 | -------------------------------------------------------------------------------- /dolly_gazebo/worlds/dolly_empty.world: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | model://sun 8 | 9 | 10 | model://ground_plane 11 | 12 | 13 | 0 0 0.33 0 0 0 14 | model://dolly 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /dolly_ignition/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package dolly_ignition 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 0.4.0 (2021-10-10) 6 | ------------------ 7 | * Galactic + Edifice support 8 | * Make ros_ign_gazebo more than exec_depend (`#26 `_) 9 | * Contributors: Louise Poubel 10 | 11 | 0.3.0 (2020-08-09) 12 | ------------------ 13 | * Foxy support (`#18 `_) 14 | * A few tweaks to the Ignition package (`#14 `_) 15 | * Ignition support (`#13 `_) 16 | * Contributors: Louise Poubel 17 | 18 | * Foxy support (`#18 `_) 19 | * A few tweaks to the Ignition package (`#14 `_) 20 | * Ignition support (`#13 `_) 21 | * Contributors: Louise Poubel 22 | -------------------------------------------------------------------------------- /dolly_ignition/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | 3 | project(dolly_ignition) 4 | 5 | # Fortress 6 | if("$ENV{IGNITION_VERSION}" STREQUAL "fortress") 7 | find_package(ignition-gazebo6 REQUIRED) 8 | 9 | message(STATUS "Using Ignition Fortress") 10 | # Default to Edifice 11 | else() 12 | find_package(ignition-gazebo5 QUIET) 13 | 14 | if(NOT ignition-gazebo5_FOUND) 15 | # Skip if Ignition not present 16 | message(WARNING "Ignition Gazebo 5 or 6 not found, proceeding without that simulator.") 17 | return() 18 | else() 19 | message(STATUS "Using Ignition Edifice") 20 | endif() 21 | endif() 22 | 23 | find_package(ament_cmake REQUIRED) 24 | 25 | if(BUILD_TESTING) 26 | find_package(ament_lint_auto REQUIRED) 27 | ament_lint_auto_find_test_dependencies() 28 | endif() 29 | 30 | install( 31 | DIRECTORY 32 | ign 33 | launch 34 | models 35 | rviz 36 | worlds 37 | DESTINATION 38 | share/${PROJECT_NAME}/ 39 | ) 40 | 41 | ament_environment_hooks("${CMAKE_CURRENT_SOURCE_DIR}/env-hooks/${PROJECT_NAME}.sh.in") 42 | ament_environment_hooks("${CMAKE_CURRENT_SOURCE_DIR}/env-hooks/${PROJECT_NAME}.dsv.in") 43 | 44 | ament_package() 45 | -------------------------------------------------------------------------------- /dolly_ignition/env-hooks/dolly_ignition.dsv.in: -------------------------------------------------------------------------------- 1 | prepend-non-duplicate;IGN_GAZEBO_RESOURCE_PATH;share/@PROJECT_NAME@/models 2 | prepend-non-duplicate;IGN_GAZEBO_RESOURCE_PATH;share/@PROJECT_NAME@/worlds 3 | set-if-unset;MESA_GL_VERSION_OVERRIDE;3.3 4 | prepend-non-duplicate;SDF_PATH;share/@PROJECT_NAME@/models 5 | prepend-non-duplicate;SDF_PATH;share/@PROJECT_NAME@/worlds 6 | prepend-non-duplicate;IGN_FILE_PATH;share/@PROJECT_NAME@/models 7 | prepend-non-duplicate;IGN_FILE_PATH;share/@PROJECT_NAME@/worlds 8 | -------------------------------------------------------------------------------- /dolly_ignition/env-hooks/dolly_ignition.sh.in: -------------------------------------------------------------------------------- 1 | # generated from dolly_ignition/env-hooks/dolly_ignition.sh.in 2 | 3 | ament_prepend_unique_value IGN_GAZEBO_RESOURCE_PATH "$AMENT_CURRENT_PREFIX/share/@PROJECT_NAME@/models" 4 | ament_prepend_unique_value IGN_GAZEBO_RESOURCE_PATH "$AMENT_CURRENT_PREFIX/share/@PROJECT_NAME@/worlds" 5 | 6 | export MESA_GL_VERSION_OVERRIDE=3.3 7 | 8 | # Deprecated 9 | 10 | ament_prepend_unique_value SDF_PATH "$AMENT_CURRENT_PREFIX/share/@PROJECT_NAME@/models" 11 | ament_prepend_unique_value SDF_PATH "$AMENT_CURRENT_PREFIX/share/@PROJECT_NAME@/worlds" 12 | 13 | ament_prepend_unique_value IGN_FILE_PATH "$AMENT_CURRENT_PREFIX/share/@PROJECT_NAME@/models" 14 | ament_prepend_unique_value IGN_FILE_PATH "$AMENT_CURRENT_PREFIX/share/@PROJECT_NAME@/worlds" 15 | -------------------------------------------------------------------------------- /dolly_ignition/ign/gui.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 3D View 7 | false 8 | docked 9 | 10 | 11 | ogre2 12 | scene 13 | 6 -2 1.5 0 0.35 2.15 14 | 15 | 16 | 17 | 18 | 19 | World control 20 | false 21 | false 22 | 72 23 | 121 24 | 1 25 | 26 | floating 27 | 28 | 29 | 30 | 31 | 32 | 33 | true 34 | true 35 | true 36 | /world/station/control 37 | /world/station/stats 38 | 39 | 40 | 41 | 42 | 43 | 44 | World stats 45 | false 46 | false 47 | 110 48 | 290 49 | 1 50 | 51 | floating 52 | 53 | 54 | 55 | 56 | 57 | 58 | true 59 | true 60 | true 61 | true 62 | /world/station/stats 63 | 64 | 65 | 66 | 67 | 68 | 69 | Transform control 70 | 71 | 72 | 73 | 74 | false 75 | 250 76 | 50 77 | floating 78 | false 79 | #03a9f4 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | false 91 | 250 92 | 50 93 | floating 94 | false 95 | #03a9f4 96 | 97 | 98 | 99 | 100 | 101 | 102 | false 103 | docked 104 | 105 | 106 | 107 | 108 | 109 | 110 | false 111 | docked 112 | 113 | 114 | -------------------------------------------------------------------------------- /dolly_ignition/launch/dolly.launch.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Louise Poubel 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 | """Launch Gazebo with a world that has Dolly, as well as the follow node.""" 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.conditions import IfCondition 24 | from launch.launch_description_sources import PythonLaunchDescriptionSource 25 | from launch.substitutions import LaunchConfiguration 26 | from launch_ros.actions import Node 27 | 28 | 29 | def generate_launch_description(): 30 | 31 | pkg_ros_ign_gazebo = get_package_share_directory('ros_ign_gazebo') 32 | pkg_dolly_ignition = get_package_share_directory('dolly_ignition') 33 | 34 | # Gazebo launch 35 | gazebo = IncludeLaunchDescription( 36 | PythonLaunchDescriptionSource( 37 | os.path.join(pkg_ros_ign_gazebo, 'launch', 'ign_gazebo.launch.py'), 38 | ), 39 | ) 40 | 41 | # Spawn dolly 42 | # TODO: expose pose as a launch argument 43 | spawn = Node(package='ros_ign_gazebo', executable='create', 44 | arguments=[ 45 | '-name', 'dolly', 46 | '-x', '5.0', 47 | '-z', '0.46', 48 | '-Y', '1.57', 49 | '-file', os.path.join(pkg_dolly_ignition, 'models', 'dolly_ignition', 50 | 'model.sdf')], 51 | output='screen') 52 | 53 | # Follow node 54 | follow = Node( 55 | package='dolly_follow', 56 | executable='dolly_follow', 57 | output='screen', 58 | remappings=[ 59 | ('cmd_vel', '/dolly/cmd_vel'), 60 | ('laser_scan', '/dolly/laser_scan') 61 | ] 62 | ) 63 | 64 | # Bridge 65 | bridge = Node( 66 | package='ros_ign_bridge', 67 | executable='parameter_bridge', 68 | arguments=['/dolly/cmd_vel@geometry_msgs/msg/Twist@ignition.msgs.Twist', 69 | '/dolly/laser_scan@sensor_msgs/msg/LaserScan@ignition.msgs.LaserScan', 70 | '/dolly/odometry@nav_msgs/msg/Odometry@ignition.msgs.Odometry'], 71 | output='screen' 72 | ) 73 | 74 | # RViz 75 | rviz = Node( 76 | package='rviz2', 77 | executable='rviz2', 78 | arguments=['-d', os.path.join(pkg_dolly_ignition, 'rviz', 'dolly_ignition.rviz')], 79 | condition=IfCondition(LaunchConfiguration('rviz')) 80 | ) 81 | 82 | return LaunchDescription([ 83 | DeclareLaunchArgument( 84 | 'ign_args', 85 | default_value=[os.path.join(pkg_dolly_ignition, 'worlds', 'station.sdf') + 86 | ' -v 2 --gui-config ' + 87 | os.path.join(pkg_dolly_ignition, 'ign', 'gui.config'), ''], 88 | description='Ignition Gazebo arguments'), 89 | DeclareLaunchArgument('rviz', default_value='true', 90 | description='Open RViz.'), 91 | gazebo, 92 | spawn, 93 | follow, 94 | bridge, 95 | rviz 96 | ]) 97 | -------------------------------------------------------------------------------- /dolly_ignition/models/casual_female/materials/textures/brown_eye.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_ignition/models/casual_female/materials/textures/brown_eye.png -------------------------------------------------------------------------------- /dolly_ignition/models/casual_female/materials/textures/casual_female.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_ignition/models/casual_female/materials/textures/casual_female.png -------------------------------------------------------------------------------- /dolly_ignition/models/casual_female/materials/textures/eyebrow002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_ignition/models/casual_female/materials/textures/eyebrow002.png -------------------------------------------------------------------------------- /dolly_ignition/models/casual_female/materials/textures/eyelashes01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_ignition/models/casual_female/materials/textures/eyelashes01.png -------------------------------------------------------------------------------- /dolly_ignition/models/casual_female/materials/textures/female_casualsuit01_diffuse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_ignition/models/casual_female/materials/textures/female_casualsuit01_diffuse.png -------------------------------------------------------------------------------- /dolly_ignition/models/casual_female/materials/textures/female_casualsuit01_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_ignition/models/casual_female/materials/textures/female_casualsuit01_normal.png -------------------------------------------------------------------------------- /dolly_ignition/models/casual_female/materials/textures/female_casualsuit02_diffuse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_ignition/models/casual_female/materials/textures/female_casualsuit02_diffuse.png -------------------------------------------------------------------------------- /dolly_ignition/models/casual_female/materials/textures/female_casualsuit02_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_ignition/models/casual_female/materials/textures/female_casualsuit02_normal.png -------------------------------------------------------------------------------- /dolly_ignition/models/casual_female/materials/textures/ponytail01_diffuse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_ignition/models/casual_female/materials/textures/ponytail01_diffuse.png -------------------------------------------------------------------------------- /dolly_ignition/models/casual_female/materials/textures/shoes05_diffuse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_ignition/models/casual_female/materials/textures/shoes05_diffuse.png -------------------------------------------------------------------------------- /dolly_ignition/models/casual_female/materials/textures/tongue01_diffuse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_ignition/models/casual_female/materials/textures/tongue01_diffuse.png -------------------------------------------------------------------------------- /dolly_ignition/models/casual_female/materials/textures/young_lightskinned_female_diffuse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_ignition/models/casual_female/materials/textures/young_lightskinned_female_diffuse.png -------------------------------------------------------------------------------- /dolly_ignition/models/casual_female/model.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | Casual Female 4 | 1.0 5 | model.sdf 6 | 7 | 8 | Rohit Salem 9 | rohitsalem@gmail.com 10 | 11 | 12 | 13 | A standing person-Casual Female. Model created with Makehuman (http://www.makehuman.org/) 14 | 15 | 16 | -------------------------------------------------------------------------------- /dolly_ignition/models/casual_female/model.sdf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | 6 | 7 | 0 0 0.9 0 0 0 8 | 9 | 10 | 0.76 0.33 1.77 11 | 12 | 13 | 14 | 15 | 0 0 0.02 0.04 0 0 16 | 17 | 18 | meshes/casual_female.dae 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /dolly_ignition/models/casual_female/thumbnails/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_ignition/models/casual_female/thumbnails/1.png -------------------------------------------------------------------------------- /dolly_ignition/models/casual_female/thumbnails/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_ignition/models/casual_female/thumbnails/2.png -------------------------------------------------------------------------------- /dolly_ignition/models/casual_female/thumbnails/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_ignition/models/casual_female/thumbnails/3.png -------------------------------------------------------------------------------- /dolly_ignition/models/casual_female/thumbnails/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_ignition/models/casual_female/thumbnails/4.png -------------------------------------------------------------------------------- /dolly_ignition/models/casual_female/thumbnails/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_ignition/models/casual_female/thumbnails/5.png -------------------------------------------------------------------------------- /dolly_ignition/models/dolly_ignition/materials/textures/cardboard_box.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_ignition/models/dolly_ignition/materials/textures/cardboard_box.png -------------------------------------------------------------------------------- /dolly_ignition/models/dolly_ignition/materials/textures/sheep.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/dolly_ignition/models/dolly_ignition/materials/textures/sheep.jpg -------------------------------------------------------------------------------- /dolly_ignition/models/dolly_ignition/meshes/cardboard_box.dae: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ColeB 6 | OpenCOLLADA for 3ds Max; Version: 1.6; Revision: 24 7 | 8 | 2016-07-25T18:14:43 9 | 2016-07-25T18:14:43 10 | 11 | Z_UP 12 | 13 | 14 | 15 | 16 | 17 | 18 | CardboardBoxes_png 19 | 20 | 21 | 22 | 23 | CardboardBoxes_png-surface 24 | 25 | 26 | 27 | 28 | 29 | 0 0 0 1 30 | 31 | 32 | 0.588 0.588 0.588 1 33 | 34 | 35 | 36 | 37 | 38 | 0 0 0 1 39 | 40 | 41 | 10 42 | 43 | 44 | 0 0 0 1 45 | 46 | 47 | 1 1 1 1 48 | 49 | 50 | 1 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 0 59 | 0 60 | 0 61 | 1.5 62 | 1 63 | 0 64 | 0 65 | 0 66 | 3 67 | 68 | 69 | 1 70 | 1 71 | 0 72 | 0 73 | 0 74 | 0 75 | 0.1 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | -198.5183 -198.5183 0 -198.5183 0 0 -198.5183 -198.5183 397.0367 198.5183 -198.5183 0 0 0 0 0 -198.5183 0 198.5183 -198.5183 397.0367 0 -198.5183 397.0367 0 0 397.0367 -198.5183 198.5183 0 0 198.5183 0 -198.5183 198.5183 397.0367 0 198.5183 397.0367 -198.5183 0 397.0367 198.5183 198.5183 0 198.5183 0 0 198.5183 198.5183 397.0367 198.5183 0 397.0367 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 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 -1 0 0 -1 0 0 -1 0 0 -1 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 0 0 -1 0 0 -1 0 0 1 0 0 1 0 -1 0 0 -1 0 1 0 0 1 0 0 1 0 0 1 0 0 0 0 -1 0 0 -1 0 0 1 0 0 1 0 1 0 0 1 0 0 1 0 0 1 0 -1 0 0 -1 0 0 0 0 -1 0 0 1 0 1 0 0 1 0 1 0 0 1 0 0 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 0.002000085 0.3197314 0 0.002000085 0.6009098 0 0.8710723 0.2831782 0 0.5898938 0.2831782 0 0.5643569 0.3197314 0 0.8455351 0.3197313 0 0.8455353 0.6009097 0 0.5643569 0.6009098 0 0.002 0.03855312 0 0.5643567 0.03855291 0 0.5898938 0.002000002 0 0.8710723 0.002000002 0 0.5898938 0.002000002 0 0.8710723 0.002000002 0 0.8710723 0.2831782 0 0.5898938 0.2831782 0 0.5643569 0.3197314 0 0.8455351 0.3197313 0 0.8455353 0.6009097 0 0.5643569 0.6009098 0 0.002000085 0.3197314 0 0.002 0.03855312 0 0.5643567 0.03855291 0 0.002000085 0.6009098 0 0.5898938 0.002000002 0 0.8710723 0.002000002 0 0.8710723 0.2831782 0 0.5898938 0.2831782 0 0.5643569 0.3197314 0 0.8455351 0.3197313 0 0.8455353 0.6009097 0 0.5643569 0.6009098 0 0.002000085 0.3197314 0 0.002 0.03855312 0 0.5643567 0.03855291 0 0.002000085 0.6009098 0 0.5898938 0.002000002 0 0.5898938 0.2831782 0 0.8710723 0.2831782 0 0.8710723 0.002000002 0 0.5643569 0.3197314 0 0.5643569 0.6009098 0 0.8455353 0.6009097 0 0.8455351 0.3197313 0 0.002000085 0.3197314 0 0.5643567 0.03855291 0 0.002 0.03855312 0 0.002000085 0.6009098 0 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 127 |

0 0 10 1 1 11 4 2 2 5 3 3 2 4 4 7 5 5 8 6 6 13 7 7 0 8 0 5 9 8 7 10 9 2 11 4 1 12 1 0 13 0 2 14 4 13 15 7 3 16 12 5 3 15 4 2 14 15 17 13 6 18 16 17 19 19 8 6 18 7 5 17 3 20 20 6 21 16 7 10 22 5 9 21 15 22 23 17 23 19 6 24 16 3 25 20 9 26 24 10 27 27 4 2 26 1 1 25 11 28 28 13 7 31 8 6 30 12 29 29 9 30 32 11 31 28 12 32 34 10 33 33 1 12 35 13 15 31 11 34 28 9 35 32 14 36 36 15 17 39 4 2 38 10 27 37 16 37 40 12 29 43 8 6 42 17 19 41 14 38 44 10 33 46 12 32 45 16 39 40 15 22 47 14 40 44 16 41 40 17 23 41

128 |
129 |
130 |
131 |
132 | 133 | 134 | 135 | 136 | 0 0 0 137 | 138 | 139 | 140 | 141 | 142 | 143 | ../materials/textures/cardboard_box.png 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 1 164 | 1 165 | 1 166 | 1 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 |
176 | -------------------------------------------------------------------------------- /dolly_ignition/models/dolly_ignition/model.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Dolly 5 | 1.0 6 | model.sdf 7 | 8 | 9 | Louise Poubel 10 | louise@openrobotics.org 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /dolly_ignition/models/dolly_ignition/model.sdf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0 0 0.225 0 -0 0 5 | 6 | 7 | 8 | 1.0 9 | 10 | 0.0227 11 | 0 12 | 0 13 | 0.0852 14 | 0 15 | 0.1041 16 | 17 | 18 | 19 | 20 | 21 | 1.0 0.5 0.15 22 | 23 | 24 | 25 | 1.0 1.0 1.0 26 | 1.0 1.0 1.0 27 | 1.0 1.0 1.0 28 | 29 | 30 | model://dolly_ignition/materials/textures/sheep.jpg 31 | 32 | 33 | 34 | 35 | 36 | 0 0 0.08 0 0 0.24 37 | 38 | 39 | model://dolly_ignition/meshes/cardboard_box.dae 40 | 1.25931896 1.007455168 0.755591376 41 | 42 | 43 | 44 | 45 | 0.5 0 0 0 0 0 46 | /dolly/laser_scan 47 | 48 | 49 | 50 | 200 51 | 1.0 52 | -1.0 53 | 1.0 54 | 55 | 56 | 57 | 0.05 58 | 10.0 59 | 60 | 61 | true 62 | true 63 | 100.0 64 | 65 | 66 | 67 | -0.3 0 -0.125 0 0 0 68 | 69 | 0.0415553 70 | 71 | 7.97741e-05 72 | 0 73 | 0 74 | 7.97741e-05 75 | 0 76 | 7.97741e-05 77 | 78 | 79 | 80 | 81 | 82 | 0.1 83 | 84 | 85 | 86 | 0 0 0 1 87 | 0 0 0 1 88 | 0 0 0 1 89 | 0 0 0 1 90 | 91 | 92 | 93 | 94 | 95 | 0.1 96 | 97 | 98 | 99 | 100 | 101 | 1 102 | 1 103 | 0 104 | 0 105 | 106 | 107 | 108 | 109 | 0 110 | 0.2 111 | 1e+13 112 | 1 113 | 0.01 114 | 0 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 0.3 0.3 -0.075 -1.5707 0 0 123 | 124 | 0.5 125 | 126 | 0.0029 127 | 0 128 | 0 129 | 0.0029 130 | 0 131 | 0.0056 132 | 133 | 134 | 135 | 136 | 137 | 0.15 138 | 0.05 139 | 140 | 141 | 142 | 0 0 0 1 143 | 0 0 0 1 144 | 0 0 0 1 145 | 0 0 0 1 146 | 147 | 148 | 149 | 150 | 151 | 0.15 152 | 153 | 154 | 155 | 156 | 157 | 1 158 | 1 159 | 0 160 | 0 161 | 162 | 163 | 164 | 165 | 0 166 | 0.2 167 | 1e+13 168 | 1 169 | 0.01 170 | 0.01 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 0.3 -0.3 -0.075 -1.5707 0 0 179 | 180 | 0.5 181 | 182 | 0.0029 183 | 0 184 | 0 185 | 0.0029 186 | 0 187 | 0.0056 188 | 189 | 190 | 191 | 192 | 193 | 0.15 194 | 0.05 195 | 196 | 197 | 198 | 0 0 0 1 199 | 0 0 0 1 200 | 0 0 0 1 201 | 0 0 0 1 202 | 203 | 204 | 205 | 206 | 207 | 0.15 208 | 209 | 210 | 211 | 212 | 213 | 1 214 | 1 215 | 0 216 | 0 217 | 218 | 219 | 220 | 221 | 0 222 | 0.2 223 | 1e+13 224 | 1 225 | 0.01 226 | 0.01 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | -0.52 0 0 -1.6 0 0 235 | 236 | 0.0254232 237 | 238 | 1.528e-05 239 | 0 240 | 0 241 | 1.528e-05 242 | 0 243 | 3.45e-06 244 | 245 | 0 0 -0.04 0 -0 0 246 | 247 | 248 | 249 | 250 | 0.016468 251 | 0.08 252 | 253 | 254 | 255 | 1.0 1.0 1.0 256 | 1.0 1.0 1.0 257 | 1.0 1.0 1.0 258 | 259 | 260 | model://dolly_ignition/materials/textures/sheep.jpg 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | chassis 269 | left_wheel 270 | 271 | 0 0 1 272 | 273 | -1.79769e+308 274 | 1.79769e+308 275 | 276 | 277 | 278 | 279 | 280 | chassis 281 | right_wheel 282 | 283 | 0 0 1 284 | 285 | -1.79769e+308 286 | 1.79769e+308 287 | 288 | 289 | 290 | 291 | 292 | chassis 293 | caster 294 | 295 | 296 | 297 | chassis 298 | tail 299 | 0 0 0.04 0 -0 0 300 | 301 | 1 0 0 302 | 0 303 | 304 | -1.79769e+308 305 | 1.79769e+308 306 | -1 307 | -1 308 | 309 | 310 | 0 311 | 0 312 | 0 313 | 0 314 | 315 | 316 | 317 | 318 | 319 | 0 320 | 0.2 321 | 322 | 323 | 0 324 | 0.2 325 | 326 | 327 | 328 | 329 | 330 | 333 | left_wheel_joint 334 | right_wheel_joint 335 | 1.25 336 | 0.3 337 | /dolly/cmd_vel 338 | /dolly/odometry 339 | 340 | 341 | 342 | 343 | -------------------------------------------------------------------------------- /dolly_ignition/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | dolly_ignition 5 | 0.4.0 6 | 7 | Launch Ignition simulation with Dolly robot. 8 | 9 | Louise Poubel 10 | Apache 2.0 11 | 12 | ament_cmake 13 | 14 | ros_ign_gazebo 15 | 16 | dolly_follow 17 | ros_ign_bridge 18 | ros2launch 19 | rviz2 20 | 21 | ament_lint_auto 22 | ament_lint_common 23 | 24 | 25 | ament_cmake 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /dolly_ignition/rviz/dolly_ignition.rviz: -------------------------------------------------------------------------------- 1 | Panels: 2 | - Class: rviz_common/Displays 3 | Help Height: 0 4 | Name: Displays 5 | Property Tree Widget: 6 | Expanded: 7 | - /Global Options1 8 | - /Grid1 9 | - /LaserScan1 10 | Splitter Ratio: 0.5 11 | Tree Height: 877 12 | - Class: rviz_common/Selection 13 | Name: Selection 14 | - Class: rviz_common/Tool Properties 15 | Expanded: 16 | - /Publish Point1 17 | Name: Tool Properties 18 | Splitter Ratio: 0.5886790156364441 19 | - Class: rviz_common/Views 20 | Expanded: 21 | - /Current View1 22 | Name: Views 23 | Splitter Ratio: 0.5 24 | Visualization Manager: 25 | Class: "" 26 | Displays: 27 | - Alpha: 0.5 28 | Cell Size: 1 29 | Class: rviz_default_plugins/Grid 30 | Color: 77; 77; 79 31 | Enabled: true 32 | Line Style: 33 | Line Width: 0.029999999329447746 34 | Value: Lines 35 | Name: Grid 36 | Normal Cell Count: 0 37 | Offset: 38 | X: 0 39 | Y: 0 40 | Z: 0 41 | Plane: XY 42 | Plane Cell Count: 50 43 | Reference Frame: 44 | Value: true 45 | - Alpha: 1 46 | Autocompute Intensity Bounds: true 47 | Autocompute Value Bounds: 48 | Max Value: 10 49 | Min Value: -10 50 | Value: true 51 | Axis: Z 52 | Channel Name: intensity 53 | Class: rviz_default_plugins/LaserScan 54 | Color: 255; 255; 255 55 | Color Transformer: Intensity 56 | Decay Time: 0 57 | Enabled: true 58 | Invert Rainbow: false 59 | Max Color: 255; 255; 255 60 | Max Intensity: 0 61 | Min Color: 0; 0; 0 62 | Min Intensity: 0 63 | Name: LaserScan 64 | Position Transformer: XYZ 65 | Selectable: true 66 | Size (Pixels): 3 67 | Size (m): 0.07999999821186066 68 | Style: Flat Squares 69 | Topic: 70 | Depth: 5 71 | Durability Policy: Volatile 72 | Filter size: 10 73 | History Policy: Keep Last 74 | Reliability Policy: Best Effort 75 | Value: /dolly/laser_scan 76 | Use Fixed Frame: true 77 | Use rainbow: true 78 | Value: true 79 | - Class: rviz_default_plugins/TF 80 | Enabled: true 81 | Frame Timeout: 15 82 | Frames: 83 | All Enabled: true 84 | chassis: 85 | Value: true 86 | odom_demo: 87 | Value: true 88 | Marker Scale: 1 89 | Name: TF 90 | Show Arrows: true 91 | Show Axes: true 92 | Show Names: false 93 | Tree: 94 | {} 95 | Update Interval: 0 96 | Value: true 97 | Enabled: true 98 | Global Options: 99 | Background Color: 207; 207; 207 100 | Fixed Frame: dolly/chassis/sensor_ray 101 | Frame Rate: 30 102 | Name: root 103 | Tools: 104 | - Class: rviz_default_plugins/MoveCamera 105 | - Class: rviz_default_plugins/Select 106 | - Class: rviz_default_plugins/FocusCamera 107 | - Class: rviz_default_plugins/Measure 108 | Line color: 128; 128; 0 109 | - Class: rviz_default_plugins/SetInitialPose 110 | Covariance x: 0.25 111 | Covariance y: 0.25 112 | Covariance yaw: 0.06853891909122467 113 | Topic: 114 | Depth: 5 115 | Durability Policy: Volatile 116 | History Policy: Keep Last 117 | Reliability Policy: Reliable 118 | Value: /initialpose 119 | - Class: rviz_default_plugins/SetGoal 120 | Topic: 121 | Depth: 5 122 | Durability Policy: Volatile 123 | History Policy: Keep Last 124 | Reliability Policy: Reliable 125 | Value: /move_base_simple/goal 126 | - Class: rviz_default_plugins/PublishPoint 127 | Single click: true 128 | Topic: 129 | Depth: 5 130 | Durability Policy: Volatile 131 | History Policy: Keep Last 132 | Reliability Policy: Reliable 133 | Value: /clicked_point 134 | Transformation: 135 | Current: 136 | Class: rviz_default_plugins/TF 137 | Value: true 138 | Views: 139 | Current: 140 | Class: rviz_default_plugins/Orbit 141 | Distance: 49.51093292236328 142 | Enable Stereo Rendering: 143 | Stereo Eye Separation: 0.05999999865889549 144 | Stereo Focal Distance: 1 145 | Swap Stereo Eyes: false 146 | Value: false 147 | Focal Point: 148 | X: 0.8779783248901367 149 | Y: 0.15285056829452515 150 | Z: 0.762141764163971 151 | Focal Shape Fixed Size: true 152 | Focal Shape Size: 0.05000000074505806 153 | Invert Z Axis: false 154 | Name: Current View 155 | Near Clip Distance: 0.009999999776482582 156 | Pitch: 0.4002026319503784 157 | Target Frame: 158 | Value: Orbit (rviz) 159 | Yaw: 2.637220621109009 160 | Saved: ~ 161 | Window Geometry: 162 | Displays: 163 | collapsed: false 164 | Height: 1028 165 | Hide Left Dock: false 166 | Hide Right Dock: false 167 | QMainWindow State: 000000ff00000000fd00000004000000000000019a000003aafc0200000008fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003d000003aa000000c900fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261000000010000010f000002f8fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073000000003b000002f8000000a400fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000004420000003efc0100000002fb0000000800540069006d00650100000000000004420000000000000000fb0000000800540069006d0065010000000000000450000000000000000000000220000003aa00000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 168 | Selection: 169 | collapsed: false 170 | Tool Properties: 171 | collapsed: false 172 | Views: 173 | collapsed: false 174 | Width: 960 175 | X: 898 176 | Y: 94 177 | -------------------------------------------------------------------------------- /dolly_ignition/worlds/station.sdf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 14 | 15 | 16 | 17 | 20 | 21 | 22 | 23 | 26 | 27 | ogre 28 | 29 | 30 | 31 | 1.0 1.0 1.0 1.0 32 | 0.8 0.8 0.8 1.0 33 | false 34 | false 35 | 36 | 37 | 38 | 5 2 0.23 0 0 3.14 39 | model://casual_female 40 | 41 | 42 | 43 | 0 0 -5 0 0 0 44 | https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Urban Station 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /dolly_tests/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package dolly_tests 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | -------------------------------------------------------------------------------- /dolly_tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | 3 | project(dolly_tests) 4 | 5 | # Fortress 6 | if("$ENV{IGNITION_VERSION}" STREQUAL "fortress") 7 | find_package(ignition-gazebo6 REQUIRED) 8 | set(IGN_GAZEBO_VER 6) 9 | 10 | message(STATUS "Compiling against Ignition Fortress") 11 | # Default to Edifice 12 | else() 13 | find_package(ignition-gazebo5 QUIET) 14 | set(IGN_GAZEBO_VER 5) 15 | 16 | if(NOT ignition-gazebo5_FOUND) 17 | # Skip if Ignition not present 18 | message(WARNING "Ignition Gazebo 5 or 6 not found, proceeding without that simulator.") 19 | return() 20 | else() 21 | message(STATUS "Compiling against Ignition Edifice") 22 | endif() 23 | endif() 24 | 25 | find_package(ament_cmake REQUIRED) 26 | 27 | if(BUILD_TESTING) 28 | find_package(ament_lint_auto REQUIRED) 29 | ament_lint_auto_find_test_dependencies() 30 | 31 | find_package(ament_cmake_gtest REQUIRED) 32 | find_package(launch_testing_ament_cmake REQUIRED) 33 | ament_find_gtest() 34 | 35 | set("PROJECT_SOURCE_PATH" ${CMAKE_CURRENT_SOURCE_DIR}) 36 | configure_file(test/constants.hh.in constants.hh @ONLY) 37 | 38 | set(TEST_NAME follow_ignition_TEST) 39 | ament_add_gtest_executable(${TEST_NAME} test/${TEST_NAME}.cpp) 40 | target_link_libraries(${TEST_NAME} 41 | ignition-gazebo${IGN_GAZEBO_VER}::ignition-gazebo${IGN_GAZEBO_VER} 42 | ) 43 | include_directories(${CMAKE_CURRENT_BINARY_DIR}) 44 | install( 45 | TARGETS ${TEST_NAME} 46 | DESTINATION lib/${PROJECT_NAME} 47 | ) 48 | add_launch_test(launch/${TEST_NAME}.launch.py 49 | TIMEOUT 200 50 | ) 51 | endif() 52 | 53 | install( 54 | DIRECTORY 55 | worlds 56 | DESTINATION 57 | share/${PROJECT_NAME}/ 58 | ) 59 | 60 | ament_package() 61 | -------------------------------------------------------------------------------- /dolly_tests/launch/follow_ignition_TEST.launch.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Louise Poubel 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 | import unittest 17 | import launch_testing 18 | 19 | import launch 20 | import launch.actions 21 | import launch_testing.actions 22 | import launch_testing.markers 23 | 24 | from ament_index_python.packages import get_package_share_directory 25 | from launch_ros.actions import Node 26 | 27 | 28 | def generate_test_description(): 29 | 30 | # Test fixture 31 | gazebo_test_fixture = Node( 32 | package='dolly_tests', 33 | executable='follow_ignition_TEST', 34 | output='screen' 35 | ) 36 | 37 | # Spawn dolly 38 | pkg_dolly_ignition = get_package_share_directory('dolly_ignition') 39 | spawn = Node(package='ros_ign_gazebo', executable='create', 40 | arguments=[ 41 | '-name', 'dolly', 42 | '-z', '0.225', 43 | '-file', os.path.join(pkg_dolly_ignition, 'models', 'dolly_ignition', 44 | 'model.sdf')], 45 | output='screen') 46 | 47 | # Bridge 48 | bridge = Node( 49 | package='ros_ign_bridge', 50 | executable='parameter_bridge', 51 | arguments=['/dolly/cmd_vel@geometry_msgs/msg/Twist@ignition.msgs.Twist', 52 | '/dolly/laser_scan@sensor_msgs/msg/LaserScan@ignition.msgs.LaserScan'], 53 | output='screen' 54 | ) 55 | 56 | # Follow node 57 | follow = Node( 58 | package='dolly_follow', 59 | executable='dolly_follow', 60 | output='screen', 61 | remappings=[ 62 | ('cmd_vel', '/dolly/cmd_vel'), 63 | ('laser_scan', '/dolly/laser_scan') 64 | ] 65 | ) 66 | 67 | 68 | return launch.LaunchDescription([ 69 | gazebo_test_fixture, 70 | spawn, 71 | bridge, 72 | follow, 73 | launch_testing.util.KeepAliveProc(), 74 | launch_testing.actions.ReadyToTest() 75 | ]), locals() 76 | 77 | 78 | class DollyFollowTest(unittest.TestCase): 79 | 80 | def test_termination(self, gazebo_test_fixture, proc_info): 81 | proc_info.assertWaitForShutdown(process=gazebo_test_fixture, timeout=200) 82 | 83 | 84 | @launch_testing.post_shutdown_test() 85 | class DollyFollowTestAfterShutdown(unittest.TestCase): 86 | 87 | def test_exit_code(self, gazebo_test_fixture, proc_info): 88 | launch_testing.asserts.assertExitCodes( 89 | proc_info, 90 | [launch_testing.asserts.EXIT_OK], 91 | gazebo_test_fixture 92 | ) 93 | -------------------------------------------------------------------------------- /dolly_tests/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | dolly_tests 5 | 0.4.0 6 | 7 | Tests for the Dolly robot. 8 | 9 | Louise Poubel 10 | Apache 2.0 11 | 12 | ament_cmake 13 | 14 | 15 | ament_cmake_gtest 16 | ament_lint_auto 17 | ament_lint_common 18 | 19 | 20 | dolly_follow 21 | dolly_ignition 22 | 23 | 24 | launch_testing 25 | ros2launch 26 | 27 | 28 | ros_ign_bridge 29 | 30 | 31 | ignition-gazebo6 32 | 33 | ignition-gazebo5 34 | ignition-gazebo5 35 | 36 | 37 | ament_cmake 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /dolly_tests/test/constants.hh.in: -------------------------------------------------------------------------------- 1 | // Copyright 2021 Louise Poubel. 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 | #ifndef DOLLY_TESTS__CONSTANTS_HH__ 16 | #define DOLLY_TESTS__CONSTANTS_HH__ 17 | #cmakedefine PROJECT_SOURCE_PATH "@PROJECT_SOURCE_PATH@" 18 | #endif 19 | 20 | -------------------------------------------------------------------------------- /dolly_tests/test/follow_ignition_TEST.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2021 Louise Poubel. 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 | #include 16 | 17 | #include 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | #include "constants.hh" 33 | 34 | using namespace std::chrono_literals; 35 | 36 | ////////////////////////////////////////////////// 37 | TEST(DollyTests, Follow) 38 | { 39 | // Maximum verbosity helps with debugging 40 | ignition::common::Console::SetVerbosity(4); 41 | 42 | // Instantiate test fixture. It starts a simulation server and provides 43 | // hooks that we'll use to inspect the running simulation. 44 | ignition::gazebo::ServerConfig config; 45 | config.SetSdfFile(ignition::common::joinPaths( 46 | std::string(PROJECT_SOURCE_PATH), "worlds", "empty.sdf")); 47 | config.SetHeadlessRendering(true); 48 | 49 | ignition::gazebo::TestFixture fixture(config); 50 | 51 | // Variables that will be populated during the simulation 52 | int iterations{0}; 53 | ignition::gazebo::World world; 54 | ignition::gazebo::Entity dollyEntity{ignition::gazebo::kNullEntity}; 55 | std::vector dollyPoses; 56 | ignition::gazebo::Entity targetEntity{ignition::gazebo::kNullEntity}; 57 | 58 | fixture. 59 | // Use configure callback to get values at startup 60 | OnConfigure( 61 | [&](const ignition::gazebo::Entity & _worldEntity, 62 | const std::shared_ptr &, 63 | ignition::gazebo::EntityComponentManager & _ecm, 64 | ignition::gazebo::EventManager &) 65 | { 66 | // Get world 67 | world = ignition::gazebo::World(_worldEntity); 68 | }). 69 | // Use post-update callback to get values at the end of every iteration 70 | OnPostUpdate( 71 | [&]( 72 | const ignition::gazebo::UpdateInfo &, 73 | const ignition::gazebo::EntityComponentManager & _ecm) 74 | { 75 | iterations++; 76 | 77 | // Get dolly entity once it's spawned 78 | dollyEntity = world.ModelByName(_ecm, "dolly"); 79 | if (ignition::gazebo::kNullEntity == dollyEntity) { 80 | return; 81 | } 82 | 83 | EXPECT_NE(ignition::gazebo::kNullEntity, dollyEntity); 84 | 85 | // Inspect all model poses 86 | dollyPoses.push_back(ignition::gazebo::worldPose(dollyEntity, _ecm)); 87 | 88 | // Get target entity once it's spawned 89 | targetEntity = world.ModelByName(_ecm, "target"); 90 | }). 91 | // The moment we finalize, the configure callback is called 92 | Finalize(); 93 | 94 | // Run simulation server, this will call the post-update callbacks. 95 | int sleep = 0; 96 | int maxSleep = 30; 97 | for (; sleep <= maxSleep && ignition::gazebo::kNullEntity == dollyEntity; 98 | ++sleep) 99 | { 100 | std::this_thread::sleep_for(100ms); 101 | fixture.Server()->Run(true /*blocking*/, 100, false /*paused*/); 102 | } 103 | 104 | EXPECT_LT(sleep, maxSleep); 105 | EXPECT_EQ(100 * sleep, iterations); 106 | EXPECT_NE(ignition::gazebo::kNullEntity, dollyEntity); 107 | EXPECT_LT(0u, dollyPoses.size()); 108 | 109 | // Check that Dolly didn't move, because there's nothing to follow 110 | for (auto i = 0; i < dollyPoses.size(); ++i) { 111 | const auto & pose = dollyPoses[i]; 112 | EXPECT_NEAR(0.0, pose.Pos().X(), 1e-3) << i; 113 | EXPECT_NEAR(0.0, pose.Pos().Y(), 1e-3) << i; 114 | EXPECT_NEAR(0.22, pose.Pos().Z(), 1e-2) << i; 115 | EXPECT_NEAR(0.0, pose.Rot().Roll(), 1e-3) << i; 116 | EXPECT_NEAR(0.0, pose.Rot().Pitch(), 1e-3) << i; 117 | EXPECT_NEAR(0.0, pose.Rot().Yaw(), 1e-3) << i; 118 | } 119 | 120 | // Spawn an object in front of Dolly, to the right 121 | const auto modelStr = std::string("") + 122 | "" + 123 | "" + 124 | "" + 125 | "" + 126 | "1.0" + 127 | "" + 128 | "" + 129 | "1.0" + 130 | "" + 131 | "" + 132 | "" + 133 | ""; 134 | 135 | ignition::msgs::EntityFactory req; 136 | req.set_sdf(modelStr); 137 | 138 | auto pose = req.mutable_pose(); 139 | auto pos = pose->mutable_position(); 140 | pos->set_x(5); 141 | pos->set_y(-3); 142 | 143 | ignition::msgs::Boolean res; 144 | bool result; 145 | unsigned int timeout = 2000; 146 | std::string service{"/world/empty/create"}; 147 | 148 | ignition::transport::Node node; 149 | EXPECT_TRUE(node.Request(service, req, timeout, res, result)); 150 | EXPECT_TRUE(result); 151 | EXPECT_TRUE(res.data()); 152 | 153 | // Run simulation until target is spawned 154 | iterations = 0; 155 | sleep = 0; 156 | for (; sleep <= maxSleep && ignition::gazebo::kNullEntity == targetEntity; 157 | ++sleep) 158 | { 159 | std::this_thread::sleep_for(100ms); 160 | fixture.Server()->Run(true, 10, false); 161 | } 162 | 163 | EXPECT_LT(sleep, maxSleep); 164 | EXPECT_EQ(10 * sleep, iterations); 165 | EXPECT_NE(ignition::gazebo::kNullEntity, targetEntity); 166 | EXPECT_LT(0u, dollyPoses.size()); 167 | 168 | // Dolly hasn't moved yet 169 | { 170 | const auto & pose = dollyPoses.back(); 171 | EXPECT_NEAR(0.0, pose.Pos().X(), 1e-3); 172 | EXPECT_NEAR(0.0, pose.Pos().Y(), 1e-3); 173 | EXPECT_NEAR(0.22, pose.Pos().Z(), 1e-2); 174 | EXPECT_NEAR(0.0, pose.Rot().Roll(), 1e-3); 175 | EXPECT_NEAR(0.0, pose.Rot().Pitch(), 1e-3); 176 | EXPECT_NEAR(0.0, pose.Rot().Yaw(), 2e-3); 177 | } 178 | 179 | // Run simulation and check that Dolly moves towards target 180 | iterations = 0; 181 | dollyPoses.clear(); 182 | sleep = 0; 183 | for (; sleep <= maxSleep && dollyPoses.back().Pos().X() < 1.0; ++sleep) { 184 | std::this_thread::sleep_for(100ms); 185 | fixture.Server()->Run(true, 1000, false); 186 | } 187 | 188 | EXPECT_LT(sleep, maxSleep); 189 | EXPECT_EQ(1000 * sleep, iterations); 190 | EXPECT_NE(ignition::gazebo::kNullEntity, targetEntity); 191 | EXPECT_LT(4000u, dollyPoses.size()); 192 | 193 | ignwarn << "Recorded [" << dollyPoses.size() << "] poses" << std::endl; 194 | 195 | for (auto i = 2000; i < dollyPoses.size(); i = i + 100) { 196 | if (i == 2000) { 197 | continue; 198 | } 199 | 200 | const auto & prevPose = dollyPoses[i - 100]; 201 | const auto & pose = dollyPoses[i]; 202 | 203 | // Going forward 204 | EXPECT_LT(prevPose.Pos().X(), pose.Pos().X()) << i; 205 | 206 | // Going right 207 | EXPECT_GT(prevPose.Pos().Y(), pose.Pos().Y()) << i; 208 | 209 | // Turning right 210 | EXPECT_GT(prevPose.Rot().Yaw(), pose.Rot().Yaw()) << i; 211 | 212 | // Not flying, rolling or pitching 213 | EXPECT_NEAR(prevPose.Pos().Z(), pose.Pos().Z(), 1e-3) << i; 214 | EXPECT_NEAR(prevPose.Rot().Roll(), pose.Rot().Roll(), 1e-3) << i; 215 | EXPECT_NEAR(prevPose.Rot().Pitch(), pose.Rot().Pitch(), 1e-3) << i; 216 | } 217 | 218 | { 219 | const auto & pose = dollyPoses.back(); 220 | EXPECT_LT(1.0, pose.Pos().X()); 221 | EXPECT_GT(-0.2, pose.Pos().Y()); 222 | EXPECT_NEAR(0.22, pose.Pos().Z(), 1e-2); 223 | EXPECT_NEAR(0.0, pose.Rot().Roll(), 1e-3); 224 | EXPECT_NEAR(0.0, pose.Rot().Pitch(), 1e-3); 225 | EXPECT_GT(-0.5, pose.Rot().Yaw()); 226 | } 227 | } 228 | -------------------------------------------------------------------------------- /dolly_tests/worlds/empty.sdf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 0.005 6 | 7 | 0 8 | 9 | 10 | 11 | 14 | 15 | 16 | 17 | 20 | 21 | 22 | 23 | 26 | ogre2 27 | 28 | 29 | 30 | true 31 | 32 | 33 | 34 | 35 | 0 0 1 36 | 100 100 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /images/dolly.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/images/dolly.gif -------------------------------------------------------------------------------- /images/dolly_ign.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chapulina/dolly/de9efdf34235d749b9f3b458607d554816304b88/images/dolly_ign.gif --------------------------------------------------------------------------------