├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── Screenshot.png ├── controllers ├── __init__.py ├── basic_SLAM_simple │ └── basic_SLAM_simple.py ├── lidar_camera_controller │ └── lidar_camera_controller.py ├── lidar_visualization │ └── lidar_visualization.py ├── odometry_simple_teleop │ └── odometry_simple_teleop.py ├── swarm_basic_flocking │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-36.pyc │ │ └── swarm_basic_flocking.cpython-36.pyc │ └── swarm_basic_flocking.py ├── swarm_flocking_anticollision │ ├── __init__.py │ └── swarm_flocking_anticollision.py └── teleoperator │ └── teleoperator.py ├── protos ├── .ChuhaBasic.cache ├── .ChuhaLidarCamera.cache ├── ChuhaBasic.proto └── ChuhaLidarCamera.proto ├── pull_request_template.md └── worlds ├── .basic_SLAM_simple.wbproj ├── .chuha_definitions.wbproj ├── .four_wheeled_robot.wbproj ├── .lidar_collision_avoidance.wbproj ├── .lidar_visualization.wbproj ├── .swarm_basic_flocking.wbproj ├── .swarm_flocking_anticollision.wbproj ├── .swarm_follow_the_leader.wbproj ├── basic_SLAM_simple.wbt ├── chuha_definitions.wbt ├── lidar_visualization.wbt ├── odometry_basic_teleop.wbt ├── swarm_basic_flocking.wbt ├── swarm_flocking_anticollision.wbt └── swarm_follow_the_leader.wbt /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aniruddhkb/swarm_robotics_webots/e5127bc7a170050c911c1f91765ff473f9928af7/.gitignore -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at aniruddhkb@gmail.com. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | 75 | For answers to common questions about this code of conduct, see 76 | https://www.contributor-covenant.org/faq 77 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | I have no clue of what to put here. Still... 2 | 3 | 1) If you wish to add features to the Chuha robot, create a new PROTO, WORLD and DEFAULT_CONTROLLER and pull 4 | request these new files. They will be merged after a cursory check of the functionality. 5 | 6 | 2) If you wish to add a new algorithm or scenario, simply create a new WORLD and a new CONTROLLER. 7 | 8 | 3) If you wish to refactor or improve existing controllers, ensure that it works out well and DOCUMENT YOUR CHANGES. 9 | 10 | I strongly recommend trying 1) or 2) instead of going directly for 3). Use option 3) only for bug fixes or for much-desired 11 | changes or features. 12 | 13 | This is a small project so far, with a single contributor as of now. I'm making this up as I go along, so if you have any 14 | suggestions, ping me at aniruddhkb@gmail.com . 15 | -------------------------------------------------------------------------------- /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 | # swarm_robotics_webots 2 | ![Image](https://github.com/aniruddhkb/swarm_robotics_webots/raw/master/Screenshot.png) 3 | 4 | I thought of doing some work in Swarm, but couldn't quite get it off the ground. Leaving this here as an archive since some have forked it. 5 | ~~This is a repo containing my work in implementing common swarm robotics algorithms using the Webots simulator.~~ 6 | 7 | This has been tested on Webots R2020b Nightly Build 26/6/2020. Hopefully, this should work on your system as well. 8 | 9 | To use this, simply clone this repo to a folder of your choice and open one of the world files in a repo. A good starting 10 | point would be /worlds/swarm_basic_flocking.wbt and /controllers/swarm_basic_flocking/swarm_basic_flocking.py (WARNING-- 11 | YET TO BE COMMENTED AND PENDING REFACTORING). 12 | 13 | Please feel free to contribute through issues and pull requests. 14 | 15 | I won't be making a Wiki yet, since there are so few files involved. This may change, and I believe in over-documentation as 16 | opposed to under-documentation. Still, it may be some time before I get to that stage. For the time being, below is an explanation of the main robot models and controllers. 17 | 18 | Thanks for dropping by! 19 | 20 | # ChuhaBasic and ChuhaLidarCamera 21 | 22 | ChuhaBasic is a simple differential-drive robot. It comes with two wheels (driven by motors with encoders) and an IMU. 23 | 24 | The robot is roughly 6 cm in diameter and the wheels are 1.5 cm in diameter. 25 | 26 | The motors can rotate at 60 radians/sec (or a little less than 600 RPM). The encoders give the angular position of the 27 | wheels. 28 | The IMU gives the roll-pitch-yaw for the robot (though I think the IMU is misaligned by 90 degrees -- use only yaw for now). 29 | 30 | ChuhaLidarCamera has the same, plus a LIDAR, and two cameras. There are three displays in total -- two for the cameras and 31 | one which is programmable. This third display can be used to visualize the LIDAR data. 32 | 33 | Both of these can be found in the worlds/chuha_definitions.wbt world. They can be used using the relevant PROTO files. 34 | 35 | # The worlds: 36 | chuha_definitions : Has the two robots. Can play around a bit. 37 | 38 | lidar_visualization: To understand how to use the LIDAR and the display. 39 | 40 | odometry_basic_teleop: Basic odometry and dead-heading implementation. 41 | 42 | basic_SLAM_simple: SLAM is a misnomer here. The map is 43 | generated (in a very basic way), but the data is not used 44 | in any way. 45 | 46 | swarm_basic_flocking: My first swarm algorithm. Flocking 47 | without any care for collisions. For now, I will be implementing the algorithms using LIDAR, so that I have precise data. Later on, I will implement them using an IR skirt or SONAR skirt. Uses the swarm_basic_flocking controller. 48 | 49 | swarm_flocking_anticollision: Same as swarm_basic_flocking, but with some element of collision avoidance. Uses the swarm_flocking_anticollision controller. 50 | -------------------------------------------------------------------------------- /Screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aniruddhkb/swarm_robotics_webots/e5127bc7a170050c911c1f91765ff473f9928af7/Screenshot.png -------------------------------------------------------------------------------- /controllers/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aniruddhkb/swarm_robotics_webots/e5127bc7a170050c911c1f91765ff473f9928af7/controllers/__init__.py -------------------------------------------------------------------------------- /controllers/basic_SLAM_simple/basic_SLAM_simple.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.6 2 | 3 | from controller import Robot, Motor, PositionSensor, InertialUnit, Lidar, Display 4 | import numpy as np 5 | #PLOTTING FUNCTIONS 6 | class Grapher: 7 | def __init__(self, display): 8 | ''' 9 | display: The display you wish to use with this. 10 | ''' 11 | self.display = display 12 | self.width = display.getWidth() 13 | self.height = display.getHeight() 14 | self.defaultPointSize = int((self.height + self.width)/200) 15 | def drawPointCorner(self, x, y, size=None, color=0x00FFFF): 16 | ''' 17 | Draws square points wrt the top right corner. The size is in pixels. 18 | ''' 19 | if(size is None): 20 | size = self.defaultPointSize 21 | self.display.setColor(color) 22 | for row in range(max(0, y - size//2), min(self.height, y + size//2)): 23 | for column in range(max(0, x - size//2), min(self.width, x + size//2)): 24 | self.display.drawPixel(column, row) 25 | def drawPointCenter(self, x, y, size=None, color=0x00FFFF): 26 | ''' 27 | Draws square points taking the center (width//2, height//2) to be 0, 0. 28 | ''' 29 | self.drawPointCorner(x + self.width//2, self.height//2-y, size, color) 30 | def drawPointsListCenter(self, x_s, y_s, size = None, color=0x00FFFF): 31 | ''' 32 | Draws points from two lists. If len_x != len_y, the trailing of x or y are truncated. 33 | ''' 34 | length = min(len(x_s), len(y_s)) 35 | for i in range(length): 36 | self.drawPointCenter(x_s[i], y_s[i], size, color) 37 | 38 | def clear(self, color=0x000000): 39 | self.display.setColor(color) 40 | self.display.fillRectangle(0, 0, self.width, self.height) 41 | 42 | def lidar_plot(self, x_data, y_data, DISPLAY_SCALING_FACTOR, color=0x00FFFF): 43 | self.clear() 44 | self.lidar_plot_without_clearing(x_data, y_data, DISPLAY_SCALING_FACTOR, color) 45 | def lidar_plot_without_clearing(self, x_data, y_data, DISPLAY_SCALING_FACTOR, color=0x00FFFF): 46 | x_s = [] 47 | y_s = [] 48 | for i in range(len(x_data)): 49 | x_s.append(int(x_data[i]*DISPLAY_SCALING_FACTOR)) 50 | y_s.append(int(y_data[i]*DISPLAY_SCALING_FACTOR)) 51 | # self.drawPointCenter(0, 0, color=0xFF0000) 52 | self.drawPointsListCenter(x_s, y_s, size=5,color=color) 53 | def lidar_filter(imageArray, SIZES,RANGES,EPSILON): 54 | theta_data = np.zeros((SIZES[1],)).tolist() 55 | for layer in range(SIZES[0]): 56 | for theta in range(SIZES[1]): 57 | point_range = imageArray[layer][theta] 58 | if(point_range < RANGES[layer]*(EPSILON)): 59 | theta_data[theta] = point_range 60 | return theta_data 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | #INITIALIZATION CODE HERE. 69 | VELOCITY = 30 70 | WHEEL_RADIUS = 0.0075 71 | #ROBOT INITIALIZATION 72 | robot = Robot() 73 | timestep = int(robot.getBasicTimeStep()) 74 | #LIDAR AND PLOTTING INITIALIZATION 75 | SIZES = (16, 512) 76 | ranges_str = "1.13114178 0.85820043 0.57785118 0.43461093 0.38639969 0.31585345 0.2667459 0.23062678 0.21593061 0.19141567 0.17178488 0.15571462 0.14872716 0.13643947 0.12597121 0.11696267" 77 | RANGES = [float(i) for i in ranges_str.split(' ')] 78 | EPSILON = 0.6 79 | DISPLAY_SIZE = (1024, 1024) 80 | DISPLAY_SCALING_FACTOR = 0.9*1024/5 81 | PLOT_UPDATE_RATE = 1 82 | lidar = robot.getLidar("lidar") 83 | lidar.enable(timestep) 84 | i = 0 85 | display = robot.getDisplay("extra_display") 86 | grapher = Grapher(display) 87 | 88 | 89 | 90 | #MOTOR AND ENCODER INITIALIZATION 91 | left_motor = robot.getMotor("left motor") 92 | right_motor = robot.getMotor("right motor") 93 | 94 | left_motor_sensor = left_motor.getPositionSensor() 95 | right_motor_sensor = right_motor.getPositionSensor() 96 | 97 | left_motor_sensor.enable(timestep) 98 | right_motor_sensor.enable(timestep) 99 | 100 | left_motor.setPosition(float('inf')) 101 | right_motor.setPosition(float('inf')) 102 | 103 | #KEYBOARD MESSAGE 104 | print("Keyboard control has been disabled.") 105 | 106 | #INERTIAL UNIT INITIALIZATION 107 | inertial_unit = robot.getInertialUnit("inertial unit") 108 | inertial_unit.enable(timestep) 109 | 110 | #ODOMETRY INITIALIZATION 111 | _, _, alpha = inertial_unit.getRollPitchYaw() 112 | x = 0 113 | z = 0 114 | DTHETA_L = 0 115 | DTHETA_R = 0 116 | THETA_L_PREV = left_motor_sensor.getValue() 117 | THETA_R_PREV = right_motor_sensor.getValue() 118 | distance = 0 119 | 120 | #WALL-FOLLOWING BEHAVIOUR INITIALIZATION 121 | #ENSURE THAT LEFT + SPREAD < 512 122 | 123 | CENTER_DELTA = 0.4 124 | LEFT_DELTA = 0.7 125 | FRONT = 0 126 | RIGHT = 128 127 | BACK = 256 128 | LEFT = 384 129 | LEFT_SPREAD_LOW = -30 130 | LEFT_SPREAD_HIGH = 100 131 | CENTER_SPREAD = 50 132 | turnLeft = True 133 | goForward = False 134 | LAG = 50 135 | j = LAG 136 | while robot.step(timestep) != -1: 137 | #HANDLING INERTIAL UNIT BEHAVIOUR -- INCOMPLETE! 138 | _, _, alpha = inertial_unit.getRollPitchYaw() 139 | DTHETA_L = left_motor_sensor.getValue() - THETA_L_PREV 140 | DTHETA_R = right_motor_sensor.getValue() - THETA_R_PREV 141 | THETA_L_PREV += DTHETA_L 142 | THETA_R_PREV += DTHETA_R 143 | if(goForward): 144 | DTHETA = (DTHETA_L + DTHETA_R)/2 145 | x += WHEEL_RADIUS*DTHETA*np.sin(alpha) 146 | z += WHEEL_RADIUS*DTHETA*np.cos(alpha) 147 | distance += abs(WHEEL_RADIUS*DTHETA) 148 | 149 | #LIDAR SENSOR HANDLING PART 1 for WALL-FOLLOWING BEHAVIOUR 150 | imageArray = np.array(lidar.getRangeImageArray()).T 151 | theta_data = lidar_filter(imageArray, SIZES,RANGES,EPSILON) 152 | theta_data_aligned = [] 153 | for theta in range(len(theta_data)): 154 | new_theta =(-np.pi/2 - 2*np.pi*theta/512 + alpha) 155 | if(theta_data[theta] != 0): 156 | theta_data_aligned.append((new_theta, theta_data[theta])) 157 | x_data = [] 158 | y_data = [] 159 | for i in range(len(theta_data_aligned)): 160 | x_data.append(theta_data_aligned[i][1]*np.cos(theta_data_aligned[i][0])) 161 | y_data.append(theta_data_aligned[i][1]*np.sin(theta_data_aligned[i][0])) 162 | 163 | for i in range(len(x_data)): 164 | x_data[i] += x 165 | y_data[i] -= z 166 | grapher.lidar_plot_without_clearing([x],[-z],DISPLAY_SCALING_FACTOR,color=0xFF0000) 167 | if(goForward and not turnLeft and j > LAG): 168 | grapher.lidar_plot_without_clearing(x_data, y_data, DISPLAY_SCALING_FACTOR) 169 | elif(goForward and not turnLeft): 170 | j += 1 171 | #WALL-FOLLOWING BEHAVIOUR 172 | turnLeft = True 173 | goForward = False 174 | for i in range(LEFT-LEFT_SPREAD_LOW,LEFT+LEFT_SPREAD_HIGH+1): 175 | if(theta_data[i] != 0 and theta_data[i] < LEFT_DELTA): 176 | turnLeft = False 177 | if(turnLeft): 178 | j = 0 179 | left_motor.setVelocity(-VELOCITY) 180 | right_motor.setVelocity(VELOCITY) 181 | else: 182 | goForward = True 183 | for i in range(FRONT - CENTER_SPREAD , FRONT + CENTER_SPREAD + 1): 184 | if(theta_data[i] != 0 and theta_data[i] < CENTER_DELTA): 185 | goForward = False 186 | if(goForward): 187 | left_motor.setVelocity(VELOCITY) 188 | right_motor.setVelocity(VELOCITY) 189 | else: 190 | j = 0 191 | left_motor.setVelocity(VELOCITY) 192 | right_motor.setVelocity(-VELOCITY) 193 | 194 | -------------------------------------------------------------------------------- /controllers/lidar_camera_controller/lidar_camera_controller.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.6 2 | 3 | from controller import Robot, Motor, PositionSensor, Keyboard, Lidar, LidarPoint 4 | 5 | #INITIALIZATION CODE HERE. 6 | 7 | VELOCITY = 30 8 | 9 | #ROBOT INITIALIZATION 10 | robot = Robot() 11 | timestep = int(robot.getBasicTimeStep()) 12 | 13 | 14 | #MOTOR AND ENCODER INITIALIZATION 15 | left_motor = robot.getMotor("left motor") 16 | right_motor = robot.getMotor("right motor") 17 | 18 | left_motor_sensor = left_motor.getPositionSensor() 19 | right_motor_sensor = right_motor.getPositionSensor() 20 | 21 | left_motor_sensor.enable(timestep) 22 | right_motor_sensor.enable(timestep) 23 | 24 | left_motor_init = left_motor_sensor.getValue() 25 | right_motor_init = right_motor_sensor.getValue() 26 | 27 | left_motor.setPosition(float('inf')) 28 | right_motor.setPosition(float('inf')) 29 | 30 | #KEYBOARD INITIALIZATION 31 | keyboard = Keyboard() 32 | keyboard.enable(timestep) 33 | print("Select the 3D window and control the robot using the W, A, S, D keys.") 34 | 35 | #LIDAR INITIALIZATION 36 | lidar = robot.getLidar("lidar") 37 | lidar.enable(timestep) 38 | lidar.enablePointCloud() 39 | 40 | #FRONT CAMERA INITIALIZATION 41 | front_camera = robot.getCamera("front_camera") 42 | front_camera.enable(timestep) 43 | #REAR CAMERA INITIALIZATION 44 | rear_camera = robot.getCamera("rear_camera") 45 | rear_camera.enable(timestep) 46 | while robot.step(timestep) != -1: 47 | #HANDLING KEYBOARD BEHAVIOUR 48 | ascii_val = keyboard.getKey() 49 | if(ascii_val == -1): 50 | left_motor.setVelocity(0) 51 | right_motor.setVelocity(0) 52 | else: 53 | key = chr(ascii_val).lower() 54 | if(key == 'w'): 55 | left_motor.setVelocity(VELOCITY) 56 | right_motor.setVelocity(VELOCITY) 57 | elif(key == 's'): 58 | left_motor.setVelocity(-VELOCITY) 59 | right_motor.setVelocity(-VELOCITY) 60 | elif(key == 'a'): 61 | left_motor.setVelocity(-VELOCITY) 62 | right_motor.setVelocity(VELOCITY) 63 | elif(key == 'd'): 64 | left_motor.setVelocity(VELOCITY) 65 | right_motor.setVelocity(-VELOCITY) 66 | #HANDLING LIDAR 67 | pointCloud = lidar.getPointCloud() 68 | #HANDLING FRONT CAMERA 69 | front_camera.getImageArray() 70 | #HANDLING REAR CAMERA 71 | rear_camera.getImageArray() -------------------------------------------------------------------------------- /controllers/lidar_visualization/lidar_visualization.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.6 2 | 3 | from controller import Robot, Motor, PositionSensor, Keyboard, Lidar, Display 4 | import numpy as np 5 | 6 | #PLOTTING FUNCTIONS 7 | class Grapher: 8 | def __init__(self, display): 9 | ''' 10 | display: The display you wish to use with this. 11 | ''' 12 | self.display = display 13 | self.width = display.getWidth() 14 | self.height = display.getHeight() 15 | self.defaultPointSize = int((self.height + self.width)/200) 16 | def drawPointCorner(self, x, y, size=None, color=0x00FFFF): 17 | ''' 18 | Draws square points wrt the top right corner. The size is in pixels. 19 | ''' 20 | if(size is None): 21 | size = self.defaultPointSize 22 | self.display.setColor(color) 23 | for row in range(max(0, y - size//2), min(self.height, y + size//2)): 24 | for column in range(max(0, x - size//2), min(self.width, x + size//2)): 25 | self.display.drawPixel(column, row) 26 | def drawPointCenter(self, x, y, size=None, color=0x00FFFF): 27 | ''' 28 | Draws square points taking the center (width//2, height//2) to be 0, 0. 29 | ''' 30 | self.drawPointCorner(x + self.width//2, self.height//2-y, size, color) 31 | def drawPointsListCenter(self, x_s, y_s, size = None, color=0x00FFFF): 32 | ''' 33 | Draws points from two lists. If len_x != len_y, the trailing of x or y are truncated. 34 | ''' 35 | length = min(len(x_s), len(y_s)) 36 | for i in range(length): 37 | self.drawPointCenter(x_s[i], y_s[i], size, color) 38 | 39 | def clear(self, color=0x000000): 40 | self.display.setColor(color) 41 | self.display.fillRectangle(0, 0, self.width, self.height) 42 | 43 | def lidar_plot(self, x_data, y_data, DISPLAY_SCALING_FACTOR): 44 | x_s = [] 45 | y_s = [] 46 | for i in range(len(x_data)): 47 | x_s.append(int(x_data[i]*DISPLAY_SCALING_FACTOR)) 48 | y_s.append(int(y_data[i]*DISPLAY_SCALING_FACTOR)) 49 | self.clear() 50 | self.drawPointCenter(0, 0, color=0xFF0000) 51 | self.drawPointsListCenter(x_s, y_s, size=5) 52 | 53 | def lidar_filter(imageArray, SIZES,RANGES,EPSILON): 54 | theta_data = np.zeros((SIZES[1],)).tolist() 55 | for layer in range(SIZES[0]): 56 | for theta in range(SIZES[1]): 57 | point_range = imageArray[layer][theta] 58 | if(point_range < RANGES[layer]*(EPSILON)): 59 | theta_data[theta] = point_range 60 | return theta_data 61 | 62 | 63 | #INITIALIZATION CODE HERE. 64 | VELOCITY = 30 65 | SIZES = (16, 512) 66 | ranges_str = "1.13114178 0.85820043 0.57785118 0.43461093 0.38639969 0.31585345 0.2667459 0.23062678 0.21593061 0.19141567 0.17178488 0.15571462 0.14872716 0.13643947 0.12597121 0.11696267" 67 | RANGES = [float(i) for i in ranges_str.split(' ')] 68 | EPSILON = 0.5 69 | DISPLAY_SIZE = (1024, 1024) 70 | DISPLAY_SCALING_FACTOR = 0.3*1024/RANGES[0] 71 | #ROBOT INITIALIZATION 72 | robot = Robot() 73 | timestep = int(robot.getBasicTimeStep()) 74 | PLOT_UPDATE_RATE = 1 75 | 76 | 77 | #MOTOR AND ENCODER INITIALIZATION 78 | left_motor = robot.getMotor("left motor") 79 | right_motor = robot.getMotor("right motor") 80 | 81 | left_motor_sensor = left_motor.getPositionSensor() 82 | right_motor_sensor = right_motor.getPositionSensor() 83 | 84 | left_motor_sensor.enable(timestep) 85 | right_motor_sensor.enable(timestep) 86 | 87 | left_motor_init = left_motor_sensor.getValue() 88 | right_motor_init = right_motor_sensor.getValue() 89 | 90 | left_motor.setPosition(float('inf')) 91 | right_motor.setPosition(float('inf')) 92 | 93 | #KEYBOARD INITIALIZATION 94 | keyboard = Keyboard() 95 | keyboard.enable(timestep) 96 | print("Select the 3D window and control the robot using the W, A, S, D keys.") 97 | 98 | #LIDAR INITIALIZATION 99 | lidar = robot.getLidar("lidar") 100 | lidar.enable(timestep) 101 | 102 | 103 | #DISPLAY INITIALIZATION 104 | i = 0 105 | display = robot.getDisplay("extra_display") 106 | grapher = Grapher(display) 107 | while robot.step(timestep) != -1: 108 | i += 1 109 | #HANDLING LIDAR IMAGE ACQUISITION 110 | imageArray = np.array(lidar.getRangeImageArray()).T 111 | 112 | #HANDLING KEYBOARD BEHAVIOUR 113 | ascii_val = keyboard.getKey() 114 | if(ascii_val == -1): 115 | left_motor.setVelocity(0) 116 | right_motor.setVelocity(0) 117 | else: 118 | key = chr(ascii_val).lower() 119 | if(key == 'w'): 120 | left_motor.setVelocity(VELOCITY) 121 | right_motor.setVelocity(VELOCITY) 122 | elif(key == 's'): 123 | left_motor.setVelocity(-VELOCITY) 124 | right_motor.setVelocity(-VELOCITY) 125 | elif(key == 'a'): 126 | left_motor.setVelocity(-VELOCITY) 127 | right_motor.setVelocity(VELOCITY) 128 | elif(key == 'd'): 129 | left_motor.setVelocity(VELOCITY) 130 | right_motor.setVelocity(-VELOCITY) 131 | #PLOTTING LIDAR DATA 132 | if(i % PLOT_UPDATE_RATE == 0): 133 | theta_data = lidar_filter(imageArray, SIZES,RANGES,EPSILON) 134 | x_data = [] 135 | y_data = [] 136 | for theta in range(len(theta_data)): 137 | x_data.append(-theta_data[theta]*np.cos(2*np.pi*theta/len(theta_data) + np.pi/2)) 138 | y_data.append(theta_data[theta]*np.sin(2*np.pi*theta/len(theta_data) + np.pi/2)) 139 | grapher.lidar_plot(x_data, y_data, DISPLAY_SCALING_FACTOR) 140 | -------------------------------------------------------------------------------- /controllers/odometry_simple_teleop/odometry_simple_teleop.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.6 2 | 3 | from controller import Robot, Motor, PositionSensor, Keyboard, DistanceSensor, InertialUnit 4 | import numpy as np 5 | #INITIALIZATION CODE HERE. 6 | 7 | VELOCITY = 30 8 | WHEEL_RADIUS = 0.0075 9 | #ROBOT INITIALIZATION 10 | robot = Robot() 11 | timestep = int(robot.getBasicTimeStep()) 12 | 13 | 14 | #MOTOR AND ENCODER INITIALIZATION 15 | left_motor = robot.getMotor("left motor") 16 | right_motor = robot.getMotor("right motor") 17 | 18 | left_motor_sensor = left_motor.getPositionSensor() 19 | right_motor_sensor = right_motor.getPositionSensor() 20 | 21 | left_motor_sensor.enable(timestep) 22 | right_motor_sensor.enable(timestep) 23 | 24 | left_motor.setPosition(float('inf')) 25 | right_motor.setPosition(float('inf')) 26 | 27 | #KEYBOARD INITIALIZATION 28 | keyboard = Keyboard() 29 | keyboard.enable(timestep) 30 | print("Select the 3D window and control the robot using the W, A, S, D keys.") 31 | 32 | 33 | #INERTIAL UNIT INITIALIZATION 34 | inertial_unit = robot.getInertialUnit("inertial unit") 35 | inertial_unit.enable(timestep) 36 | 37 | #ODOMETRY INITIALIZATION 38 | _, _, alpha = inertial_unit.getRollPitchYaw() 39 | x = 0 40 | z = 0 41 | DTHETA_L = 0 42 | DTHETA_R = 0 43 | THETA_L_PREV = left_motor_sensor.getValue() 44 | THETA_R_PREV = right_motor_sensor.getValue() 45 | distance = 0 46 | 47 | while robot.step(timestep) != -1: 48 | #HANDLING KEYBOARD BEHAVIOUR 49 | ascii_val = keyboard.getKey() 50 | if(ascii_val == -1): 51 | left_motor.setVelocity(0) 52 | right_motor.setVelocity(0) 53 | else: 54 | key = chr(ascii_val).lower() 55 | if(key == 'w'): 56 | left_motor.setVelocity(VELOCITY) 57 | right_motor.setVelocity(VELOCITY) 58 | elif(key == 's'): 59 | left_motor.setVelocity(-VELOCITY) 60 | right_motor.setVelocity(-VELOCITY) 61 | elif(key == 'a'): 62 | left_motor.setVelocity(-VELOCITY) 63 | right_motor.setVelocity(VELOCITY) 64 | elif(key == 'd'): 65 | left_motor.setVelocity(VELOCITY) 66 | right_motor.setVelocity(-VELOCITY) 67 | 68 | #HANDLING INERTIAL UNIT BEHAVIOUR 69 | _, _, alpha = inertial_unit.getRollPitchYaw() 70 | DTHETA_L = left_motor_sensor.getValue() - THETA_L_PREV 71 | DTHETA_R = right_motor_sensor.getValue() - THETA_R_PREV 72 | THETA_L_PREV += DTHETA_L 73 | THETA_R_PREV += DTHETA_R 74 | if(key == 'w' or key == 's'): 75 | DTHETA = (DTHETA_L + DTHETA_R)/2 76 | x += WHEEL_RADIUS*DTHETA*np.sin(alpha) 77 | z += WHEEL_RADIUS*DTHETA*np.cos(alpha) 78 | distance += abs(WHEEL_RADIUS*DTHETA) 79 | print(x, z, alpha, distance) -------------------------------------------------------------------------------- /controllers/swarm_basic_flocking/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aniruddhkb/swarm_robotics_webots/e5127bc7a170050c911c1f91765ff473f9928af7/controllers/swarm_basic_flocking/__init__.py -------------------------------------------------------------------------------- /controllers/swarm_basic_flocking/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aniruddhkb/swarm_robotics_webots/e5127bc7a170050c911c1f91765ff473f9928af7/controllers/swarm_basic_flocking/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /controllers/swarm_basic_flocking/__pycache__/swarm_basic_flocking.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aniruddhkb/swarm_robotics_webots/e5127bc7a170050c911c1f91765ff473f9928af7/controllers/swarm_basic_flocking/__pycache__/swarm_basic_flocking.cpython-36.pyc -------------------------------------------------------------------------------- /controllers/swarm_basic_flocking/swarm_basic_flocking.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.6 2 | ''' 3 | This is the main controller for swarming behaviour of ChuhaLidarCamera. 4 | 5 | To modify the swarming behaviour, change the swarm_control function. 6 | 7 | The flow of code is as follows: 8 | 1) Enable all relevant devices and initialize global parameters. 9 | 2) Read and filter the LIDAR data 10 | 3) Categorize the LIDAR data 11 | 4) Obtain the positions of the neighbours from the LIDAR data 12 | 5) Swarm control 13 | 14 | There is an optional graphing module which writes to the extra Display device provided. 15 | The functionality to write to this Display is handled through the get_neighbours function. 16 | 17 | There is an optional teleoperational module. To use it, comment out the call to swarm_control and 18 | uncomment all the keyboard-related lines. 19 | ''' 20 | from controller import Robot, Motor, Lidar, Display, Keyboard 21 | import numpy as np 22 | #PLOTTING FUNCTIONS 23 | class Grapher: 24 | def __init__(self, display): 25 | ''' 26 | display: The display you wish to use with this. 27 | ''' 28 | self.display = display 29 | self.width = display.getWidth() 30 | self.height = display.getHeight() 31 | self.defaultPointSize = int((self.height + self.width)/200) 32 | def drawPointCorner(self, x, y, size=None, color=0x00FFFF): 33 | ''' 34 | Draws square points wrt the top right corner. The size is in pixels. 35 | ''' 36 | if(size is None): 37 | size = self.defaultPointSize 38 | self.display.setColor(color) 39 | for row in range(max(0, y - size//2), min(self.height, y + size//2)): 40 | for column in range(max(0, x - size//2), min(self.width, x + size//2)): 41 | self.display.drawPixel(column, row) 42 | def drawPointCenter(self, x, y, size=None, color=0x00FFFF): 43 | ''' 44 | Draws square points taking the center (width//2, height//2) to be 0, 0. 45 | ''' 46 | self.drawPointCorner(x + self.width//2, self.height//2-y, size, color) 47 | def drawPointsListCenter(self, x_s, y_s, size = None, color=0x00FFFF): 48 | ''' 49 | Draws points from two lists. If len_x != len_y, the trailing of x or y are truncated. 50 | ''' 51 | length = min(len(x_s), len(y_s)) 52 | for i in range(length): 53 | self.drawPointCenter(x_s[i], y_s[i], size, color) 54 | 55 | def clear(self, color=0x000000): 56 | self.display.setColor(color) 57 | self.display.fillRectangle(0, 0, self.width, self.height) 58 | 59 | def lidar_plot(self, x_data, y_data, DISPLAY_SCALING_FACTOR, color=0x00FFFF, size=5): 60 | self.clear() 61 | self.lidar_plot_without_clearing(x_data, y_data, DISPLAY_SCALING_FACTOR, color, size=5) 62 | def lidar_plot_without_clearing(self, x_data, y_data, DISPLAY_SCALING_FACTOR, color=0x00FFFF, size=5): 63 | x_s = [] 64 | y_s = [] 65 | for i in range(len(x_data)): 66 | x_s.append(int(x_data[i]*DISPLAY_SCALING_FACTOR)) 67 | y_s.append(int(y_data[i]*DISPLAY_SCALING_FACTOR)) 68 | # self.drawPointCenter(0, 0, color=0xFF0000) 69 | self.drawPointsListCenter(x_s, y_s, size=size,color=color) 70 | def lidar_filter(imageArray, SIZES,RANGES,EPSILON): 71 | ''' 72 | To extract the detected shapes from the raw LIDAR data. This is done by comparing 73 | the detected range with the default detected range for that layer when no object is there. 74 | To make the detection more strict, increase EPSILON. This will decrease false negatives but 75 | will also decrease the detection range. To increase the detection range, decrease EPSILON. 76 | This may introduce more noise. 77 | ''' 78 | theta_data = np.zeros((SIZES[1],)).tolist() 79 | for layer in range(SIZES[0]): 80 | for theta in range(SIZES[1]): 81 | point_range = imageArray[layer][theta] 82 | if(point_range < RANGES[layer]*(EPSILON)): 83 | theta_data[theta] = point_range 84 | return theta_data 85 | def get_theta_data_aligned(lidar, SIZES, RANGES, EPSILON): 86 | ''' 87 | To get the LIDAR data in terms of right-handed r, theta. The robot's motion is 88 | along the y axis but the LIDAR data's 'zero' of theta is at the +ve X axis. 89 | ''' 90 | imageArray = np.array(lidar.getRangeImageArray()).T 91 | theta_data = lidar_filter(imageArray, SIZES,RANGES,EPSILON) 92 | theta_data_aligned = [] 93 | for theta in range(len(theta_data)): 94 | new_theta =(+np.pi/2 - 2*np.pi*theta/SIZES[1]) 95 | if(theta_data[theta] != 0): 96 | theta_data_aligned.append((new_theta, theta_data[theta])) 97 | return theta_data_aligned 98 | def get_theta_data_colored(theta_data_aligned, DELTA_THETA, DELTA_R): 99 | ''' 100 | To categorize the data points on the basis of which robot they belong to. The logic being 101 | that points which are very close to each other are likely to belong to the same robot. 102 | If two robots are being detected where there ought to be one, increase DELTA_THETA or DELTA_R. 103 | If one robot is being detected where there are two, decrease DELTA_THETA or DELTA_R. 104 | ''' 105 | theta_data_colored = [[]] 106 | theta_prev = None 107 | r_prev = None 108 | for theta, r in theta_data_aligned: 109 | if(not(theta_prev is None and r_prev is None)): 110 | if(not (abs(theta_prev - theta) < DELTA_THETA and abs(r_prev - r) < DELTA_R/r)): 111 | theta_data_colored.append([]) 112 | theta_data_colored[-1].append((theta, r)) 113 | theta_prev = theta 114 | r_prev = r 115 | 116 | if(len(theta_data_colored[0]) > 0 and len(theta_data_colored) > 1): 117 | theta_prev, r_prev = theta_data_colored[0][0] 118 | theta, r = theta_data_colored[-1][-1] 119 | if(abs(theta_prev - theta - 2*np.pi) < DELTA_THETA and abs(r_prev - r) < DELTA_R/r): 120 | last_category = theta_data_colored.pop() 121 | theta_data_colored[0].extend(last_category) 122 | return theta_data_colored 123 | def get_neighbours(theta_data_colored,DISPLAY_SCALING_FACTOR=None,colors=None, grapher=None, shouldGraph=False): 124 | ''' 125 | To get the (x,y) of the neighbours of a robot (and, optionally, to plot to the relevant grapher). 126 | ''' 127 | neighbours_positions_x = [] 128 | neighbours_positions_y = [] 129 | if(shouldGraph): 130 | grapher.clear() 131 | color_index = 0 132 | for obstacle in theta_data_colored: 133 | if(len(obstacle) > 0): 134 | #PLOTTING ALL POINTS 135 | x_data = [] 136 | y_data = [] 137 | for theta, r in obstacle: 138 | x_data.append(r*np.cos(theta)) 139 | y_data.append(r*np.sin(theta)) 140 | x_mean = sum(x_data)/len(x_data) 141 | y_mean = sum(y_data)/len(y_data) 142 | neighbours_positions_x.append(x_mean) 143 | neighbours_positions_y.append(y_mean) 144 | if(shouldGraph): 145 | grapher.drawPointCenter(0, 0, size=5, color=0xFFFFFF) 146 | grapher.lidar_plot_without_clearing(x_data, y_data, DISPLAY_SCALING_FACTOR, color=colors[color_index]) 147 | color_index = (color_index + 1)%len(colors) 148 | if(shouldGraph): 149 | grapher.lidar_plot_without_clearing(neighbours_positions_x, neighbours_positions_y,DISPLAY_SCALING_FACTOR, size=10, color=0x808080) 150 | return neighbours_positions_x, neighbours_positions_y 151 | def swarm_control(neighbours_positions_x, neighbours_positions_y, left_motor, right_motor, VELOCITY): 152 | ''' 153 | The swarming behaviour is driven through this function. Modify it for different behaviour. 154 | ''' 155 | LINEAR_FACTOR = 0.8*VELOCITY 156 | ANGULAR_FACTOR = 0.2*VELOCITY/np.pi 157 | if(len(neighbours_positions_x) > 0): 158 | mean_x = sum(neighbours_positions_x)/len(neighbours_positions_x) 159 | mean_y = sum(neighbours_positions_y)/len(neighbours_positions_y) 160 | angle = np.arctan2(mean_x, mean_y) 161 | distance = np.sqrt(mean_x**2 + mean_y**2) 162 | left_motor.setVelocity(distance*LINEAR_FACTOR + angle*ANGULAR_FACTOR) 163 | right_motor.setVelocity(distance*LINEAR_FACTOR - angle*ANGULAR_FACTOR) 164 | def teleoperation(keyboard, left_motor, right_motor, VELOCITY): 165 | ''' 166 | To teleoperate the robot using the keyboard's WASD keys. 167 | ''' 168 | ascii_val = keyboard.getKey() 169 | if(ascii_val == -1): 170 | left_motor.setVelocity(0) 171 | right_motor.setVelocity(0) 172 | else: 173 | key = chr(ascii_val).lower() 174 | if(key == 'w'): 175 | left_motor.setVelocity(VELOCITY) 176 | right_motor.setVelocity(VELOCITY) 177 | elif(key == 's'): 178 | left_motor.setVelocity(-VELOCITY) 179 | right_motor.setVelocity(-VELOCITY) 180 | elif(key == 'a'): 181 | left_motor.setVelocity(-VELOCITY) 182 | right_motor.setVelocity(VELOCITY) 183 | elif(key == 'd'): 184 | left_motor.setVelocity(VELOCITY) 185 | right_motor.setVelocity(-VELOCITY) 186 | 187 | if __name__ == "__main__": 188 | #ROBOT INITIALIZATION 189 | robot = Robot() 190 | timestep = int(robot.getBasicTimeStep()) 191 | 192 | #LIDAR INITIALIZATION 193 | lidar = robot.getLidar("lidar") 194 | lidar.enable(timestep) 195 | ranges_str = "1.13114178 0.85820043 0.57785118 0.43461093 0.38639969 0.31585345 0.2667459 0.23062678 0.21593061 0.19141567 0.17178488 0.15571462 0.14872716 0.13643947 0.12597121 0.11696267" 196 | RANGES = [float(i) for i in ranges_str.split(' ')] 197 | SIZES = (16, 512) 198 | EPSILON = 0.6 199 | 200 | #GRAPHER INITIALIZATION 201 | DISPLAY_SIZE = (1024, 1024) 202 | DISPLAY_SCALING_FACTOR = 1024/RANGES[0] 203 | display = robot.getDisplay("extra_display") 204 | grapher = Grapher(display) 205 | colors = [0xFF0000, 0x800000, 0xFFFF00, 0x808000, 0x00FF00,0x008000, 0x00FFFF, 0x008080, 0x0000FF, 0x000080, 0xFF00FF, 0x800080] 206 | 207 | #MOTOR INITIALIZATION 208 | VELOCITY = 60 209 | left_motor = robot.getMotor("left motor") 210 | right_motor = robot.getMotor("right motor") 211 | left_motor.setPosition(float('inf')) 212 | right_motor.setPosition(float('inf')) 213 | left_motor.setVelocity(0) 214 | right_motor.setVelocity(0) 215 | 216 | #KEYBOARD INITIALIZATION 217 | # keyboard = Keyboard() 218 | # keyboard.enable(timestep) 219 | # print("Select the 3D window and control the robot using the W, A, S, D keys.") 220 | 221 | #NEIGHBOURS DETECTION INITIALIZATION 222 | DELTA_THETA = 0.1 223 | DELTA_R = 0.02 224 | 225 | while robot.step(timestep) != -1: 226 | theta_data_aligned = get_theta_data_aligned(lidar, SIZES, RANGES, EPSILON) #To read and filter the LIDAR data 227 | theta_data_colored = get_theta_data_colored(theta_data_aligned, DELTA_THETA, DELTA_R) #To categorize the LIDAR points into groups 228 | neighbours_positions_x, neighbours_positions_y = get_neighbours(theta_data_colored) #To get the x, y of the neighbours 229 | 230 | swarm_control(neighbours_positions_x, neighbours_positions_y, left_motor, right_motor, VELOCITY) 231 | #To control the behaviour of the robot based on the relative positions of its neighbours. 232 | 233 | # teleoperation(keyboard, left_motor, right_motor, VELOCITY) 234 | -------------------------------------------------------------------------------- /controllers/swarm_flocking_anticollision/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aniruddhkb/swarm_robotics_webots/e5127bc7a170050c911c1f91765ff473f9928af7/controllers/swarm_flocking_anticollision/__init__.py -------------------------------------------------------------------------------- /controllers/swarm_flocking_anticollision/swarm_flocking_anticollision.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.6 2 | 3 | from controller import Robot, Motor, Lidar, Display, Keyboard 4 | import numpy as np 5 | def swarm_control_anticollide(neighbours_positions_x, neighbours_positions_y, left_motor, right_motor, VELOCITY, name): 6 | LINEAR_FACTOR = 3*VELOCITY 7 | ANGULAR_FACTOR = 6*VELOCITY 8 | FILTER_DISTANCE = 0.10 9 | COLLISION_WEIGHT = 10 10 | FOLLOWING_WEIGHT = 15 11 | n = len(neighbours_positions_x) 12 | chosen_x = 0 13 | chosen_y = 0 14 | if(n > 0): 15 | for i in range(n): 16 | curr_x, curr_y = neighbours_positions_x[i], neighbours_positions_y[i] 17 | if(np.sqrt(curr_x**2 +curr_y**2) < FILTER_DISTANCE): 18 | if(curr_y > 0): 19 | new_x= -abs(curr_x)/curr_x*abs(COLLISION_WEIGHT/(curr_y + 0.000001*np.random.rand(1))) 20 | new_y= -abs(COLLISION_WEIGHT/(curr_x + 0.000001*np.random.rand(1))) 21 | else: 22 | new_x = -COLLISION_WEIGHT/(curr_x + 0.000001*np.random.rand(1)) 23 | new_y= -COLLISION_WEIGHT/(curr_y + 0.000001*np.random.rand(1)) 24 | chosen_x += new_x 25 | chosen_y += new_y 26 | else: 27 | chosen_x += FOLLOWING_WEIGHT*curr_x 28 | chosen_y += FOLLOWING_WEIGHT*curr_y 29 | chosen_x = (chosen_x)/n 30 | chosen_y = (chosen_y)/n 31 | angle = np.arctan2(chosen_x, chosen_y) 32 | distance = min(np.sqrt(chosen_x**2 + chosen_y**2), 10) 33 | left_velocity = np.sqrt(distance)*LINEAR_FACTOR + angle*ANGULAR_FACTOR*abs(angle)*abs(angle) 34 | right_velocity = np.sqrt(distance)*LINEAR_FACTOR - angle*ANGULAR_FACTOR*abs(angle)*abs(angle) 35 | while(abs(left_velocity) > VELOCITY or abs(right_velocity) > VELOCITY): 36 | left_velocity = left_velocity/2 37 | right_velocity = right_velocity/2 38 | left_motor.setVelocity(float(left_velocity)) 39 | right_motor.setVelocity(float(right_velocity)) 40 | if __name__ == "__main__": 41 | import sys, os 42 | sys.path.insert(0, os.path.abspath('..')) 43 | from swarm_basic_flocking.swarm_basic_flocking import * 44 | if __name__ == "__main__": 45 | #ROBOT INITIALIZATION 46 | robot = Robot() 47 | timestep = int(robot.getBasicTimeStep()) 48 | name = robot.getName() 49 | #LIDAR INITIALIZATION 50 | lidar = robot.getLidar("lidar") 51 | lidar.enable(timestep) 52 | ranges_str = "1.13114178 0.85820043 0.57785118 0.43461093 0.38639969 0.31585345 0.2667459 0.23062678 0.21593061 0.19141567 0.17178488 0.15571462 0.14872716 0.13643947 0.12597121 0.11696267" 53 | RANGES = [float(i) for i in ranges_str.split(' ')] 54 | SIZES = (16, 512) 55 | EPSILON = 0.6 56 | 57 | #GRAPHER INITIALIZATION 58 | DISPLAY_SIZE = (1024, 1024) 59 | DISPLAY_SCALING_FACTOR = 1024/RANGES[0] 60 | display = robot.getDisplay("extra_display") 61 | grapher = Grapher(display) 62 | colors = [0xFF0000, 0x800000, 0xFFFF00, 0x808000, 0x00FF00,0x008000, 0x00FFFF, 0x008080, 0x0000FF, 0x000080, 0xFF00FF, 0x800080] 63 | 64 | #MOTOR INITIALIZATION 65 | VELOCITY = 60 66 | left_motor = robot.getMotor("left motor") 67 | right_motor = robot.getMotor("right motor") 68 | left_motor.setPosition(float('inf')) 69 | right_motor.setPosition(float('inf')) 70 | left_motor.setVelocity(0) 71 | right_motor.setVelocity(0) 72 | 73 | #KEYBOARD INITIALIZATION 74 | # keyboard = Keyboard() 75 | # keyboard.enable(timestep) 76 | # print("Select the 3D window and control the robot using the W, A, S, D keys.") 77 | 78 | #NEIGHBOURS DETECTION INITIALIZATION 79 | DELTA_THETA = 0.1 80 | DELTA_R = 0.02 81 | 82 | while robot.step(timestep) != -1: 83 | theta_data_aligned = get_theta_data_aligned(lidar, SIZES, RANGES, EPSILON) #To read and filter the LIDAR data 84 | theta_data_colored = get_theta_data_colored(theta_data_aligned, DELTA_THETA, DELTA_R) #To categorize the LIDAR points into groups 85 | neighbours_positions_x, neighbours_positions_y = get_neighbours(theta_data_colored,DISPLAY_SCALING_FACTOR, colors, grapher, shouldGraph=False) #To get the x, y of the neighbours 86 | swarm_control_anticollide(neighbours_positions_x, neighbours_positions_y, left_motor, right_motor, VELOCITY, name) -------------------------------------------------------------------------------- /controllers/teleoperator/teleoperator.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.6 2 | 3 | from controller import Robot, Motor, PositionSensor, Keyboard, DistanceSensor 4 | 5 | #INITIALIZATION CODE HERE. 6 | 7 | VELOCITY = 60 8 | 9 | #ROBOT INITIALIZATION 10 | robot = Robot() 11 | timestep = int(robot.getBasicTimeStep()) 12 | 13 | 14 | #MOTOR AND ENCODER INITIALIZATION 15 | left_motor = robot.getMotor("left motor") 16 | right_motor = robot.getMotor("right motor") 17 | 18 | left_motor_sensor = left_motor.getPositionSensor() 19 | right_motor_sensor = right_motor.getPositionSensor() 20 | 21 | left_motor_sensor.enable(timestep) 22 | right_motor_sensor.enable(timestep) 23 | 24 | left_motor_init = left_motor_sensor.getValue() 25 | right_motor_init = right_motor_sensor.getValue() 26 | 27 | left_motor.setPosition(float('inf')) 28 | right_motor.setPosition(float('inf')) 29 | 30 | #KEYBOARD INITIALIZATION 31 | keyboard = Keyboard() 32 | keyboard.enable(timestep) 33 | print("Select the 3D window and control the robot using the W, A, S, D keys.") 34 | 35 | while robot.step(timestep) != -1: 36 | #HANDLING KEYBOARD BEHAVIOUR 37 | ascii_val = keyboard.getKey() 38 | if(ascii_val == -1): 39 | left_motor.setVelocity(0) 40 | right_motor.setVelocity(0) 41 | else: 42 | key = chr(ascii_val).lower() 43 | if(key == 'w'): 44 | left_motor.setVelocity(VELOCITY) 45 | right_motor.setVelocity(VELOCITY) 46 | elif(key == 's'): 47 | left_motor.setVelocity(-VELOCITY) 48 | right_motor.setVelocity(-VELOCITY) 49 | elif(key == 'a'): 50 | left_motor.setVelocity(-VELOCITY) 51 | right_motor.setVelocity(VELOCITY) 52 | elif(key == 'd'): 53 | left_motor.setVelocity(VELOCITY) 54 | right_motor.setVelocity(-VELOCITY) 55 | -------------------------------------------------------------------------------- /protos/.ChuhaBasic.cache: -------------------------------------------------------------------------------- 1 | Webots Proto Cache File version 1.5 2 | protoFileHash: f69b0671dd8a98616973cae30b24ee1b 3 | needsRobotAncestor: 1 4 | baseType: Robot 5 | slotType: 6 | parameters: translation,rotation,controller,name 7 | tags: 8 | license: 9 | licenseUrl: 10 | documentationUrl: 11 | info: 12 | -------------------------------------------------------------------------------- /protos/.ChuhaLidarCamera.cache: -------------------------------------------------------------------------------- 1 | Webots Proto Cache File version 1.5 2 | protoFileHash: fb4daf21b20f4f221595a37c03309aa9 3 | needsRobotAncestor: 1 4 | baseType: Robot 5 | slotType: 6 | parameters: translation,rotation,controller,name 7 | tags: 8 | license: 9 | licenseUrl: 10 | documentationUrl: 11 | info: 12 | -------------------------------------------------------------------------------- /protos/ChuhaBasic.proto: -------------------------------------------------------------------------------- 1 | PROTO ChuhaBasic[ 2 | field SFVec3f translation 0 0 0 3 | field SFRotation rotation 0 1 0 0 4 | field SFString controller "teleoperator" 5 | field SFString name "ChuhaBasic" 6 | ] 7 | { 8 | Robot { 9 | translation IS translation 10 | rotation IS rotation 11 | children [ 12 | InertialUnit { 13 | translation 0 0.0075 0 14 | children [ 15 | Shape { 16 | appearance PBRAppearance { 17 | baseColor 0 0.5 0 18 | roughness 1 19 | } 20 | geometry Box { 21 | size 0.01 0.005 0.01 22 | } 23 | } 24 | ] 25 | boundingObject Shape { 26 | appearance PBRAppearance { 27 | baseColor 0 0.5 0 28 | roughness 1 29 | } 30 | geometry Box { 31 | size 0.01 0.005 0.01 32 | } 33 | } 34 | } 35 | HingeJoint { 36 | jointParameters HingeJointParameters { 37 | position 12111.798766791255 38 | anchor 0.035 0 0 39 | } 40 | device [ 41 | PositionSensor { 42 | name "left motor sensor" 43 | } 44 | RotationalMotor { 45 | name "left motor" 46 | maxVelocity 60 47 | maxTorque 0.05 48 | } 49 | ] 50 | endPoint Solid { 51 | translation 0.035 0 0 52 | rotation 0.4299887497348286 -0.4299903291745988 0.7938627034429816 1.7996212937721852 53 | children [ 54 | DEF WHEEL_SHAPE Shape { 55 | appearance PBRAppearance { 56 | baseColor 0 0 0 57 | roughness 1 58 | metalness 0 59 | } 60 | geometry Cylinder { 61 | height 0.005 62 | radius 0.0075 63 | } 64 | } 65 | ] 66 | name "LeftWheelSolid" 67 | boundingObject USE WHEEL_SHAPE 68 | physics DEF WHEEL_PHY Physics { 69 | mass 0.05 70 | } 71 | } 72 | } 73 | HingeJoint { 74 | jointParameters HingeJointParameters { 75 | position 8452.243064935557 76 | anchor -0.055 0 0 77 | } 78 | device [ 79 | PositionSensor { 80 | name "right motor sensor" 81 | } 82 | RotationalMotor { 83 | name "right motor" 84 | maxVelocity 60 85 | maxTorque 0.05 86 | } 87 | ] 88 | endPoint Solid { 89 | translation -0.03500000000000002 0 0 90 | rotation 0.07055549579599536 -0.0705557549612782 -0.9950094509374396 4.707382284657794 91 | children [ 92 | USE WHEEL_SHAPE 93 | ] 94 | name "RightWheelSolid" 95 | boundingObject USE WHEEL_SHAPE 96 | physics USE WHEEL_PHY 97 | } 98 | } 99 | DEF CHASSIS_SHAPE Shape { 100 | appearance PBRAppearance { 101 | baseColor 0.7 0 0 102 | metalness 0.7 103 | } 104 | geometry Cylinder { 105 | height 0.0149 106 | radius 0.03 107 | } 108 | } 109 | ] 110 | name IS name 111 | boundingObject USE CHASSIS_SHAPE 112 | physics Physics { 113 | } 114 | controller IS controller 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /protos/ChuhaLidarCamera.proto: -------------------------------------------------------------------------------- 1 | PROTO ChuhaLidarCamera[ 2 | field SFVec3f translation 0 0 0 3 | field SFRotation rotation 0 1 0 0 4 | field SFString controller "lidar_camera_controller" 5 | field SFString name "ChuhaLidarCamera" 6 | ] 7 | { 8 | Robot { 9 | translation IS translation 10 | rotation IS rotation 11 | children [ 12 | InertialUnit { 13 | translation 0 0.0075 0 14 | children [ 15 | Shape { 16 | appearance PBRAppearance { 17 | baseColor 0 0.5 0 18 | roughness 1 19 | } 20 | geometry Box { 21 | size 0.01 0.005 0.01 22 | } 23 | } 24 | ] 25 | boundingObject Shape { 26 | appearance PBRAppearance { 27 | baseColor 0 0.5 0 28 | roughness 1 29 | } 30 | geometry Box { 31 | size 0.01 0.005 0.01 32 | } 33 | } 34 | } 35 | 36 | 37 | Display { 38 | name "extra_display" 39 | width 1024 40 | height 1024 41 | } 42 | Lidar { 43 | translation 0 0.02 0 44 | rotation 0 0.9999999999999999 0 3.14 45 | children [ 46 | DEF LIDAR_SHAPE Shape { 47 | appearance PBRAppearance { 48 | baseColor 0 0 1 49 | } 50 | geometry Box { 51 | size 0.005 0.005 0.005 52 | } 53 | } 54 | ] 55 | boundingObject USE LIDAR_SHAPE 56 | physics Physics { 57 | } 58 | rotationStep 0.262 59 | tiltAngle -0.12 60 | fieldOfView 0.3 61 | verticalFieldOfView 0.3 62 | numberOfLayers 16 63 | maxRange 6 64 | type "rotating" 65 | } 66 | Camera { 67 | translation 0 0 0.03 68 | rotation 0 1 0 -3.14 69 | children [ 70 | USE LIDAR_SHAPE 71 | ] 72 | name "front_camera" 73 | boundingObject USE LIDAR_SHAPE 74 | physics Physics { 75 | } 76 | fieldOfView 2 77 | width 256 78 | height 256 79 | far 10 80 | } 81 | Camera { 82 | translation 0 0 -0.03 83 | children [ 84 | USE LIDAR_SHAPE 85 | ] 86 | name "rear_camera" 87 | boundingObject USE LIDAR_SHAPE 88 | physics Physics { 89 | } 90 | fieldOfView 2 91 | width 256 92 | height 256 93 | far 10 94 | } 95 | DEF CHASSIS_GROUP Group { 96 | children [ 97 | Transform { 98 | translation 0 0.0125 0 99 | children [ 100 | Shape { 101 | appearance PBRAppearance { 102 | baseColor 0.5 0.5 0.5 103 | roughness 0.5 104 | } 105 | geometry Cylinder { 106 | height 0.01 107 | radius 0.0025 108 | } 109 | } 110 | ] 111 | } 112 | DEF CHASSIS_SHAPE Shape { 113 | appearance PBRAppearance { 114 | baseColor 0.7 0 0 115 | metalness 0.7 116 | } 117 | geometry Cylinder { 118 | height 0.0148 119 | radius 0.03 120 | } 121 | } 122 | ] 123 | } 124 | HingeJoint { 125 | jointParameters HingeJointParameters { 126 | position 15509.328167523308 127 | anchor 0.035 0 0 128 | } 129 | device [ 130 | PositionSensor { 131 | name "left motor sensor" 132 | } 133 | RotationalMotor { 134 | name "left motor" 135 | maxVelocity 60 136 | maxTorque 0.05 137 | } 138 | ] 139 | endPoint Solid { 140 | translation 0.034999999740545906 4.441317810577016e-05 3.3220518961824615e-05 141 | rotation -0.5145628085168344 0.5145646983648784 0.685892329223712 1.9392063890708489 142 | children [ 143 | DEF WHEEL_SHAPE Shape { 144 | appearance PBRAppearance { 145 | baseColor 0 0 0 146 | roughness 1 147 | metalness 0 148 | } 149 | geometry Cylinder { 150 | height 0.005 151 | radius 0.0075 152 | } 153 | } 154 | ] 155 | name "LeftWheelSolid" 156 | boundingObject USE WHEEL_SHAPE 157 | physics DEF WHEEL_PHY Physics { 158 | mass 0.05 159 | } 160 | linearVelocity -4.73758806586831e-14 -5.329922243970475e-17 3.2517204535840234e-12 161 | angularVelocity 4.782665303418598e-10 9.831708220638956e-11 9.424226300844859e-11 162 | } 163 | } 164 | HingeJoint { 165 | jointParameters HingeJointParameters { 166 | position 12142.621981233602 167 | anchor -0.055 0 0 168 | } 169 | device [ 170 | PositionSensor { 171 | name "right motor sensor" 172 | } 173 | RotationalMotor { 174 | name "right motor" 175 | maxVelocity 60 176 | maxTorque 0.05 177 | } 178 | ] 179 | endPoint Solid { 180 | translation -0.03500000038240844 -4.006410831159118e-05 -3.79618322983081e-05 181 | rotation -0.37995902000756615 0.3799600802457111 -0.8433631960991437 4.542846992722221 182 | children [ 183 | USE WHEEL_SHAPE 184 | ] 185 | name "RightWheelSolid" 186 | boundingObject USE WHEEL_SHAPE 187 | physics USE WHEEL_PHY 188 | linearVelocity 1.2849540122794136e-12 1.4210429149900828e-16 -3.4575087257549416e-12 189 | angularVelocity -5.524789169315991e-10 9.708295955206789e-11 -1.0918609784069085e-10 190 | } 191 | } 192 | ] 193 | name IS name 194 | boundingObject USE CHASSIS_GROUP 195 | physics Physics { 196 | mass 0.3 197 | } 198 | controller IS controller 199 | linearVelocity 6.232266328806033e-13 -2.0166048513873838e-14 -1.2471853620901518e-13 200 | angularVelocity 6.776746323111518e-13 9.773333527674542e-11 2.2766058360531475e-14 201 | } 202 | } 203 | -------------------------------------------------------------------------------- /pull_request_template.md: -------------------------------------------------------------------------------- 1 | NEW SCENARIO IMPLEMENTED in WORLD(s) <...> and CONTROLLER(s) <...> 2 | 3 | 4 | 5 | 6 | [PENDING REFACTORING](If refactoring needed) 7 | 8 | (----------OR---------------) 9 | 10 | 11 | NEW ROBOT IMPLEMENTED in PROTO(s) <...>, WORLD(s) <...> and CONTROLLER(s) <...> 12 | 13 | 14 | 15 | 16 | [PENDING REFACTORING](If refactoring needed) 17 | 18 | (----------------------OR-------------------) 19 | 20 | CHANGES MADE in PROTO(s) <...>, WORLD(s) <...> and CONTROLLER(s) <...> 21 | 22 | [BUG FIXED ] 23 | 24 | 25 | [NEW FEATURE ADDED ] 26 | 27 | 28 | TESTED AGAINST WORLD(s) <...> and CONTROLLERS(s) <...> 29 | -------------------------------------------------------------------------------- /worlds/.basic_SLAM_simple.wbproj: -------------------------------------------------------------------------------- 1 | Webots Project File version R2020b 2 | perspectives: 000000ff00000000fd00000003000000000000000000000000fc0100000001fb0000001a0044006f00630075006d0065006e0074006100740069006f006e0000000000ffffffff0000006900ffffff000000010000011c000002a0fc0200000001fb0000001400540065007800740045006400690074006f0072000000001a000002a00000003f00ffffff000000030000078000000039fc0100000001fb0000001a0043006f006e0073006f006c00650041006c006c0041006c006c0100000000000007800000006900ffffff000007800000034000000001000000020000000100000008fc00000000 3 | simulationViewPerspectives: 000000ff0000000100000002000000000000077e0100000002010000000100 4 | sceneTreePerspectives: 000000ff000000010000000200000272000000fa0100000002010000000200 5 | maximizedDockId: -1 6 | centralWidgetVisible: 1 7 | orthographicViewHeight: 1 8 | textFiles: -1 9 | consoles: Console:All:All 10 | renderingDevicePerspectives: ChuhaLidarCamera:rear_camera;1;1;0;0 11 | renderingDevicePerspectives: ChuhaLidarCamera:front_camera;1;1;0;0 12 | renderingDevicePerspectives: ChuhaLidarCamera:extra_display;1;0.754883;0;0 13 | -------------------------------------------------------------------------------- /worlds/.chuha_definitions.wbproj: -------------------------------------------------------------------------------- 1 | Webots Project File version R2020b 2 | perspectives: 000000ff00000000fd00000003000000000000000000000000fc0100000001fb0000001a0044006f00630075006d0065006e0074006100740069006f006e0000000000ffffffff0000006900ffffff0000000100000681000002a0fc0200000001fb0000001400540065007800740045006400690074006f0072000000001a000002a00000003f00ffffff0000000300000780000000b2fc0100000001fb0000001a0043006f006e0073006f006c00650041006c006c0041006c006c0100000000000007800000006900ffffff00000780000002c700000001000000020000000100000008fc00000000 3 | simulationViewPerspectives: 000000ff0000000100000002000001aa000005d40100000002010000000100 4 | sceneTreePerspectives: 000000ff000000010000000200000272000000fa0100000002010000000200 5 | maximizedDockId: -1 6 | centralWidgetVisible: 1 7 | orthographicViewHeight: 1 8 | textFiles: -1 9 | globalOptionalRendering: ContactPoints::CoordinateSystem::LidarPointClouds 10 | consoles: Console:All:All 11 | renderingDevicePerspectives: ChuhaCameraLidar:extra_display;0;0.276367;0;0 12 | renderingDevicePerspectives: ChuhaCameraLidar:front_camera;0;1.00391;0;0.0603589 13 | renderingDevicePerspectives: ChuhaCameraLidar:camera;1;1;0;0 14 | renderingDevicePerspectives: ChuhaCameraLidar:rear_camera;0;1;0;0 15 | -------------------------------------------------------------------------------- /worlds/.four_wheeled_robot.wbproj: -------------------------------------------------------------------------------- 1 | Webots Project File version R2020b 2 | perspectives: 000000ff00000000fd0000000300000000000000690000037bfc0100000002fb0000001e00480074006d006c0052006f0062006f007400570069006e0064006f00770000000000000000690000000000000000fb0000001a0044006f00630075006d0065006e0074006100740069006f006e0000000000ffffffff0000006900ffffff000000010000011c0000037bfc0200000001fb0000001400540065007800740045006400690074006f0072000000001a0000037b0000003f00ffffff000000030000078000000081fc0100000001fb0000001a0043006f006e0073006f006c00650041006c006c0041006c006c0100000000000007800000006900ffffff00000780000002f800000001000000020000000100000008fc00000000 3 | simulationViewPerspectives: 000000ff0000000100000002000001cd000004930100000002010000000100 4 | sceneTreePerspectives: 000000ff0000000100000002000001c70000013c0100000002010000000200 5 | minimizedPerspectives: 000000ff00000000fd0000000300000000000000690000037bfc0100000002fb0000001a0044006f00630075006d0065006e0074006100740069006f006e0000000000ffffffff0000006900fffffffb0000001e00480074006d006c0052006f0062006f007400570069006e0064006f00770100000000000000690000006900ffffff000000010000011c000002f8fc0200000001fb0000001400540065007800740045006400690074006f0072010000001a000002f80000003f00ffffff000000030000071500000081fc0100000001fb0000001a0043006f006e0073006f006c00650041006c006c0041006c006c010000006b000007150000006900ffffff000005f7000002f800000001000000020000000100000008fc00000000 6 | maximizedDockId: -1 7 | centralWidgetVisible: 1 8 | projectionMode: PERSPECTIVE 9 | orthographicViewHeight: 0.896983 10 | textFiles: -1 11 | globalOptionalRendering: CoordinateSystem::ContactPoints 12 | consoles: Console:All:All 13 | -------------------------------------------------------------------------------- /worlds/.lidar_collision_avoidance.wbproj: -------------------------------------------------------------------------------- 1 | Webots Project File version R2020b 2 | perspectives: 000000ff00000000fd00000003000000000000000000000000fc0100000001fb0000001a0044006f00630075006d0065006e0074006100740069006f006e0000000000ffffffff0000006900ffffff000000010000011c0000017afc0200000001fb0000001400540065007800740045006400690074006f0072000000001a0000017a0000003f00ffffff0000000300000780000000a3fc0100000001fb0000001a0043006f006e0073006f006c00650041006c006c0041006c006c0100000000000007800000006900ffffff00000780000002d600000001000000020000000100000008fc00000000 3 | simulationViewPerspectives: 000000ff00000001000000020000012e000006500100000002010000000100 4 | sceneTreePerspectives: 000000ff0000000100000002000000dc000000fa0100000002010000000200 5 | minimizedPerspectives: 000000ff00000000fd00000003000000000000000000000000fc0100000001fb0000001a0044006f00630075006d0065006e0074006100740069006f006e0000000000000000140000006900ffffff000000010000011c0000037bfc0200000001fb0000001400540065007800740045006400690074006f0072010000001a0000037b0000003f00ffffff0000000200000662000000d9fc0100000001fb0000001a0043006f006e0073006f006c00650041006c006c0041006c006c0100000000000006620000006900ffffff00000662000002a000000001000000020000000100000008fc00000000 6 | maximizedDockId: -1 7 | centralWidgetVisible: 1 8 | orthographicViewHeight: 1 9 | textFiles: -1 10 | globalOptionalRendering: CoordinateSystem::LidarPointClouds 11 | consoles: Console:All:All 12 | renderingDevicePerspectives: ChuhaLidarCamera:front_camera;0;1;0.108911;0.106447 13 | renderingDevicePerspectives: ChuhaLidarCamera:rear_camera;0;1;0;0 14 | renderingDevicePerspectives: ChuhaLidarCamera:extra_display;1;0.651367;0.586015;0 15 | -------------------------------------------------------------------------------- /worlds/.lidar_visualization.wbproj: -------------------------------------------------------------------------------- 1 | Webots Project File version R2020b 2 | perspectives: 000000ff00000000fd00000003000000000000000000000000fc0100000001fb0000001a0044006f00630075006d0065006e0074006100740069006f006e0000000000ffffffff0000006900ffffff0000000100000780000002a0fc0200000001fb0000001400540065007800740045006400690074006f0072000000001a000002a00000003f00ffffff000000030000078000000222fc0100000001fb0000001a0043006f006e0073006f006c00650041006c006c0041006c006c03000000000000035400000780000000a2000007800000037b00000001000000020000000100000008fc00000000 3 | simulationViewPerspectives: 000000ff0000000100000002000001000000057e0100000002010000000100 4 | sceneTreePerspectives: 000000ff0000000100000002000000fa000002440100000002010000000200 5 | maximizedDockId: -1 6 | centralWidgetVisible: 1 7 | orthographicViewHeight: 1 8 | textFiles: -1 9 | consoles: Console:All:All 10 | renderingDevicePerspectives: ChuhaLidarCamera:rear_camera;0;1;0;0 11 | renderingDevicePerspectives: ChuhaLidarCamera:extra_display;0;0.8125;0.400722;0 12 | renderingDevicePerspectives: ChuhaLidarCamera:front_camera;0;1;0;0 13 | -------------------------------------------------------------------------------- /worlds/.swarm_basic_flocking.wbproj: -------------------------------------------------------------------------------- 1 | Webots Project File version R2020b 2 | perspectives: 000000ff00000000fd00000003000000000000000000000000fc0100000001fb0000001a0044006f00630075006d0065006e0074006100740069006f006e0000000000ffffffff0000006900ffffff000000010000011c000002a0fc0200000001fb0000001400540065007800740045006400690074006f0072000000001a000002a00000003f00ffffff000000030000078000000039fc0100000001fb0000001a0043006f006e0073006f006c00650041006c006c0041006c006c0100000000000007800000006900ffffff000007800000034000000001000000020000000100000008fc00000000 3 | simulationViewPerspectives: 000000ff0000000100000002000000fa000006840100000002010000000100 4 | sceneTreePerspectives: 000000ff000000010000000200000272000000fa0100000002010000000200 5 | maximizedDockId: -1 6 | centralWidgetVisible: 1 7 | orthographicViewHeight: 1 8 | textFiles: -1 9 | consoles: Console:All:All 10 | renderingDevicePerspectives: ChuhaLidarCamera(6):extra_display;1;0.598633;0;0 11 | renderingDevicePerspectives: ChuhaLidarCamera(1):rear_camera;1;1;0;0 12 | renderingDevicePerspectives: ChuhaLidarCamera(10):extra_display;1;0.598633;0;0 13 | renderingDevicePerspectives: ChuhaLidarCamera(15):front_camera;1;1;0;0 14 | renderingDevicePerspectives: ChuhaLidarCamera(8):extra_display;1;0.598633;0;0 15 | renderingDevicePerspectives: ChuhaLidarCamera(5):front_camera;1;1;0;0 16 | renderingDevicePerspectives: ChuhaLidarCamera(9):front_camera;1;1;0;0 17 | renderingDevicePerspectives: ChuhaLidarCamera(13):extra_display;1;0.598633;0;0 18 | renderingDevicePerspectives: ChuhaLidarCamera(7):front_camera;1;1;0;0 19 | renderingDevicePerspectives: ChuhaLidarCamera(1):extra_display;1;0.598633;0;0 20 | renderingDevicePerspectives: ChuhaLidarCamera(15):rear_camera;1;1;0;0 21 | renderingDevicePerspectives: ChuhaLidarCamera(2):front_camera;1;1;0;0 22 | renderingDevicePerspectives: ChuhaLidarCamera(12):extra_display;1;0.598633;0;0 23 | renderingDevicePerspectives: ChuhaLidarCamera(3):rear_camera;1;1;0;0 24 | renderingDevicePerspectives: ChuhaLidarCamera(2):rear_camera;1;1;0;0 25 | renderingDevicePerspectives: ChuhaLidarCamera(17):front_camera;1;1;0;0 26 | renderingDevicePerspectives: ChuhaLidarCamera(6):front_camera;1;1;0;0 27 | renderingDevicePerspectives: ChuhaLidarCamera(17):rear_camera;1;1;0;0 28 | renderingDevicePerspectives: ChuhaLidarCamera(17):extra_display;1;0.598633;0;0 29 | renderingDevicePerspectives: ChuhaLidarCamera(13):rear_camera;1;1;0;0 30 | renderingDevicePerspectives: ChuhaLidarCamera(12):front_camera;1;1;0;0 31 | renderingDevicePerspectives: ChuhaLidarCamera(13):front_camera;1;1;0;0 32 | renderingDevicePerspectives: ChuhaLidarCamera(10):front_camera;1;1;0;0 33 | renderingDevicePerspectives: ChuhaLidarCamera(7):rear_camera;1;1;0;0 34 | renderingDevicePerspectives: ChuhaLidarCamera(11):extra_display;1;0.598633;0;0 35 | renderingDevicePerspectives: ChuhaLidarCamera(5):rear_camera;1;1;0;0 36 | renderingDevicePerspectives: ChuhaLidarCamera(14):rear_camera;1;1;0;0 37 | renderingDevicePerspectives: ChuhaLidarCamera(4):extra_display;1;0.598633;0;0 38 | renderingDevicePerspectives: ChuhaLidarCamera(15):extra_display;1;0.598633;0;0 39 | renderingDevicePerspectives: ChuhaLidarCamera:rear_camera;1;1;0;0 40 | renderingDevicePerspectives: ChuhaLidarCamera(4):front_camera;1;1;0;0 41 | renderingDevicePerspectives: ChuhaLidarCamera(8):front_camera;1;1;0;0 42 | renderingDevicePerspectives: ChuhaLidarCamera(9):rear_camera;1;1;0;0 43 | renderingDevicePerspectives: ChuhaLidarCamera(16):rear_camera;1;1;0;0 44 | renderingDevicePerspectives: ChuhaLidarCamera(3):extra_display;1;0.598633;0;0 45 | renderingDevicePerspectives: ChuhaLidarCamera(11):front_camera;1;1;0;0 46 | renderingDevicePerspectives: ChuhaLidarCamera:extra_display;1;0.598633;0;0 47 | renderingDevicePerspectives: ChuhaLidarCamera(8):rear_camera;1;1;0;0 48 | renderingDevicePerspectives: ChuhaLidarCamera(4):rear_camera;1;1;0;0 49 | renderingDevicePerspectives: ChuhaLidarCamera(3):front_camera;1;1;0;0 50 | renderingDevicePerspectives: ChuhaLidarCamera(14):extra_display;1;0.598633;0;0 51 | renderingDevicePerspectives: ChuhaLidarCamera(5):extra_display;1;0.598633;0;0 52 | renderingDevicePerspectives: ChuhaLidarCamera(14):front_camera;1;1;0;0 53 | renderingDevicePerspectives: ChuhaLidarCamera(12):rear_camera;1;1;0;0 54 | renderingDevicePerspectives: ChuhaLidarCamera:front_camera;1;1;0;0 55 | renderingDevicePerspectives: ChuhaLidarCamera(9):extra_display;1;0.598633;0;0 56 | renderingDevicePerspectives: ChuhaLidarCamera(16):extra_display;1;0.598633;0;0 57 | renderingDevicePerspectives: ChuhaLidarCamera(1):front_camera;1;1;0;0 58 | renderingDevicePerspectives: ChuhaLidarCamera(10):rear_camera;1;1;0;0 59 | renderingDevicePerspectives: ChuhaLidarCamera(16):front_camera;1;1;0;0 60 | renderingDevicePerspectives: ChuhaLidarCamera(2):extra_display;1;0.598633;0;0 61 | renderingDevicePerspectives: ChuhaLidarCamera(7):extra_display;1;0.598633;0;0 62 | renderingDevicePerspectives: ChuhaLidarCamera(6):rear_camera;1;1;0;0 63 | renderingDevicePerspectives: ChuhaLidarCamera(11):rear_camera;1;1;0;0 64 | -------------------------------------------------------------------------------- /worlds/.swarm_flocking_anticollision.wbproj: -------------------------------------------------------------------------------- 1 | Webots Project File version R2020b 2 | perspectives: 000000ff00000000fd00000003000000000000000000000000fc0100000001fb0000001a0044006f00630075006d0065006e0074006100740069006f006e0000000000ffffffff0000006900ffffff000000010000011c000002f0fc0200000001fb0000001400540065007800740045006400690074006f0072000000001a000002f00000003f00ffffff000000030000078000000039fc0100000001fb0000001a0043006f006e0073006f006c00650041006c006c0041006c006c0100000000000007800000000000000000000007800000037b00000001000000020000000100000008fc00000000 3 | simulationViewPerspectives: 000000ff0000000100000002000000000000077e0100000002010000000100 4 | sceneTreePerspectives: 000000ff000000010000000200000272000000fa0100000002010000000200 5 | maximizedDockId: -1 6 | centralWidgetVisible: 1 7 | orthographicViewHeight: 1 8 | textFiles: -1 9 | renderingDevicePerspectives: ChuhaLidarCamera(2):front_camera;1;1;0;0 10 | renderingDevicePerspectives: ChuhaLidarCamera(17):front_camera;1;1;0;0 11 | renderingDevicePerspectives: ChuhaLidarCamera(10):front_camera;1;1;0;0 12 | renderingDevicePerspectives: ChuhaLidarCamera(4):front_camera;1;1;0;0 13 | renderingDevicePerspectives: ChuhaLidarCamera(14):rear_camera;1;1;0;0 14 | renderingDevicePerspectives: ChuhaLidarCamera(12):front_camera;1;1;0;0 15 | renderingDevicePerspectives: ChuhaLidarCamera(2):rear_camera;1;1;0;0 16 | renderingDevicePerspectives: ChuhaLidarCamera(11):front_camera;1;1;0;0 17 | renderingDevicePerspectives: ChuhaLidarCamera(18):extra_display;0;0.277344;0;0 18 | renderingDevicePerspectives: ChuhaLidarCamera(4):rear_camera;1;1;0;0 19 | renderingDevicePerspectives: ChuhaLidarCamera(2):extra_display;0;0.277344;0;0 20 | renderingDevicePerspectives: ChuhaLidarCamera(11):rear_camera;1;1;0;0 21 | renderingDevicePerspectives: ChuhaLidarCamera(9):rear_camera;1;1;0;0 22 | renderingDevicePerspectives: ChuhaLidarCamera(13):extra_display;0;0.277344;0;0 23 | renderingDevicePerspectives: ChuhaLidarCamera(3):extra_display;0;0.277344;0;0 24 | renderingDevicePerspectives: ChuhaLidarCamera(8):extra_display;0;0.277344;0;0 25 | renderingDevicePerspectives: ChuhaLidarCamera(15):extra_display;0;0.277344;0;0 26 | renderingDevicePerspectives: ChuhaLidarCamera(7):front_camera;1;1;0;0 27 | renderingDevicePerspectives: ChuhaLidarCamera(19):front_camera;1;1;0;0 28 | renderingDevicePerspectives: ChuhaLidarCamera(6):front_camera;1;1;0;0 29 | renderingDevicePerspectives: ChuhaLidarCamera(15):front_camera;1;1;0;0 30 | renderingDevicePerspectives: ChuhaLidarCamera(13):rear_camera;1;1;0;0 31 | renderingDevicePerspectives: ChuhaLidarCamera(3):front_camera;1;1;0;0 32 | renderingDevicePerspectives: ChuhaLidarCamera(14):front_camera;1;1;0;0 33 | renderingDevicePerspectives: ChuhaLidarCamera(10):extra_display;0;0.277344;0;0 34 | renderingDevicePerspectives: ChuhaLidarCamera(18):rear_camera;1;1;0;0 35 | renderingDevicePerspectives: ChuhaLidarCamera(7):rear_camera;1;1;0;0 36 | renderingDevicePerspectives: ChuhaLidarCamera(16):rear_camera;1;1;0;0 37 | renderingDevicePerspectives: ChuhaLidarCamera(6):extra_display;0;0.277344;0;0 38 | renderingDevicePerspectives: ChuhaLidarCamera(5):front_camera;1;1;0;0 39 | renderingDevicePerspectives: ChuhaLidarCamera:extra_display;0;0.277344;0.691846;0 40 | renderingDevicePerspectives: ChuhaLidarCamera(11):extra_display;0;0.277344;0;0 41 | renderingDevicePerspectives: ChuhaLidarCamera(5):rear_camera;1;1;0;0 42 | renderingDevicePerspectives: ChuhaLidarCamera(6):rear_camera;1;1;0;0 43 | renderingDevicePerspectives: ChuhaLidarCamera(13):front_camera;1;1;0;0 44 | renderingDevicePerspectives: ChuhaLidarCamera(9):extra_display;0;0.277344;0;0 45 | renderingDevicePerspectives: ChuhaLidarCamera:rear_camera;1;1;0;0 46 | renderingDevicePerspectives: ChuhaLidarCamera(4):extra_display;0;0.277344;0;0 47 | renderingDevicePerspectives: ChuhaLidarCamera(1):extra_display;0;0.277344;0;0 48 | renderingDevicePerspectives: ChuhaLidarCamera(10):rear_camera;1;1;0;0 49 | renderingDevicePerspectives: ChuhaLidarCamera(19):extra_display;0;0.277344;0.45995;0 50 | renderingDevicePerspectives: ChuhaLidarCamera(1):rear_camera;1;1;0;0 51 | renderingDevicePerspectives: ChuhaLidarCamera(17):rear_camera;1;1;0;0 52 | renderingDevicePerspectives: ChuhaLidarCamera(14):extra_display;0;0.277344;0;0 53 | renderingDevicePerspectives: ChuhaLidarCamera(19):rear_camera;1;1;0;0 54 | renderingDevicePerspectives: ChuhaLidarCamera(12):rear_camera;1;1;0;0 55 | renderingDevicePerspectives: ChuhaLidarCamera(12):extra_display;0;0.277344;0;0 56 | renderingDevicePerspectives: ChuhaLidarCamera(18):front_camera;1;1;0;0 57 | renderingDevicePerspectives: ChuhaLidarCamera(5):extra_display;0;0.277344;0;0 58 | renderingDevicePerspectives: ChuhaLidarCamera(15):rear_camera;1;1;0;0 59 | renderingDevicePerspectives: ChuhaLidarCamera(8):rear_camera;1;1;0;0 60 | renderingDevicePerspectives: ChuhaLidarCamera(16):extra_display;0;0.277344;0;0 61 | renderingDevicePerspectives: ChuhaLidarCamera(9):front_camera;1;1;0;0 62 | renderingDevicePerspectives: ChuhaLidarCamera(16):front_camera;1;1;0;0 63 | renderingDevicePerspectives: ChuhaLidarCamera(17):extra_display;0;0.277344;0;0 64 | renderingDevicePerspectives: ChuhaLidarCamera:front_camera;1;1;0;0 65 | renderingDevicePerspectives: ChuhaLidarCamera(3):rear_camera;1;1;0;0 66 | renderingDevicePerspectives: ChuhaLidarCamera(8):front_camera;1;1;0;0 67 | renderingDevicePerspectives: ChuhaLidarCamera(1):front_camera;1;1;0;0 68 | renderingDevicePerspectives: ChuhaLidarCamera(7):extra_display;0;0.277344;0;0 69 | -------------------------------------------------------------------------------- /worlds/.swarm_follow_the_leader.wbproj: -------------------------------------------------------------------------------- 1 | Webots Project File version R2020b 2 | perspectives: 000000ff00000000fd00000003000000000000000000000000fc0100000001fb0000001a0044006f00630075006d0065006e0074006100740069006f006e0000000000ffffffff0000006900ffffff000000010000011c000002f0fc0200000001fb0000001400540065007800740045006400690074006f0072000000001a000002f00000003f00ffffff000000030000078000000039fc0100000001fb0000001a0043006f006e0073006f006c00650041006c006c0041006c006c0100000000000007800000006900ffffff000007800000034000000001000000020000000100000008fc00000000 3 | simulationViewPerspectives: 000000ff0000000100000002000001000000067e0100000002010000000100 4 | sceneTreePerspectives: 000000ff0000000100000002000000c0000000fa0100000002010000000200 5 | maximizedDockId: -1 6 | centralWidgetVisible: 1 7 | orthographicViewHeight: 1 8 | textFiles: -1 9 | consoles: Console:All:All 10 | renderingDevicePerspectives: ChuhaLidarCamera(3):front_camera;1;1;0;0 11 | renderingDevicePerspectives: ChuhaLidarCamera:front_camera;1;1;0;0 12 | renderingDevicePerspectives: ChuhaLidarCamera(8):extra_display;0;0.754883;0;0 13 | renderingDevicePerspectives: ChuhaLidarCamera(14):front_camera;1;1;0;0 14 | renderingDevicePerspectives: ChuhaLidarCamera(8):front_camera;1;1;0;0 15 | renderingDevicePerspectives: ChuhaLidarCamera(3):rear_camera;1;1;0;0 16 | renderingDevicePerspectives: ChuhaLidarCamera(13):extra_display;0;0.754883;0;0 17 | renderingDevicePerspectives: ChuhaLidarCamera(16):front_camera;1;1;0;0 18 | renderingDevicePerspectives: ChuhaLidarCamera(9):front_camera;1;1;0;0 19 | renderingDevicePerspectives: ChuhaLidarCamera(6):extra_display;0;0.754883;0;0 20 | renderingDevicePerspectives: ChuhaLidarCamera(11):rear_camera;1;1;0;0 21 | renderingDevicePerspectives: ChuhaLidarCamera(18):rear_camera;1;1;0;0 22 | renderingDevicePerspectives: ChuhaLidarCamera(12):rear_camera;1;1;0;0 23 | renderingDevicePerspectives: ChuhaLidarCamera(16):extra_display;0;0.754883;0;0 24 | renderingDevicePerspectives: ChuhaLidarCamera(19):extra_display;0;0.754883;0.0260688;0 25 | renderingDevicePerspectives: ChuhaLidarCamera(10):rear_camera;1;1;0;0 26 | renderingDevicePerspectives: ChuhaLidarCamera(15):front_camera;1;1;0;0 27 | renderingDevicePerspectives: ChuhaLidarCamera(4):front_camera;1;1;0;0 28 | renderingDevicePerspectives: ChuhaLidarCamera(5):extra_display;0;0.754883;0;0 29 | renderingDevicePerspectives: ChuhaLidarCamera(8):rear_camera;1;1;0;0 30 | renderingDevicePerspectives: ChuhaLidarCamera(7):extra_display;0;0.754883;0;0 31 | renderingDevicePerspectives: ChuhaLidarCamera(17):extra_display;0;0.754883;0;0 32 | renderingDevicePerspectives: ChuhaLidarCamera(1):front_camera;1;1;0;0 33 | renderingDevicePerspectives: ChuhaLidarCamera(5):front_camera;1;1;0;0 34 | renderingDevicePerspectives: ChuhaLidarCamera(15):extra_display;0;0.754883;0;0 35 | renderingDevicePerspectives: ChuhaLidarCamera(9):rear_camera;1;1;0;0 36 | renderingDevicePerspectives: ChuhaLidarCamera(18):extra_display;0;0.754883;0;0 37 | renderingDevicePerspectives: ChuhaLidarCamera(10):front_camera;1;1;0;0 38 | renderingDevicePerspectives: ChuhaLidarCamera(14):extra_display;0;0.754883;0;0 39 | renderingDevicePerspectives: ChuhaLidarCamera(7):front_camera;1;1;0;0 40 | renderingDevicePerspectives: ChuhaLidarCamera(18):front_camera;1;1;0;0 41 | renderingDevicePerspectives: ChuhaLidarCamera(14):rear_camera;1;1;0;0 42 | renderingDevicePerspectives: ChuhaLidarCamera(16):rear_camera;1;1;0;0 43 | renderingDevicePerspectives: ChuhaLidarCamera(13):front_camera;1;1;0;0 44 | renderingDevicePerspectives: ChuhaLidarCamera(17):rear_camera;1;1;0;0 45 | renderingDevicePerspectives: ChuhaLidarCamera(1):extra_display;0;0.754883;0.533694;0 46 | renderingDevicePerspectives: ChuhaLidarCamera(15):rear_camera;1;1;0;0 47 | renderingDevicePerspectives: ChuhaLidarCamera(19):rear_camera;1;1;0;0 48 | renderingDevicePerspectives: ChuhaLidarCamera(9):extra_display;0;0.754883;0;0 49 | renderingDevicePerspectives: ChuhaLidarCamera:rear_camera;1;1;0;0 50 | renderingDevicePerspectives: ChuhaLidarCamera(1):rear_camera;1;1;0;0 51 | renderingDevicePerspectives: ChuhaLidarCamera:extra_display;0;0.754883;0.0464025;0 52 | renderingDevicePerspectives: ChuhaLidarCamera(19):front_camera;1;1;0;0 53 | renderingDevicePerspectives: ChuhaLidarCamera(6):rear_camera;1;1;0;0 54 | renderingDevicePerspectives: ChuhaLidarCamera(2):front_camera;1;1;0;0 55 | renderingDevicePerspectives: ChuhaLidarCamera(17):front_camera;1;1;0;0 56 | renderingDevicePerspectives: ChuhaLidarCamera(7):rear_camera;1;1;0;0 57 | renderingDevicePerspectives: ChuhaLidarCamera(12):extra_display;0;0.754883;0;0 58 | renderingDevicePerspectives: ChuhaLidarCamera(6):front_camera;1;1;0;0 59 | renderingDevicePerspectives: ChuhaLidarCamera(13):rear_camera;1;1;0;0 60 | renderingDevicePerspectives: ChuhaLidarCamera(4):extra_display;0;0.754883;0;0 61 | renderingDevicePerspectives: ChuhaLidarCamera(4):rear_camera;1;1;0;0 62 | renderingDevicePerspectives: ChuhaLidarCamera(10):extra_display;0;0.754883;0;0 63 | renderingDevicePerspectives: ChuhaLidarCamera(5):rear_camera;1;1;0;0 64 | renderingDevicePerspectives: ChuhaLidarCamera(12):front_camera;1;1;0;0 65 | renderingDevicePerspectives: ChuhaLidarCamera(2):rear_camera;1;1;0;0 66 | renderingDevicePerspectives: ChuhaLidarCamera(11):extra_display;0;0.754883;0;0 67 | renderingDevicePerspectives: ChuhaLidarCamera(11):front_camera;1;1;0;0 68 | renderingDevicePerspectives: ChuhaLidarCamera(2):extra_display;0;0.754883;0;0 69 | renderingDevicePerspectives: ChuhaLidarCamera(3):extra_display;0;0.754883;0;0 70 | -------------------------------------------------------------------------------- /worlds/basic_SLAM_simple.wbt: -------------------------------------------------------------------------------- 1 | #VRML_SIM R2020b utf8 2 | WorldInfo { 3 | basicTimeStep 8 4 | } 5 | Viewpoint { 6 | orientation 0.695070210373469 0.6648469587294146 0.27359810693721814 5.214069735189197 7 | position -1.9434776221183236 3.3414517338984457 1.8668274585170996 8 | follow "ChuhaLidarCamera" 9 | followType "None" 10 | } 11 | ChuhaLidarCamera { 12 | translation 0 0.00745745 0 13 | rotation 0.8993227872811103 0.05243769369644895 -0.4341299489285811 0.0021304586221610115 14 | controller "basic_SLAM_simple" 15 | } 16 | TexturedBackground { 17 | texture "mars" 18 | } 19 | TexturedBackgroundLight { 20 | texture "mars" 21 | } 22 | RectangleArena { 23 | floorSize 5 5 24 | floorTileSize 2 2 25 | wallHeight 0.5 26 | } 27 | Wall { 28 | translation -2 0 -1.5 29 | size 1 0.5 0.1 30 | } 31 | Wall { 32 | translation -0.5 0 -2 33 | rotation 0 1 0 -1.5707953071795862 34 | name "wall(1)" 35 | size 1 0.5 0.1 36 | } 37 | Wall { 38 | translation 1 0 -1.5 39 | rotation 0 1 0 3.14159 40 | name "wall(2)" 41 | size 1 0.5 0.1 42 | } 43 | Wall { 44 | translation 1 0 -0.5 45 | rotation 0 1 0 3.14159 46 | name "wall(4)" 47 | size 1 0.5 0.1 48 | } 49 | Wall { 50 | translation 1.45 0 5.09809e-08 51 | rotation 0 1 0 -1.5707953071795862 52 | name "wall(5)" 53 | size 1 0.5 0.1 54 | } 55 | Wall { 56 | translation -0.44 0 1.9783e-06 57 | rotation 0 1 0 -1.5707953071795862 58 | name "wall(6)" 59 | size 1 0.5 0.1 60 | } 61 | Wall { 62 | translation -1.55 0 3.11046e-06 63 | rotation 0 1 0 -1.5707953071795862 64 | name "wall(8)" 65 | size 1 0.5 0.1 66 | } 67 | Wall { 68 | translation -1.55 0 2 69 | rotation 0 1 0 -1.5707953071795862 70 | name "wall(10)" 71 | size 1 0.5 0.1 72 | } 73 | Wall { 74 | translation 0.45 0 2 75 | rotation 0 1 0 -1.5707953071795862 76 | name "wall(11)" 77 | size 1 0.5 0.1 78 | } 79 | Wall { 80 | translation 0.45 0 1 81 | rotation 0 1 0 -1.5707953071795862 82 | name "wall(12)" 83 | size 1 0.5 0.1 84 | } 85 | Wall { 86 | translation -3.52079e-14 0 1.5 87 | rotation 0 1 0 3.14159 88 | name "wall(13)" 89 | size 1 0.5 0.1 90 | } 91 | Wall { 92 | translation 1 0 1.5 93 | rotation 0 1 0 3.14159 94 | name "wall(14)" 95 | size 1 0.5 0.1 96 | } 97 | Wall { 98 | translation -2 0 0.450003 99 | rotation 0 1 0 1.01503e-06 100 | name "wall(9)" 101 | size 1 0.5 0.1 102 | } 103 | Wall { 104 | translation 7.96081e-08 0 0.470002 105 | rotation 0 1 0 3.14159 106 | name "wall(7)" 107 | size 1 0.5 0.1 108 | } 109 | Wall { 110 | translation 2 0 -1.5 111 | rotation 0 1 0 3.14159 112 | name "wall(3)" 113 | size 1 0.5 0.1 114 | } 115 | -------------------------------------------------------------------------------- /worlds/chuha_definitions.wbt: -------------------------------------------------------------------------------- 1 | #VRML_SIM R2020b utf8 2 | WorldInfo { 3 | basicTimeStep 8 4 | } 5 | Viewpoint { 6 | orientation -0.13541834677885825 0.8806310468065589 0.45403835824307326 2.815646252922907 7 | position 0.3629607025297309 4.815316860348194 -3.6396516306266213 8 | follow "ChuhaBasic" 9 | followType "None" 10 | } 11 | TexturedBackground { 12 | texture "mars" 13 | } 14 | TexturedBackgroundLight { 15 | texture "mars" 16 | castShadows FALSE 17 | } 18 | RectangleArena { 19 | translation -0.0320768 0 0.0713054 20 | floorSize 10 10 21 | floorAppearance Parquetry { 22 | type "light strip" 23 | } 24 | } 25 | WoodenBox { 26 | translation -0.66 0.3 0.68 27 | } 28 | WoodenBox { 29 | translation 0.66 0.3 0.68 30 | name "wooden box(1)" 31 | } 32 | Robot { 33 | translation 0.14652426598274915 0.0074579536914906475 0.02214180003386924 34 | rotation -0.000505407601181037 0.9999993469784033 -0.0010249906944676754 2.94682937449885 35 | children [ 36 | InertialUnit { 37 | translation 0 0.0075 0 38 | children [ 39 | Shape { 40 | appearance PBRAppearance { 41 | baseColor 0 0.5 0 42 | roughness 1 43 | } 44 | geometry Box { 45 | size 0.01 0.005 0.01 46 | } 47 | } 48 | ] 49 | boundingObject Shape { 50 | appearance PBRAppearance { 51 | baseColor 0 0.5 0 52 | roughness 1 53 | } 54 | geometry Box { 55 | size 0.01 0.005 0.01 56 | } 57 | } 58 | } 59 | Display { 60 | name "extra_display" 61 | width 1024 62 | height 1024 63 | } 64 | Lidar { 65 | translation 0 0.02 0 66 | rotation 0 0.9999999999999999 0 3.14 67 | children [ 68 | DEF LIDAR_SHAPE Shape { 69 | appearance PBRAppearance { 70 | baseColor 0 0 1 71 | } 72 | geometry Box { 73 | size 0.005 0.005 0.005 74 | } 75 | } 76 | ] 77 | boundingObject USE LIDAR_SHAPE 78 | physics Physics { 79 | } 80 | rotationStep 0.262 81 | tiltAngle -0.12 82 | fieldOfView 0.3 83 | verticalFieldOfView 0.3 84 | numberOfLayers 16 85 | maxRange 6 86 | type "rotating" 87 | } 88 | Camera { 89 | translation 0 0 0.03 90 | rotation 0 1 0 -3.14 91 | children [ 92 | USE LIDAR_SHAPE 93 | ] 94 | name "front_camera" 95 | boundingObject USE LIDAR_SHAPE 96 | physics Physics { 97 | } 98 | fieldOfView 2 99 | width 256 100 | height 256 101 | far 10 102 | } 103 | Camera { 104 | translation 0 0 -0.03 105 | children [ 106 | USE LIDAR_SHAPE 107 | ] 108 | name "rear_camera" 109 | boundingObject USE LIDAR_SHAPE 110 | physics Physics { 111 | } 112 | fieldOfView 2 113 | width 256 114 | height 256 115 | far 10 116 | } 117 | DEF CHASSIS_GROUP Group { 118 | children [ 119 | Transform { 120 | translation 0 0.0125 0 121 | children [ 122 | Shape { 123 | appearance PBRAppearance { 124 | baseColor 0.5 0.5 0.5 125 | roughness 0.5 126 | } 127 | geometry Cylinder { 128 | height 0.01 129 | radius 0.0025 130 | } 131 | } 132 | ] 133 | } 134 | DEF CHASSIS_SHAPE Shape { 135 | appearance PBRAppearance { 136 | baseColor 0.7 0 0 137 | metalness 0.7 138 | } 139 | geometry Cylinder { 140 | height 0.0148 141 | radius 0.03 142 | } 143 | } 144 | ] 145 | } 146 | HingeJoint { 147 | jointParameters HingeJointParameters { 148 | position 15509.328167523308 149 | anchor 0.035 0 0 150 | } 151 | device [ 152 | PositionSensor { 153 | name "left motor sensor" 154 | } 155 | RotationalMotor { 156 | name "left motor" 157 | maxVelocity 60 158 | maxTorque 0.05 159 | } 160 | ] 161 | endPoint Solid { 162 | translation 0.034999999740545906 4.441317810577016e-05 3.3220518961824615e-05 163 | rotation -0.5145628085168344 0.5145646983648784 0.685892329223712 1.9392063890708489 164 | children [ 165 | DEF WHEEL_SHAPE Shape { 166 | appearance PBRAppearance { 167 | baseColor 0 0 0 168 | roughness 1 169 | metalness 0 170 | } 171 | geometry Cylinder { 172 | height 0.005 173 | radius 0.0075 174 | } 175 | } 176 | ] 177 | name "LeftWheelSolid" 178 | boundingObject USE WHEEL_SHAPE 179 | physics DEF WHEEL_PHY Physics { 180 | mass 0.05 181 | } 182 | } 183 | } 184 | HingeJoint { 185 | jointParameters HingeJointParameters { 186 | position 12142.621981233602 187 | anchor -0.055 0 0 188 | } 189 | device [ 190 | PositionSensor { 191 | name "right motor sensor" 192 | } 193 | RotationalMotor { 194 | name "right motor" 195 | maxVelocity 60 196 | maxTorque 0.05 197 | } 198 | ] 199 | endPoint Solid { 200 | translation -0.03500000038240844 -4.006410831159118e-05 -3.79618322983081e-05 201 | rotation -0.37995902000756615 0.3799600802457111 -0.8433631960991437 4.542846992722221 202 | children [ 203 | USE WHEEL_SHAPE 204 | ] 205 | name "RightWheelSolid" 206 | boundingObject USE WHEEL_SHAPE 207 | physics USE WHEEL_PHY 208 | } 209 | } 210 | ] 211 | name "ChuhaCameraLidar" 212 | boundingObject USE CHASSIS_GROUP 213 | physics Physics { 214 | mass 0.3 215 | } 216 | controller "lidar_camera_controller" 217 | linearVelocity 6.232266328806033e-13 -2.0166048513873838e-14 -1.2471853620901518e-13 218 | angularVelocity 6.776746323111518e-13 9.773333527674542e-11 2.2766058360531475e-14 219 | } 220 | Robot { 221 | translation 1.4506117227896504 0.007485974495702329 -0.24726372008378755 222 | rotation 0.0034541495527834797 -0.9999938839939287 -0.0005484757093350092 -0.314945997882939 223 | children [ 224 | InertialUnit { 225 | translation 0 0.0075 0 226 | children [ 227 | Shape { 228 | appearance PBRAppearance { 229 | baseColor 0 0.5 0 230 | roughness 1 231 | } 232 | geometry Box { 233 | size 0.01 0.005 0.01 234 | } 235 | } 236 | ] 237 | boundingObject Shape { 238 | appearance PBRAppearance { 239 | baseColor 0 0.5 0 240 | roughness 1 241 | } 242 | geometry Box { 243 | size 0.01 0.005 0.01 244 | } 245 | } 246 | } 247 | HingeJoint { 248 | jointParameters HingeJointParameters { 249 | position 14860.169055217251 250 | anchor 0.035 0 0 251 | } 252 | device [ 253 | PositionSensor { 254 | name "left motor sensor" 255 | } 256 | RotationalMotor { 257 | name "left motor" 258 | maxVelocity 60 259 | maxTorque 0.05 260 | } 261 | ] 262 | endPoint Solid { 263 | translation 0.035 0 0 264 | rotation -0.6972050585643901 0.6972076195462713 0.1667532355273725 2.81112803469522 265 | children [ 266 | DEF WHEEL_SHAPE Shape { 267 | appearance PBRAppearance { 268 | baseColor 0 0 0 269 | roughness 1 270 | metalness 0 271 | } 272 | geometry Cylinder { 273 | height 0.005 274 | radius 0.0075 275 | } 276 | } 277 | ] 278 | name "LeftWheelSolid" 279 | boundingObject USE WHEEL_SHAPE 280 | physics DEF WHEEL_PHY Physics { 281 | mass 0.05 282 | } 283 | linearVelocity 5.155456630622013e-12 6.899200557484994e-18 1.5818179443671795e-11 284 | angularVelocity 2.1091994277001056e-09 8.022824377930778e-15 -6.871531633454325e-10 285 | } 286 | } 287 | HingeJoint { 288 | jointParameters HingeJointParameters { 289 | position 11575.672580723556 290 | anchor -0.055 0 0 291 | } 292 | device [ 293 | PositionSensor { 294 | name "right motor sensor" 295 | } 296 | RotationalMotor { 297 | name "right motor" 298 | maxVelocity 60 299 | maxTorque 0.05 300 | } 301 | ] 302 | endPoint Solid { 303 | translation -0.03500000000000002 0 0 304 | rotation 0.25981969804822713 -0.25982065242102237 0.9300467477937022 1.6432569347427253 305 | children [ 306 | USE WHEEL_SHAPE 307 | ] 308 | name "RightWheelSolid" 309 | boundingObject USE WHEEL_SHAPE 310 | physics USE WHEEL_PHY 311 | linearVelocity 5.1518806936603525e-12 -1.123946464490311e-18 1.581937131720087e-11 312 | angularVelocity 2.1091991218957105e-09 9.70023270432667e-15 -6.871544383727389e-10 313 | } 314 | } 315 | DEF CHASSIS_SHAPE Shape { 316 | appearance PBRAppearance { 317 | baseColor 0.7 0 0 318 | metalness 0.7 319 | } 320 | geometry Cylinder { 321 | height 0.0149 322 | radius 0.03 323 | } 324 | } 325 | ] 326 | name "ChuhaBasic" 327 | boundingObject USE CHASSIS_SHAPE 328 | physics Physics { 329 | } 330 | controller "teleoperator" 331 | linearVelocity 5.153550113196886e-12 -2.1082473652919163e-17 1.5819452311676227e-11 332 | angularVelocity 2.1092009942397603e-09 3.8593730052683804e-15 -6.871531677295935e-10 333 | } 334 | -------------------------------------------------------------------------------- /worlds/lidar_visualization.wbt: -------------------------------------------------------------------------------- 1 | #VRML_SIM R2020b utf8 2 | WorldInfo { 3 | basicTimeStep 8 4 | } 5 | Viewpoint { 6 | orientation -0.9853294882516178 0.11575452522821336 0.12540609822092377 1.6655190181332091 7 | position -1.0640816137542177 3.811859629024374 -1.1931178830365714 8 | followType "None" 9 | } 10 | TexturedBackground { 11 | texture "mars" 12 | } 13 | TexturedBackgroundLight { 14 | texture "mars" 15 | castShadows FALSE 16 | } 17 | RectangleArena { 18 | floorSize 5 5 19 | } 20 | WoodenBox { 21 | translation 0 0.3 0.91 22 | } 23 | WoodenBox { 24 | translation 0.88 0.3 0.31 25 | name "wooden box(1)" 26 | } 27 | WoodenBox { 28 | translation -0.96 0.3 0.31 29 | name "wooden box(2)" 30 | } 31 | WoodenBox { 32 | translation -0.68 0.3 -0.7 33 | name "wooden box(3)" 34 | } 35 | WoodenBox { 36 | translation 0.74 0.3 -0.7 37 | name "wooden box(4)" 38 | } 39 | ChuhaLidarCamera { 40 | hidden position_0_0 16355.076429471203 41 | hidden position_0_1 12956.711404997524 42 | hidden linearVelocity_0 3.697017614715702e-13 -7.818039922387454e-15 1.0508062830934304e-13 43 | hidden angularVelocity_0 2.286116995877819e-13 6.378572019920059e-11 8.144456223942307e-14 44 | hidden translation_6 0.034999999740545906 -1.472666126458546e-05 -5.3472036781349267e-05 45 | hidden rotation_6 0.6892022986732357 -0.6892048302301714 0.22359985127662377 2.701631494226184 46 | hidden linearVelocity_6 -4.634518364030413e-13 6.77732267140864e-17 2.184576691055459e-12 47 | hidden angularVelocity_6 3.128694447217917e-10 6.427065392115504e-11 1.2542755027964373e-10 48 | hidden translation_7 -0.03500000038240844 2.125940685060301e-05 5.0933987735188286e-05 49 | hidden rotation_7 0.6280057326498082 -0.6280073045265341 -0.45958201141939276 4.003177993177395 50 | hidden linearVelocity_7 1.1955342832663001e-12 1.2487042480614453e-16 -1.9547327758316094e-12 51 | hidden angularVelocity_7 -3.2298891651358177e-10 6.32739602580598e-11 -1.2953917367454377e-10 52 | translation -1.3779759790558361 0.007459887389721648 -0.8897414137863737 53 | rotation -0.0005209767045415539 0.9999992187423219 -0.0011362649423386322 2.760296873025242 54 | controller "lidar_visualization" 55 | } 56 | -------------------------------------------------------------------------------- /worlds/odometry_basic_teleop.wbt: -------------------------------------------------------------------------------- 1 | #VRML_SIM R2020b utf8 2 | WorldInfo { 3 | basicTimeStep 8 4 | } 5 | Viewpoint { 6 | orientation 1 0 0 4.71238898038469 7 | position 0.46078879886519153 12.383711063055381 -0.0522256803393417 8 | } 9 | TexturedBackground { 10 | texture "mars" 11 | } 12 | TexturedBackgroundLight { 13 | texture "mars" 14 | castShadows FALSE 15 | } 16 | ChuhaBasic { 17 | hidden position_0_0 14555.29830785802 18 | hidden position_0_1 10793.857560342081 19 | hidden linearVelocity_0 6.231943552367432e-16 2.1082473652919163e-17 -2.0711508108297427e-18 20 | hidden angularVelocity_0 1.8240096357579943e-15 7.207689975447053e-16 1.73440295673654e-15 21 | hidden rotation_2 -0.1636267770909138 0.16362737812672995 -0.9728578307986283 4.684871458853537 22 | hidden linearVelocity_2 1.3254021383464943e-15 1.460316375082666e-17 -6.704893795182981e-16 23 | hidden angularVelocity_2 2.4757841778614918e-15 7.203476415746775e-16 8.555753161529173e-15 24 | hidden rotation_3 -0.6609756115725883 0.6609780394760364 0.35527351749976827 2.458864803356825 25 | hidden linearVelocity_3 -1.5644426730734955e-15 7.901214367886021e-18 6.934911186124525e-16 26 | hidden angularVelocity_3 -3.2669621523668416e-15 -1.0862325364805307e-16 -8.889129631389242e-15 27 | translation 0.2268729552934397 0.007485974495724965 0.16647771179928447 28 | rotation 0.00010904483054650052 0.999999814255516 0.0005996650384870512 -2.7818249240624144 29 | controller "odometry_simple_teleop" 30 | } 31 | RectangleArena { 32 | floorSize 5 5 33 | } 34 | -------------------------------------------------------------------------------- /worlds/swarm_basic_flocking.wbt: -------------------------------------------------------------------------------- 1 | #VRML_SIM R2020b utf8 2 | WorldInfo { 3 | basicTimeStep 8 4 | optimalThreadCount 8 5 | } 6 | Viewpoint { 7 | orientation -0.00640466211476514 -0.9207985416405503 -0.3899859305357454 3.1113507725370626 8 | position 0.7727216886750466 2.6628318152429777 -2.2791277759329707 9 | } 10 | TexturedBackground { 11 | texture "empty_office" 12 | } 13 | TexturedBackgroundLight { 14 | texture "empty_office" 15 | luminosity 20 16 | } 17 | Floor { 18 | appearance Parquetry { 19 | type "light strip" 20 | } 21 | } 22 | ChuhaLidarCamera { 23 | translation 0.43 0 -0.25 24 | controller "swarm_basic_flocking" 25 | } 26 | ChuhaLidarCamera { 27 | translation 0.09 0 0.1 28 | controller "swarm_basic_flocking" 29 | name "ChuhaLidarCamera(1)" 30 | } 31 | ChuhaLidarCamera { 32 | translation 0.62 0 0.2 33 | controller "swarm_basic_flocking" 34 | name "ChuhaLidarCamera(2)" 35 | } 36 | ChuhaLidarCamera { 37 | translation 0.36 0 0.93 38 | controller "swarm_basic_flocking" 39 | name "ChuhaLidarCamera(3)" 40 | } 41 | ChuhaLidarCamera { 42 | translation 0.18 0 0.4 43 | controller "swarm_basic_flocking" 44 | name "ChuhaLidarCamera(4)" 45 | } 46 | ChuhaLidarCamera { 47 | translation 0.74 0 -0.15 48 | controller "swarm_basic_flocking" 49 | name "ChuhaLidarCamera(5)" 50 | } 51 | ChuhaLidarCamera { 52 | translation 0.73 0 0.6 53 | controller "swarm_basic_flocking" 54 | name "ChuhaLidarCamera(6)" 55 | } 56 | ChuhaLidarCamera { 57 | translation 0.7 0 1 58 | controller "swarm_basic_flocking" 59 | name "ChuhaLidarCamera(7)" 60 | } 61 | ChuhaLidarCamera { 62 | translation 1.14 0 0.8 63 | controller "swarm_basic_flocking" 64 | name "ChuhaLidarCamera(8)" 65 | } 66 | ChuhaLidarCamera { 67 | translation 1.39 0 1.13 68 | controller "swarm_basic_flocking" 69 | name "ChuhaLidarCamera(9)" 70 | } 71 | ChuhaLidarCamera { 72 | translation 1.77 0 0.84 73 | controller "swarm_basic_flocking" 74 | name "ChuhaLidarCamera(10)" 75 | } 76 | ChuhaLidarCamera { 77 | translation 2.02 0 0.38 78 | controller "swarm_basic_flocking" 79 | name "ChuhaLidarCamera(11)" 80 | } 81 | ChuhaLidarCamera { 82 | translation 1.57 0 0.48 83 | controller "swarm_basic_flocking" 84 | name "ChuhaLidarCamera(12)" 85 | } 86 | ChuhaLidarCamera { 87 | translation 1.3 0 0.26 88 | controller "swarm_basic_flocking" 89 | name "ChuhaLidarCamera(13)" 90 | } 91 | ChuhaLidarCamera { 92 | translation 1.57 0 -0.07 93 | controller "swarm_basic_flocking" 94 | name "ChuhaLidarCamera(14)" 95 | } 96 | ChuhaLidarCamera { 97 | translation 1.08 0 0.16 98 | controller "swarm_basic_flocking" 99 | name "ChuhaLidarCamera(15)" 100 | } 101 | ChuhaLidarCamera { 102 | translation 1.18 0 -0.32 103 | controller "swarm_basic_flocking" 104 | name "ChuhaLidarCamera(16)" 105 | } 106 | ChuhaLidarCamera { 107 | translation 1.28 0 -0.22 108 | controller "swarm_basic_flocking" 109 | name "ChuhaLidarCamera(17)" 110 | } 111 | -------------------------------------------------------------------------------- /worlds/swarm_flocking_anticollision.wbt: -------------------------------------------------------------------------------- 1 | #VRML_SIM R2020b utf8 2 | WorldInfo { 3 | basicTimeStep 8 4 | optimalThreadCount 8 5 | } 6 | Viewpoint { 7 | orientation 0.39952549568821694 0.8903601387752689 0.21826177305054717 5.182502949088433 8 | position -2.362616522512178 1.8016230504418644 3.0918606419802934 9 | follow "ChuhaLidarCamera" 10 | followType "None" 11 | } 12 | TexturedBackground { 13 | texture "empty_office" 14 | } 15 | TexturedBackgroundLight { 16 | texture "empty_office" 17 | } 18 | Floor { 19 | appearance Parquetry { 20 | type "light strip" 21 | } 22 | } 23 | ChuhaLidarCamera { 24 | translation 0 0.00767573 0 25 | controller "swarm_flocking_anticollision" 26 | } 27 | ChuhaLidarCamera { 28 | translation 0.5 0.00791453 0 29 | controller "swarm_flocking_anticollision" 30 | name "ChuhaLidarCamera(1)" 31 | } 32 | ChuhaLidarCamera { 33 | translation 1 0.00779233 0 34 | controller "swarm_flocking_anticollision" 35 | name "ChuhaLidarCamera(2)" 36 | } 37 | ChuhaLidarCamera { 38 | translation 1.5 0.00781044 0 39 | controller "swarm_flocking_anticollision" 40 | name "ChuhaLidarCamera(3)" 41 | } 42 | ChuhaLidarCamera { 43 | translation 0 0.0078126 0.5 44 | controller "swarm_flocking_anticollision" 45 | name "ChuhaLidarCamera(4)" 46 | } 47 | ChuhaLidarCamera { 48 | translation 0.5 0.00770142 0.5 49 | controller "swarm_flocking_anticollision" 50 | name "ChuhaLidarCamera(5)" 51 | } 52 | ChuhaLidarCamera { 53 | translation 1 0.00743914 0.5 54 | controller "swarm_flocking_anticollision" 55 | name "ChuhaLidarCamera(6)" 56 | } 57 | ChuhaLidarCamera { 58 | translation 1.5 0.00782482 0.5 59 | controller "swarm_flocking_anticollision" 60 | name "ChuhaLidarCamera(7)" 61 | } 62 | ChuhaLidarCamera { 63 | translation 0 0.00782658 1 64 | controller "swarm_flocking_anticollision" 65 | name "ChuhaLidarCamera(8)" 66 | } 67 | ChuhaLidarCamera { 68 | translation 0.5 0.00775592 1 69 | controller "swarm_flocking_anticollision" 70 | name "ChuhaLidarCamera(9)" 71 | } 72 | ChuhaLidarCamera { 73 | translation 1 0.00760529 1 74 | controller "swarm_flocking_anticollision" 75 | name "ChuhaLidarCamera(10)" 76 | } 77 | ChuhaLidarCamera { 78 | translation 1.5 0.00753866 1 79 | controller "swarm_flocking_anticollision" 80 | name "ChuhaLidarCamera(11)" 81 | } 82 | ChuhaLidarCamera { 83 | translation 0 0.00761535 1.5 84 | controller "swarm_flocking_anticollision" 85 | name "ChuhaLidarCamera(12)" 86 | } 87 | ChuhaLidarCamera { 88 | translation 0.5 0.00748898 1.5 89 | controller "swarm_flocking_anticollision" 90 | name "ChuhaLidarCamera(13)" 91 | } 92 | ChuhaLidarCamera { 93 | translation 1 0.00747851 1.5 94 | controller "swarm_flocking_anticollision" 95 | name "ChuhaLidarCamera(14)" 96 | } 97 | ChuhaLidarCamera { 98 | translation 1.5 0.00740551 1.5 99 | controller "swarm_flocking_anticollision" 100 | name "ChuhaLidarCamera(15)" 101 | } 102 | ChuhaLidarCamera { 103 | translation 0 0.00765684 2 104 | controller "swarm_flocking_anticollision" 105 | name "ChuhaLidarCamera(16)" 106 | } 107 | ChuhaLidarCamera { 108 | translation 0.5 0.00759428 2 109 | controller "swarm_flocking_anticollision" 110 | name "ChuhaLidarCamera(17)" 111 | } 112 | ChuhaLidarCamera { 113 | translation 1 0.00765082 2 114 | controller "swarm_flocking_anticollision" 115 | name "ChuhaLidarCamera(18)" 116 | } 117 | ChuhaLidarCamera { 118 | translation 1.5 0.00740543 2 119 | controller "swarm_flocking_anticollision" 120 | name "ChuhaLidarCamera(19)" 121 | } 122 | -------------------------------------------------------------------------------- /worlds/swarm_follow_the_leader.wbt: -------------------------------------------------------------------------------- 1 | #VRML_SIM R2020b utf8 2 | WorldInfo { 3 | basicTimeStep 8 4 | optimalThreadCount 8 5 | } 6 | Viewpoint { 7 | orientation 0.5282754655954158 0.7258902119335593 0.44046388350124566 4.574263209388246 8 | position -2.579815765451963 5.264706901836948 1.8303060432112992 9 | follow "ChuhaLidarCamera" 10 | followType "None" 11 | } 12 | TexturedBackground { 13 | texture "empty_office" 14 | } 15 | TexturedBackgroundLight { 16 | texture "empty_office" 17 | } 18 | Floor { 19 | appearance Parquetry { 20 | type "light strip" 21 | } 22 | } 23 | ChuhaBasic { 24 | translation -0.5 0.08 -0.5 25 | } 26 | ChuhaLidarCamera { 27 | translation 0 0.00767573 0 28 | controller "swarm_flocking_anticollision" 29 | } 30 | ChuhaLidarCamera { 31 | translation 0.5 0.00791453 0 32 | controller "swarm_flocking_anticollision" 33 | name "ChuhaLidarCamera(1)" 34 | } 35 | ChuhaLidarCamera { 36 | translation 1 0.00779233 0 37 | controller "swarm_flocking_anticollision" 38 | name "ChuhaLidarCamera(2)" 39 | } 40 | ChuhaLidarCamera { 41 | translation 1.5 0.00781044 0 42 | controller "swarm_flocking_anticollision" 43 | name "ChuhaLidarCamera(3)" 44 | } 45 | ChuhaLidarCamera { 46 | translation 0 0.0078126 0.5 47 | controller "swarm_flocking_anticollision" 48 | name "ChuhaLidarCamera(4)" 49 | } 50 | ChuhaLidarCamera { 51 | translation 0.5 0.00770142 0.5 52 | controller "swarm_flocking_anticollision" 53 | name "ChuhaLidarCamera(5)" 54 | } 55 | ChuhaLidarCamera { 56 | translation 1 0.00743914 0.5 57 | controller "swarm_flocking_anticollision" 58 | name "ChuhaLidarCamera(6)" 59 | } 60 | ChuhaLidarCamera { 61 | translation 1.5 0.00782482 0.5 62 | controller "swarm_flocking_anticollision" 63 | name "ChuhaLidarCamera(7)" 64 | } 65 | ChuhaLidarCamera { 66 | translation 0 0.00782658 1 67 | controller "swarm_flocking_anticollision" 68 | name "ChuhaLidarCamera(8)" 69 | } 70 | ChuhaLidarCamera { 71 | translation 0.5 0.00775592 1 72 | controller "swarm_flocking_anticollision" 73 | name "ChuhaLidarCamera(9)" 74 | } 75 | ChuhaLidarCamera { 76 | translation 1 0.00760529 1 77 | controller "swarm_flocking_anticollision" 78 | name "ChuhaLidarCamera(10)" 79 | } 80 | ChuhaLidarCamera { 81 | translation 1.5 0.00753866 1 82 | controller "swarm_flocking_anticollision" 83 | name "ChuhaLidarCamera(11)" 84 | } 85 | ChuhaLidarCamera { 86 | translation 0 0.00761535 1.5 87 | controller "swarm_flocking_anticollision" 88 | name "ChuhaLidarCamera(12)" 89 | } 90 | ChuhaLidarCamera { 91 | translation 0.5 0.00748898 1.5 92 | controller "swarm_flocking_anticollision" 93 | name "ChuhaLidarCamera(13)" 94 | } 95 | ChuhaLidarCamera { 96 | translation 1 0.00747851 1.5 97 | controller "swarm_flocking_anticollision" 98 | name "ChuhaLidarCamera(14)" 99 | } 100 | ChuhaLidarCamera { 101 | translation 1.5 0.00740551 1.5 102 | controller "swarm_flocking_anticollision" 103 | name "ChuhaLidarCamera(15)" 104 | } 105 | ChuhaLidarCamera { 106 | translation 0 0.00765684 2 107 | controller "swarm_flocking_anticollision" 108 | name "ChuhaLidarCamera(16)" 109 | } 110 | ChuhaLidarCamera { 111 | translation 0.5 0.00759428 2 112 | controller "swarm_flocking_anticollision" 113 | name "ChuhaLidarCamera(17)" 114 | } 115 | ChuhaLidarCamera { 116 | translation 1 0.00765082 2 117 | controller "swarm_flocking_anticollision" 118 | name "ChuhaLidarCamera(18)" 119 | } 120 | ChuhaLidarCamera { 121 | translation 1.5 0.00740543 2 122 | controller "swarm_flocking_anticollision" 123 | name "ChuhaLidarCamera(19)" 124 | } 125 | --------------------------------------------------------------------------------