├── .clang-format ├── .github └── workflows │ └── industrial_ci_action.yml ├── .gitignore ├── .travis.yml ├── CONTRIBUTING.md ├── Doxyfile ├── LICENSE ├── README.md ├── docs ├── Makefile ├── _static │ ├── checkbox6.gif │ ├── conestogo_office.png │ ├── flatland_logo.png │ ├── flatland_logo2.png │ ├── flatland_window.gif │ ├── flatland_window.png │ ├── hello_world.png │ ├── ps3_small.jpg │ ├── spawn_model_button.png │ └── top_level.png ├── conf.py ├── core_functions │ ├── joystick.rst │ ├── layers.rst │ ├── model_plugins.rst │ ├── models.rst │ ├── ros_launch.rst │ ├── ros_services.rst │ ├── world.rst │ └── yaml_preprocessor.rst ├── doxygen │ ├── conf.py │ └── index.rst ├── flatland_tutorials │ ├── create_model.rst │ ├── create_plugin.rst │ ├── custom_robot.rst │ └── spawn_model.rst ├── included_plugins │ ├── bool_sensor.rst │ ├── bumper.rst │ ├── diff_drive.rst │ ├── gps.rst │ ├── imu.rst │ ├── laser.rst │ ├── model_tf_publisher.rst │ ├── tricycle_drive.rst │ └── tween.rst ├── index.rst ├── make.bat ├── model1.yaml ├── overview.rst └── quick_start.rst ├── flatland ├── CHANGELOG.rst ├── CMakeLists.txt ├── LICENSE └── package.xml ├── flatland_msgs ├── CHANGELOG.rst ├── CMakeLists.txt ├── LICENSE ├── msg │ ├── Collision.msg │ ├── Collisions.msg │ ├── DebugTopicList.msg │ └── Vector2.msg ├── package.xml └── srv │ ├── DeleteModel.srv │ ├── MoveModel.srv │ └── SpawnModel.srv ├── flatland_plugins ├── CHANGELOG.rst ├── CMakeLists.txt ├── LICENSE ├── flatland_plugins.xml ├── include │ ├── flatland_plugins │ │ ├── bool_sensor.h │ │ ├── bumper.h │ │ ├── diff_drive.h │ │ ├── dynamics_limits.h │ │ ├── gps.h │ │ ├── imu.h │ │ ├── laser.h │ │ ├── model_tf_publisher.h │ │ ├── tricycle_drive.h │ │ ├── tween.h │ │ ├── update_timer.h │ │ ├── world_modifier.h │ │ └── world_random_wall.h │ └── thirdparty │ │ ├── ThreadPool.h │ │ └── tweeny │ │ ├── LICENSE │ │ ├── dispatcher.h │ │ ├── easing.h │ │ ├── easingresolve.h │ │ ├── int2type.h │ │ ├── tween.h │ │ ├── tween.tcc │ │ ├── tweenone.tcc │ │ ├── tweenpoint.h │ │ ├── tweenpoint.tcc │ │ ├── tweentraits.h │ │ ├── tweeny.h │ │ └── tweeny.tcc ├── package.xml ├── src │ ├── bool_sensor.cpp │ ├── bumper.cpp │ ├── diff_drive.cpp │ ├── dynamics_limits.cpp │ ├── gps.cpp │ ├── imu.cpp │ ├── laser.cpp │ ├── model_tf_publisher.cpp │ ├── tricycle_drive.cpp │ ├── tween.cpp │ ├── update_timer.cpp │ ├── world_modifier.cpp │ └── world_random_wall.cpp └── test │ ├── bumper_test.cpp │ ├── bumper_test.test │ ├── bumper_tests │ ├── collision_test │ │ ├── map_1.png │ │ ├── map_1.yaml │ │ ├── robot.model.yaml │ │ └── world.yaml │ └── invalid_A │ │ ├── robot.model.yaml │ │ └── world.yaml │ ├── diff_drive_test.cpp │ ├── diff_drive_test.test │ ├── dynamics_limits_test.cpp │ ├── gps_test.cpp │ ├── gps_test.test │ ├── imu_test.cpp │ ├── imu_test.test │ ├── laser_test.cpp │ ├── laser_test.test │ ├── laser_tests │ ├── intensity_test │ │ ├── map_1.png │ │ ├── map_1.yaml │ │ ├── map_2.png │ │ ├── map_2.yaml │ │ ├── map_reflectance.png │ │ ├── map_reflectance.yaml │ │ ├── robot.model.yaml │ │ └── world.yaml │ ├── invalid_A │ │ ├── robot.model.yaml │ │ └── world.yaml │ ├── invalid_B │ │ ├── robot.model.yaml │ │ └── world.yaml │ └── range_test │ │ ├── map_1.png │ │ ├── map_1.yaml │ │ ├── map_2.png │ │ ├── map_2.yaml │ │ ├── robot.model.cw.asymmetrical.yaml │ │ ├── robot.model.cw.yaml │ │ ├── robot.model.yaml │ │ ├── world.cw.asymmetrical.yaml │ │ ├── world.cw.yaml │ │ └── world.yaml │ ├── model_tf_publisher_test.cpp │ ├── model_tf_publisher_test.test │ ├── model_tf_publisher_tests │ ├── invalid_A │ │ ├── robot.model.yaml │ │ └── world.yaml │ ├── invalid_B │ │ ├── robot.model.yaml │ │ └── world.yaml │ ├── tf_publish_test_A │ │ ├── map_1.png │ │ ├── map_1.yaml │ │ ├── robot.model.yaml │ │ └── world.yaml │ └── tf_publish_test_B │ │ ├── robot.model.yaml │ │ └── world.yaml │ ├── tricycle_drive_test.cpp │ ├── tricycle_drive_test.test │ ├── tricycle_drive_tests │ ├── cleaner.model.yaml │ ├── cleaner2.model.yaml │ ├── cleaner3.model.yaml │ ├── map.png │ ├── map.yaml │ ├── map3d.png │ ├── map3d.yaml │ ├── world.yaml │ ├── world2.yaml │ └── world3.yaml │ ├── tween_test.cpp │ ├── tween_test.test │ ├── tween_tests │ ├── loop.model.yaml │ ├── loop.world.yaml │ ├── map_1.png │ ├── map_1.yaml │ ├── once.model.yaml │ ├── once.world.yaml │ ├── yoyo.model.yaml │ └── yoyo.world.yaml │ ├── update_timer_test.cpp │ ├── update_timer_test.test │ └── update_timer_test │ ├── map_1.png │ ├── map_1.yaml │ ├── robot.model.yaml │ └── world.yaml ├── flatland_server ├── CHANGELOG.rst ├── CMakeLists.txt ├── LICENSE ├── flatland_plugins.xml ├── include │ └── flatland_server │ │ ├── body.h │ │ ├── collision_filter_registry.h │ │ ├── debug_visualization.h │ │ ├── dummy_model_plugin.h │ │ ├── dummy_world_plugin.h │ │ ├── entity.h │ │ ├── exceptions.h │ │ ├── flatland_plugin.h │ │ ├── geometry.h │ │ ├── interactive_marker_manager.h │ │ ├── joint.h │ │ ├── layer.h │ │ ├── model.h │ │ ├── model_body.h │ │ ├── model_plugin.h │ │ ├── plugin_manager.h │ │ ├── service_manager.h │ │ ├── simulation_manager.h │ │ ├── timekeeper.h │ │ ├── types.h │ │ ├── world.h │ │ ├── world_plugin.h │ │ ├── yaml_preprocessor.h │ │ └── yaml_reader.h ├── launch │ ├── benchmark.launch │ └── server.launch ├── package.xml ├── scripts │ └── map_to_lines.py ├── src │ ├── body.cpp │ ├── collision_filter_registry.cpp │ ├── debug_visualization.cpp │ ├── dummy_model_plugin.cpp │ ├── dummy_world_plugin.cpp │ ├── entity.cpp │ ├── flatland_benchmark.cpp │ ├── flatland_server_node.cpp │ ├── geometry.cpp │ ├── interactive_marker_manager.cpp │ ├── joint.cpp │ ├── layer.cpp │ ├── model.cpp │ ├── model_body.cpp │ ├── model_plugin.cpp │ ├── plugin_manager.cpp │ ├── service_manager.cpp │ ├── simulation_manager.cpp │ ├── timekeeper.cpp │ ├── world.cpp │ ├── world_plugin.cpp │ ├── yaml_preprocessor.cpp │ └── yaml_reader.cpp ├── test │ ├── benchmark_world │ │ ├── cleaner.model.yaml │ │ ├── map.png │ │ ├── map.yaml │ │ ├── map3d.png │ │ ├── map3d.yaml │ │ ├── turtlebot.model.yaml │ │ └── world.yaml │ ├── collision_filter_registry_test.cpp │ ├── conestogo_office_test │ │ ├── cleaner.model.yaml │ │ ├── map.png │ │ ├── map.yaml │ │ ├── map3d.png │ │ ├── map3d.yaml │ │ ├── sensor.model.yaml │ │ ├── turtlebot.model.yaml │ │ ├── walker.model.yaml │ │ └── world.yaml │ ├── debug_visualization.test │ ├── debug_visualization_test.cpp │ ├── dummy_model_plugin_test.cpp │ ├── dummy_model_plugin_test.test │ ├── dummy_world_plugin_test.cpp │ ├── dummy_world_plugin_test.test │ ├── geometry_test.cpp │ ├── load_world_test.cpp │ ├── load_world_test.test │ ├── load_world_tests │ │ ├── map_invalid_A │ │ │ ├── map.yaml │ │ │ └── world.yaml │ │ ├── map_invalid_B │ │ │ ├── map.yaml │ │ │ └── world.yaml │ │ ├── map_invalid_C │ │ │ ├── map_lines.yaml │ │ │ └── world.yaml │ │ ├── map_invalid_D │ │ │ ├── map_lines.dat │ │ │ ├── map_lines.yaml │ │ │ └── world.yaml │ │ ├── map_invalid_E │ │ │ ├── map_lines.yaml │ │ │ └── world.yaml │ │ ├── model_invalid_A │ │ │ ├── turtlebot.model.yaml │ │ │ └── world.yaml │ │ ├── model_invalid_B │ │ │ ├── turtlebot.model.yaml │ │ │ └── world.yaml │ │ ├── model_invalid_C │ │ │ ├── turtlebot.model.yaml │ │ │ └── world.yaml │ │ ├── model_invalid_D │ │ │ ├── turtlebot.model.yaml │ │ │ └── world.yaml │ │ ├── model_invalid_E │ │ │ ├── turtlebot.model.yaml │ │ │ └── world.yaml │ │ ├── model_invalid_F │ │ │ ├── turtlebot.model.yaml │ │ │ └── world.yaml │ │ ├── model_invalid_G │ │ │ ├── turtlebot.model.yaml │ │ │ └── world.yaml │ │ ├── model_invalid_H │ │ │ ├── turtlebot.model.yaml │ │ │ └── world.yaml │ │ ├── model_invalid_I │ │ │ ├── turtlebot.model.yaml │ │ │ └── world.yaml │ │ ├── model_invalid_J │ │ │ ├── turtlebot.model.yaml │ │ │ └── world.yaml │ │ ├── simple_test_A │ │ │ ├── chair.model.yaml │ │ │ ├── map.png │ │ │ ├── map.yaml │ │ │ ├── map3d.png │ │ │ ├── map3d.yaml │ │ │ ├── map_lines.dat │ │ │ ├── map_lines.yaml │ │ │ ├── person.model.yaml │ │ │ ├── turtlebot.model.yaml │ │ │ └── world.yaml │ │ ├── world_invalid_A │ │ │ └── world.yaml │ │ ├── world_invalid_B │ │ │ └── world.yaml │ │ ├── world_invalid_C │ │ │ └── world.yaml │ │ ├── world_invalid_D │ │ │ └── world.yaml │ │ ├── world_invalid_E │ │ │ └── world.yaml │ │ └── world_invalid_F │ │ │ └── world.yaml │ ├── model_test.cpp │ ├── model_test.test │ ├── null.cpp │ ├── plugin_manager_test.cpp │ ├── plugin_manager_test.test │ ├── plugin_manager_tests │ │ ├── collision_test │ │ │ ├── turtlebot.model.yaml │ │ │ └── world.yaml │ │ ├── duplicate_plugin │ │ │ ├── turtlebot.model.yaml │ │ │ └── world.yaml │ │ ├── invalid_plugin_yaml │ │ │ ├── turtlebot.model.yaml │ │ │ └── world.yaml │ │ ├── load_dummy_test │ │ │ ├── map.png │ │ │ ├── map.yaml │ │ │ ├── person.model.yaml │ │ │ ├── turtlebot.model.yaml │ │ │ └── world.yaml │ │ ├── nonexistent_plugin │ │ │ ├── turtlebot.model.yaml │ │ │ └── world.yaml │ │ └── plugin_throws_exception │ │ │ ├── turtlebot.model.yaml │ │ │ └── world.yaml │ ├── service_manager_test.cpp │ ├── service_manager_test.test │ └── yaml_preprocessor │ │ ├── yaml │ │ ├── eval.strings.out.yaml │ │ ├── eval.strings.yaml │ │ ├── include.child.yaml │ │ ├── include.parent.out.yaml │ │ ├── include.parent.yaml │ │ ├── include.sequence.yaml │ │ └── include.string.yaml │ │ ├── yaml_preprocessor_test.cpp │ │ └── yaml_preprocessor_test.test └── thirdparty │ └── Box2D │ ├── Box2D.h │ ├── Box2DConfig.cmake.in │ ├── CMakeLists.txt │ ├── Collision │ ├── Shapes │ │ ├── b2ChainShape.cpp │ │ ├── b2ChainShape.h │ │ ├── b2CircleShape.cpp │ │ ├── b2CircleShape.h │ │ ├── b2EdgeShape.cpp │ │ ├── b2EdgeShape.h │ │ ├── b2PolygonShape.cpp │ │ ├── b2PolygonShape.h │ │ └── b2Shape.h │ ├── b2BroadPhase.cpp │ ├── b2BroadPhase.h │ ├── b2CollideCircle.cpp │ ├── b2CollideEdge.cpp │ ├── b2CollidePolygon.cpp │ ├── b2Collision.cpp │ ├── b2Collision.h │ ├── b2Distance.cpp │ ├── b2Distance.h │ ├── b2DynamicTree.cpp │ ├── b2DynamicTree.h │ ├── b2TimeOfImpact.cpp │ └── b2TimeOfImpact.h │ ├── Common │ ├── b2BlockAllocator.cpp │ ├── b2BlockAllocator.h │ ├── b2Draw.cpp │ ├── b2Draw.h │ ├── b2GrowableStack.h │ ├── b2Math.cpp │ ├── b2Math.h │ ├── b2Settings.cpp │ ├── b2Settings.h │ ├── b2StackAllocator.cpp │ ├── b2StackAllocator.h │ ├── b2Timer.cpp │ └── b2Timer.h │ ├── Dynamics │ ├── Contacts │ │ ├── b2ChainAndCircleContact.cpp │ │ ├── b2ChainAndCircleContact.h │ │ ├── b2ChainAndPolygonContact.cpp │ │ ├── b2ChainAndPolygonContact.h │ │ ├── b2CircleContact.cpp │ │ ├── b2CircleContact.h │ │ ├── b2Contact.cpp │ │ ├── b2Contact.h │ │ ├── b2ContactSolver.cpp │ │ ├── b2ContactSolver.h │ │ ├── b2EdgeAndCircleContact.cpp │ │ ├── b2EdgeAndCircleContact.h │ │ ├── b2EdgeAndPolygonContact.cpp │ │ ├── b2EdgeAndPolygonContact.h │ │ ├── b2PolygonAndCircleContact.cpp │ │ ├── b2PolygonAndCircleContact.h │ │ ├── b2PolygonContact.cpp │ │ └── b2PolygonContact.h │ ├── Joints │ │ ├── b2DistanceJoint.cpp │ │ ├── b2DistanceJoint.h │ │ ├── b2FrictionJoint.cpp │ │ ├── b2FrictionJoint.h │ │ ├── b2GearJoint.cpp │ │ ├── b2GearJoint.h │ │ ├── b2Joint.cpp │ │ ├── b2Joint.h │ │ ├── b2MotorJoint.cpp │ │ ├── b2MotorJoint.h │ │ ├── b2MouseJoint.cpp │ │ ├── b2MouseJoint.h │ │ ├── b2PrismaticJoint.cpp │ │ ├── b2PrismaticJoint.h │ │ ├── b2PulleyJoint.cpp │ │ ├── b2PulleyJoint.h │ │ ├── b2RevoluteJoint.cpp │ │ ├── b2RevoluteJoint.h │ │ ├── b2RopeJoint.cpp │ │ ├── b2RopeJoint.h │ │ ├── b2WeldJoint.cpp │ │ ├── b2WeldJoint.h │ │ ├── b2WheelJoint.cpp │ │ └── b2WheelJoint.h │ ├── b2Body.cpp │ ├── b2Body.h │ ├── b2ContactManager.cpp │ ├── b2ContactManager.h │ ├── b2Fixture.cpp │ ├── b2Fixture.h │ ├── b2Island.cpp │ ├── b2Island.h │ ├── b2TimeStep.h │ ├── b2World.cpp │ ├── b2World.h │ ├── b2WorldCallbacks.cpp │ └── b2WorldCallbacks.h │ ├── License.txt │ ├── Rope │ ├── b2Rope.cpp │ └── b2Rope.h │ └── UseBox2D.cmake ├── flatland_viz ├── CHANGELOG.rst ├── CMakeLists.txt ├── LICENSE ├── include │ └── flatland_viz │ │ ├── flatland_viz.h │ │ ├── flatland_window.h │ │ ├── load_model_dialog.h │ │ ├── model_dialog.h │ │ ├── pause_sim_tool.h │ │ └── spawn_model_tool.h ├── package.xml ├── plugin_description.xml └── src │ ├── flatland_viz.cpp │ ├── flatland_viz_node.cpp │ ├── flatland_window.cpp │ ├── load_model_dialog.cpp │ ├── model_dialog.cpp │ ├── pause_sim_tool.cpp │ └── spawn_model_tool.cpp └── scripts ├── ci_postbuild.sh ├── ci_prebuild.sh ├── clang_tidy_ignore.yaml ├── coverage.sh ├── doxygen.sh └── parse_clang_tidy.py /.clang-format: -------------------------------------------------------------------------------- 1 | BasedOnStyle: "Google" 2 | IndentWidth: 2 3 | SpacesBeforeTrailingComments: 2 -------------------------------------------------------------------------------- /.github/workflows/industrial_ci_action.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | industrial_ci: 7 | strategy: 8 | matrix: 9 | env: 10 | - {ROS_DISTRO: noetic, ROS_REPO: main} 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v1 14 | - uses: 'ros-industrial/industrial_ci@master' 15 | env: ${{matrix.env}} 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | lcov.info 2 | docs/doxygen/* 3 | !docs/doxygen/conf.py 4 | !docs/doxygen/index.rst 5 | docs/_build/* 6 | docs/_templates/* 7 | .vscode/* 8 | */.vscode 9 | .history 10 | */.history -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: generic 2 | services: 3 | - docker 4 | cache: 5 | directories: 6 | - $HOME/.ccache 7 | env: 8 | matrix: 9 | - ROS_DISTRO="kinetic" ROS_REPO=ros AFTER_SETUP_TARGET_WORKSPACE='./scripts/ci_prebuild.sh' AFTER_SCRIPT='./scripts/ci_postbuild.sh' 10 | - ROS_DISTRO="noetic" ROS_REPO=ros AFTER_SETUP_TARGET_WORKSPACE='./scripts/ci_prebuild.sh' 11 | install: 12 | - git clone --quiet --depth 1 https://github.com/ros-industrial/industrial_ci.git .industrial_ci -b master 13 | 14 | script: 15 | - .industrial_ci/travis.sh 16 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ### Contribution guidelines ### 2 | 3 | * code should be unit tested using gtest/rosunit when practical. 4 | * code must be formatted as per clang-format-3.8 --style=file 5 | * code must pass clang-tidy-3.8 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2017, Avidbots Corp. 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # README # 2 | 3 | ![ci test result](https://travis-ci.com/avidbots/flatland.svg?branch=master "CI Test Result") 4 | 5 | 6 | ### What is this repository for? ### 7 | 8 | * Flatland is a performance centric 2d robot simulator 9 | * [Roadmap on trello](https://trello.com/b/s9poP2Jg/flatland-2d-simulator) 10 | * Release Version: None 11 | 12 | ### How do I get set up? ### 13 | 14 | * Git clone flatland into your catkin workspace's src folder, and catkin build. 15 | * Optionally check out [turtlebot_flatland](https://github.com/avidbots/turtlebot_flatland) and run the turtlebot nav stack 16 | * Run `rosdep install --from-paths src --ignore-src` in your catkin workspace to install any missing rosdeps 17 | 18 | ### Who do I talk to? ### 19 | 20 | * Please direct any questions to @josephduchesne 21 | 22 | ### Documentation ### 23 | 24 | * How to use: http://flatland-simulator.readthedocs.io 25 | * Doxygen: http://flatland-simulator-api.readthedocs.io 26 | * For a quick start use: https://github.com/avidbots/turtlebot_flatland 27 | 28 | ### License ### 29 | All Flatland code is BSD 3-clause licensed (see LICENSE for details) 30 | 31 | Flatland uses a number of open source libraries that it includes in its source tree: 32 | - [ThreadPool](https://github.com/progschj/ThreadPool) Copyright (c) 2012 Jakob Progsch, Václav Zeman (zlib license) 33 | - [Tweeny](https://github.com/mobius3/tweeny) Copyright (c) 2016 Leonardo Guilherme de Freitas (MIT license) 34 | - [Box2d](https://github.com/erincatto/Box2D) Copyright (c) 2006-2017 Erin Catto [http://www.box2d.org](http://www.box2d.org) (zlib license) 35 | 36 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = -E 6 | SPHINXBUILD = python -msphinx 7 | SPHINXPROJ = Flatland 8 | SOURCEDIR = . 9 | BUILDDIR = _build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /docs/_static/checkbox6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avidbots/flatland/6601c6560190372f304a45f3a0f758ea9ca8ea5b/docs/_static/checkbox6.gif -------------------------------------------------------------------------------- /docs/_static/conestogo_office.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avidbots/flatland/6601c6560190372f304a45f3a0f758ea9ca8ea5b/docs/_static/conestogo_office.png -------------------------------------------------------------------------------- /docs/_static/flatland_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avidbots/flatland/6601c6560190372f304a45f3a0f758ea9ca8ea5b/docs/_static/flatland_logo.png -------------------------------------------------------------------------------- /docs/_static/flatland_logo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avidbots/flatland/6601c6560190372f304a45f3a0f758ea9ca8ea5b/docs/_static/flatland_logo2.png -------------------------------------------------------------------------------- /docs/_static/flatland_window.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avidbots/flatland/6601c6560190372f304a45f3a0f758ea9ca8ea5b/docs/_static/flatland_window.gif -------------------------------------------------------------------------------- /docs/_static/flatland_window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avidbots/flatland/6601c6560190372f304a45f3a0f758ea9ca8ea5b/docs/_static/flatland_window.png -------------------------------------------------------------------------------- /docs/_static/hello_world.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avidbots/flatland/6601c6560190372f304a45f3a0f758ea9ca8ea5b/docs/_static/hello_world.png -------------------------------------------------------------------------------- /docs/_static/ps3_small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avidbots/flatland/6601c6560190372f304a45f3a0f758ea9ca8ea5b/docs/_static/ps3_small.jpg -------------------------------------------------------------------------------- /docs/_static/spawn_model_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avidbots/flatland/6601c6560190372f304a45f3a0f758ea9ca8ea5b/docs/_static/spawn_model_button.png -------------------------------------------------------------------------------- /docs/_static/top_level.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avidbots/flatland/6601c6560190372f304a45f3a0f758ea9ca8ea5b/docs/_static/top_level.png -------------------------------------------------------------------------------- /docs/core_functions/joystick.rst: -------------------------------------------------------------------------------- 1 | .. image:: ../_static/flatland_logo2.png 2 | :width: 250px 3 | :align: right 4 | :target: ../_static/flatland_logo2.png 5 | 6 | Using a joystick 7 | ================ 8 | 9 | The purpose of the teleop_twist package is to provide a generic facility 10 | for tele-operating Twist-based ROS robots with a standard joystick. It is for use 11 | with a joystick such as the PS3 controller. 12 | 13 | .. image:: ../_static/ps3_small.jpg 14 | :width: 250px 15 | :align: right 16 | :target: ../_static/ps3_small.jpg 17 | 18 | Download and install the joy software from the ROS wiki: joy_. 19 | 20 | .. _joy: http://wiki.ros.org/joy 21 | 22 | Download and install the teleop_twist software from the ROS wiki: teleop_twist_. 23 | 24 | .. _teleop_twist: http://wiki.ros.org/teleop_twist_joy 25 | 26 | Run the software 27 | 28 | .. code-block:: none 29 | 30 | roslaunch teleop_twist_joy teleop.launch 31 | 32 | .. note:: It is best to launch from a dedicated terminal (ties up window). 33 | 34 | .. note:: Ctrl-c to exit. 35 | -------------------------------------------------------------------------------- /docs/core_functions/ros_launch.rst: -------------------------------------------------------------------------------- 1 | .. image:: ../_static/flatland_logo2.png 2 | :width: 250px 3 | :align: right 4 | :target: ../_static/flatland_logo2.png 5 | 6 | Launching Flatland Server Node 7 | ============================== 8 | 9 | Flatland Server provides a launch file to start the 2D simulator. The parameters 10 | for the launch file is specified below. 11 | 12 | Run this following command to launch the simulator using default parameters 13 | 14 | .. code-block:: bash 15 | 16 | $ roslaunch flatland_server server.launch world_path:=/path/to/world.yaml 17 | 18 | 19 | Here are the full list of parameters with the default values 20 | 21 | .. code-block:: bash 22 | 23 | $ roslaunch flatland_server server.launch world_path:=/path/to/world.yaml \ 24 | update_rate:=200.0 \ 25 | step_size:=0.005 \ 26 | show_viz:=true \ 27 | viz_pub_rate:=30.0 \ 28 | use_rviz:=false \ 29 | simplify_map:=2 30 | 31 | * **world_path**: path to world.yaml 32 | * **update_rate**: the real time rate to run the simulation loop in Hz 33 | * **step_size**: amount of time to step each loop in seconds 34 | * **show_viz**: show visualization, pops the flatland_viz window and publishes 35 | visualization messages, either true or false 36 | * **viz_pub_rate**: rate to publish visualization in Hz, works only when show_viz=true 37 | * **use_rviz**: works only when show_viz=true, set this to disable flatland_viz popup 38 | * **simplify_map**: Simpify map during vector tracing: 0=None (default), 1=moderately, 2=significantly -------------------------------------------------------------------------------- /docs/core_functions/ros_services.rst: -------------------------------------------------------------------------------- 1 | .. image:: ../_static/flatland_logo2.png 2 | :width: 250px 3 | :align: right 4 | :target: ../_static/flatland_logo2.png 5 | 6 | Flatland ROS Services 7 | ===================== 8 | 9 | Flatland offers means for manipulating the simulation through ROS services. 10 | The following are the services offered by the simulator. 11 | 12 | Spawning Models 13 | --------------- 14 | Models can be spawned dynamically after instantiation of the world. The parameters 15 | are same as the ones for models in YAML files, all input parameters are required. 16 | 17 | Request: 18 | 19 | .. code-block:: bash 20 | 21 | string yaml_path # path to model yaml file 22 | string name # name of the model 23 | string ns # namespace, use "" for no namespace 24 | geometry_msgs/Pose2D pose # model pose 25 | 26 | Response: 27 | 28 | .. code-block:: bash 29 | 30 | bool success # to check if the operation is successful 31 | string message # error message if unsuccessful 32 | 33 | 34 | Deleting Models 35 | --------------- 36 | 37 | Request: 38 | 39 | .. code-block:: bash 40 | 41 | string name # name of the model to delete 42 | 43 | Response: 44 | 45 | .. code-block:: bash 46 | 47 | bool success # check if the operation is successful 48 | string message # error message if unsuccessful 49 | 50 | Moving Models 51 | --------------- 52 | After spawning the model in the world, this service can be used to directly set the 53 | position and orientation of the vehicle in the global frame. 54 | 55 | Request: 56 | 57 | .. code-block:: bash 58 | 59 | string name # name of the model to move 60 | geometry_msgs/Pose2D pose # desired new global pose 61 | 62 | Response: 63 | 64 | .. code-block:: bash 65 | 66 | bool success # check if the operation is successful 67 | string message # error message if unsuccessful 68 | 69 | -------------------------------------------------------------------------------- /docs/doxygen/index.rst: -------------------------------------------------------------------------------- 1 | Welcome to Flatland's API documentation! 2 | ========================================== 3 | Flatland is a performance centric 2D robot simulator started at Avidbots Corp.. 4 | It is intended for use as a light weight alternative to Gazebo Simulator for 5 | ground robots on flat ground. Flatland uses Box2D for physics simulation and 6 | it is built to integrate directly with ROS. Flatland loads its simulation 7 | environment from YAML files and provide a plugin system for extending its 8 | functionalities. 9 | 10 | This read-the-docs contains documentation for the classes in Flatland. 11 | 12 | The code is open source and `available on Github `_, 13 | BSD3 License. 14 | -------------------------------------------------------------------------------- /docs/included_plugins/bool_sensor.rst: -------------------------------------------------------------------------------- 1 | .. image:: ../_static/flatland_logo2.png 2 | :width: 250px 3 | :align: right 4 | :target: ../_static/flatland_logo2.png 5 | 6 | Bool Sensor 7 | =========== 8 | 9 | The boolean sensor plugin attaches to a single body of a model and publishes :command:`true` `std_msgs/Bool `_ if something collides with it, and :command:`false` otherwise. 10 | 11 | This can be used on solid bodies (default), or sensor bodies (:command:`sensor: true`). 12 | 13 | The plugin also respects layers. For example a sensor body that exists only on layer "robot" will only emit :command:`true` if an entity on layer :robot" collides with it. 14 | 15 | The sensor plugin "latches" collisions, so if there is a collision since the previous publishing, it will always publish at least one :command:`true`. 16 | 17 | 18 | .. code-block:: yaml 19 | 20 | plugins: 21 | 22 | # required, specify BoolSensor type to load the plugin 23 | - type: BoolSensor 24 | 25 | # required, name of the plugin, unique within the model 26 | name: MyBoolSensor 27 | 28 | # The ROS topic name to publish on ("/detector_out") 29 | # This will respect model namespaces 30 | # e.g. if this model has namespace "foo", it will publish on "/foo/detector_out" 31 | topic: detector_out 32 | 33 | # The update rate in hz 34 | update_rate: 10 35 | 36 | # The model body to detect collisions on 37 | # Currently only supports collisions on a single body 38 | body: detector -------------------------------------------------------------------------------- /docs/included_plugins/gps.rst: -------------------------------------------------------------------------------- 1 | .. image:: ../_static/flatland_logo2.png 2 | :width: 250px 3 | :align: right 4 | :target: ../_static/flatland_logo2.png 5 | 6 | 7 | GPS 8 | ========== 9 | This plugin provides a simple simulation of a perfectly-accurate GPS receiver. 10 | 11 | * Reference latitude and longitude are set in the plugin's YAML parameters. The reference coordinates correspond to (0, 0) in the Flatland world frame. 12 | 13 | * The model's ground truth position in the Flatland world frame is treated as the position in an East-North-Up (ENU) reference frame relative to (0, 0). 14 | 15 | * The ENU coordinates are converted to latitude and longitude using the specified reference coordinates and plugging everything into standard equations as defined on `Wikipedia `_ 16 | 17 | * Publishes a `sensor_msgs/NavSatFix `_ message with the current geodetic position of the vehicle. 18 | 19 | .. code-block:: yaml 20 | 21 | plugins: 22 | 23 | # required, specify Gps type to load the plugin 24 | - type: Gps 25 | 26 | # required, name of the plugin 27 | name: turtlebot_gps 28 | 29 | # required, body of a model to set location of simulated GPS antenna 30 | body: base 31 | 32 | # optional, defaults to "gps/fix", the topic to advertise for GPS fix outputs 33 | topic: gps/fix 34 | 35 | # optional, defaults to 10, rate to publish GPS fix, in Hz 36 | update_rate: 10 37 | 38 | # optional, defaults to true, whether to publish TF 39 | broadcast_tf: true 40 | 41 | # optional, default to name of this plugin, the TF frame id to publish TF with 42 | # only used when broadcast_tf=true 43 | frame: my_frame_name 44 | 45 | # optional, defaults to 0.0, latitude in degrees corresponding 46 | # to (0, 0) in world frame 47 | ref_lat: 0.0 48 | 49 | # optional, defaults to 0.0, longitude in degrees corresponding 50 | # to (0, 0) in world frame 51 | ref_lon: 0.0 52 | 53 | # optional, default to [0, 0, 0], in the form of [x, y, yaw], the position 54 | # and orientation to place GPS antenna relative to specified model body 55 | origin: [0, 0, 0] 56 | -------------------------------------------------------------------------------- /docs/included_plugins/model_tf_publisher.rst: -------------------------------------------------------------------------------- 1 | .. image:: ../_static/flatland_logo2.png 2 | :width: 250px 3 | :align: right 4 | :target: ../_static/flatland_logo2.png 5 | 6 | Model TF Publisher 7 | ================== 8 | 9 | Model TF publisher broadcasts TF of bodies in the model. It obtains world position 10 | and orientation of bodies from the simulation, calculates relative transformation 11 | w.r.t. the specifies reference body, and broadcast the TF. 12 | 13 | .. code-block:: yaml 14 | 15 | plugins: 16 | 17 | # required, specify model tf publisher plugin to load this plugin 18 | - type: ModelTfPublisher 19 | 20 | # required, name of the model tf publisher plugin, must be unique 21 | name: state_publisher 22 | 23 | # optional, defaults to inf (broadcast every iteration) 24 | update_rate: .inf 25 | 26 | # optional, defaults to false, whether to broadcast TF w.r.t. to a frame frame 27 | publish_tf_world: false 28 | 29 | # optional, defaults to map, the world frame ID, only used when 30 | # publish_tf_world is set to true 31 | world_frame_id: map 32 | 33 | # optional, defaults to the first body in the model, the reference body to 34 | # broadcast all other bodies' TF with respect to. Does not affect actual 35 | # transformation, only affects how the TF tree looks 36 | reference: base_link 37 | 38 | # optional, defaults to [], bodies to not broadcast TF for 39 | exclude: [] 40 | 41 | # another example 42 | - type: ModelTfPublisher 43 | name: state_publisher_2 44 | 45 | # another example 46 | - type: ModelTfPublisher 47 | name: state_publisher_3 48 | exclude: ["castor_wheel"] -------------------------------------------------------------------------------- /docs/included_plugins/tween.rst: -------------------------------------------------------------------------------- 1 | .. image:: ../_static/flatland_logo2.png 2 | :width: 250px 3 | :align: right 4 | :target: ../_static/flatland_logo2.png 5 | 6 | Tween 7 | ===== 8 | 9 | The tween plugin moves a body from it's start location to a relative end position. 10 | 11 | This can be done using a variety of tween modes and easings. 12 | 13 | Modes 14 | ^^^^^ 15 | 16 | - ``yoyo`` - move back and forth between the start and end position repeatedly 17 | - ``once`` - move to the end position and stop 18 | - ``loop`` - move to the end position then teleport back, then repeat indefinitely 19 | - ``trigger`` - move towards the end position if the "trigger_topic" ros topic recieves ``true``, move towards start otherwise. 20 | 21 | Easings 22 | ^^^^^^^ 23 | 24 | The default easing is "linear", but the following is a complete list of supported easing modes: 25 | 26 | - ``linear`` 27 | - ``quadraticIn``, ``quadraticOut``, ``quadraticInOut`` 28 | - ``cubicIn``, ``cubicOut``, ``cubicInOut`` 29 | - ``quarticIn``, ``quarticOut``, ``quarticInOut`` 30 | - ``quinticIn``, ``quinticOut``, ``quinticInOut`` 31 | - ``exponentialIn``, ``exponentialOut``, ``exponentialInOut`` 32 | - ``circularIn``, ``circularOut``, ``circularInOut`` 33 | - ``backIn``, ``backOut``, ``backInOut`` 34 | - ``elasticIn``, ``elasticOut``, ``elasticInOut`` 35 | - ``bounceIn``, ``bounceOut``, ``bounceInOut`` 36 | 37 | You can see visual examples of these easing modes `here at easings.net `_. 38 | 39 | Configuration 40 | ^^^^^^^^^^^^^ 41 | 42 | .. code-block:: yaml 43 | 44 | plugins: 45 | 46 | # required, specify Tween type to load the plugin 47 | - type: Tween 48 | 49 | # required, name of the plugin, unique within the model 50 | name: MyTweenPlugin 51 | 52 | # The tween mode (documented above, default 'yoyo') 53 | mode: yoyo 54 | 55 | # The easing mode (documented above, default 'linear') 56 | easing: cubicInOut 57 | 58 | # The ROS topic name to subscribe to for 'trigger' mode ("/tween_trigger") 59 | # This will respect model namespaces 60 | # e.g. if this model has namespace "foo", it will publish on "/foo/tween_trigger" 61 | trigger_topic: tween_trigger 62 | 63 | # animation duration in seconds (default 1 second) 64 | duration: 10 65 | 66 | # The tween delta pose (delta x, y and angle) 67 | # The following will move the object to x += 2, y += 3, and angle += 1.1 68 | # relative to the start position 69 | delta: [2, 3, 1.1] 70 | 71 | # The model body to move 72 | body: some_body -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | Welcome to Flatland's documentation! 2 | ==================================== 3 | Flatland is a performance centric 2D robot simulator started at Avidbots Corp.. 4 | It is intended for use as a light weight alternative to Gazebo Simulator for 5 | ground robots on a flat surface. Flatland uses Box2D for physics simulation and 6 | it is built to integrate directly with ROS. Flatland loads its simulation 7 | environment from YAML files and provide a plugin system for extending its 8 | functionalities. 9 | 10 | The code is open source and `available on Github `_, 11 | BSD3 License. 12 | 13 | Class APIs are documented `here `_. 14 | 15 | .. toctree:: 16 | :maxdepth: 2 17 | :caption: Getting Started 18 | 19 | overview 20 | quick_start 21 | 22 | .. toctree:: 23 | :maxdepth: 2 24 | :caption: Flatland Tutorials 25 | 26 | flatland_tutorials/create_plugin.rst 27 | flatland_tutorials/create_model.rst 28 | flatland_tutorials/spawn_model.rst 29 | flatland_tutorials/custom_robot.rst 30 | 31 | .. toctree:: 32 | :maxdepth: 2 33 | :caption: Core Functionalities 34 | 35 | core_functions/ros_launch 36 | core_functions/world 37 | core_functions/layers 38 | core_functions/models 39 | core_functions/yaml_preprocessor 40 | core_functions/ros_services 41 | core_functions/model_plugins 42 | core_functions/joystick 43 | 44 | 45 | .. toctree:: 46 | :maxdepth: 2 47 | :caption: Built-in Plugins 48 | 49 | included_plugins/bumper 50 | included_plugins/bool_sensor 51 | included_plugins/diff_drive 52 | included_plugins/tricycle_drive 53 | included_plugins/laser 54 | included_plugins/model_tf_publisher 55 | included_plugins/tween 56 | included_plugins/gps 57 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=python -msphinx 9 | ) 10 | set SPHINXOPTS=-E 11 | set SOURCEDIR=. 12 | set BUILDDIR=_build 13 | set SPHINXPROJ=Flatland 14 | 15 | if "%1" == "" goto help 16 | 17 | %SPHINXBUILD% >NUL 2>NUL 18 | if errorlevel 9009 ( 19 | echo. 20 | echo.The Sphinx module was not found. Make sure you have Sphinx installed, 21 | echo.then set the SPHINXBUILD environment variable to point to the full 22 | echo.path of the 'sphinx-build' executable. Alternatively you may add the 23 | echo.Sphinx directory to PATH. 24 | echo. 25 | echo.If you don't have Sphinx installed, grab it from 26 | echo.http://sphinx-doc.org/ 27 | exit /b 1 28 | ) 29 | 30 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 31 | goto end 32 | 33 | :help 34 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 35 | 36 | :end 37 | popd 38 | -------------------------------------------------------------------------------- /docs/model1.yaml: -------------------------------------------------------------------------------- 1 | bodies: 2 | - name: base 3 | type: dynamic 4 | color: [1, 1, 1, 1] 5 | footprints: 6 | - type: polygon 7 | density: 100 8 | points: [ [-1.03, -0.337], 9 | [.07983, -0.337], 10 | [.30, -.16111], 11 | [.30, .16111], 12 | [.07983, 0.337], 13 | [-1.03, 0.337] ] 14 | -------------------------------------------------------------------------------- /flatland/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ========== 2 | Change Log 3 | ========== 4 | 5 | This project adheres to `Semantic Versioning `_. 6 | 7 | 1.4.1 (2023-11-24) 8 | ------------------ 9 | * CMake version required bump to fix ros build farm warning 10 | 11 | 1.4.0 (2023-11-22) 12 | ------------------ 13 | * Version Bump 14 | 15 | 1.1.0 16 | ------------------ 17 | * Added Lua based parametric model yaml files 18 | 19 | 1.0.0 20 | ------------------ 21 | * Initial version 22 | 23 | -------------------------------------------------------------------------------- /flatland/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.0.2) 2 | project(flatland) 3 | find_package(catkin REQUIRED) 4 | catkin_metapackage() 5 | -------------------------------------------------------------------------------- /flatland/LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2023, Avidbots Corp. 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /flatland/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | flatland 4 | 1.4.1 5 | 6 | This is the metapackage for flatland. 7 | 8 | Joseph Duchesne 9 | BSD 10 | 11 | catkin 12 | 13 | flatland_msgs 14 | flatland_plugins 15 | flatland_server 16 | flatland_viz 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /flatland_msgs/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package flatland_msgs 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 1.4.1 (2023-11-24) 6 | ------------------ 7 | * CMake version required bump to fix ros build farm warning 8 | 9 | 10 | 1.4.0 (2023-11-22) 11 | ------------------ 12 | * Version Bump 13 | 14 | 1.3.3 (2023-02-06) 15 | ------------------ 16 | * Merge pull request `#95 `_ from avidbots/per-package-licenses 17 | Per package licenses 18 | * Contributors: Joseph Duchesne 19 | 20 | * Merge pull request `#95 `_ from avidbots/per-package-licenses 21 | Per package licenses 22 | * Contributors: Joseph Duchesne 23 | 24 | * Merge pull request `#95 `_ from avidbots/per-package-licenses 25 | Per package licenses 26 | * Contributors: Joseph Duchesne 27 | -------------------------------------------------------------------------------- /flatland_msgs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.0.2) 2 | project(flatland_msgs) 3 | 4 | # Ensure we're using c++11 5 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") 6 | 7 | ## Find catkin macros and libraries 8 | ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) 9 | ## is used, also find other catkin packages 10 | find_package(catkin REQUIRED COMPONENTS 11 | std_msgs 12 | geometry_msgs 13 | message_generation 14 | ) 15 | 16 | ## System dependencies are found with CMake's conventions 17 | find_package(PkgConfig REQUIRED) 18 | 19 | ################ 20 | ## Build MSGS ## 21 | ################ 22 | add_message_files(FILES 23 | DebugTopicList.msg 24 | Collision.msg 25 | Collisions.msg 26 | Vector2.msg 27 | ) 28 | 29 | add_service_files(FILES 30 | SpawnModel.srv 31 | DeleteModel.srv 32 | MoveModel.srv 33 | ) 34 | 35 | generate_messages( 36 | DEPENDENCIES 37 | std_msgs 38 | geometry_msgs 39 | ) 40 | 41 | ################################### 42 | ## catkin specific configuration ## 43 | ################################### 44 | catkin_package( 45 | INCLUDE_DIRS 46 | CATKIN_DEPENDS std_msgs geometry_msgs message_runtime 47 | ) 48 | 49 | ########### 50 | ## Build ## 51 | ########### 52 | 53 | include_directories( 54 | ${catkin_INCLUDE_DIRS} 55 | ) 56 | -------------------------------------------------------------------------------- /flatland_msgs/LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2023, Avidbots Corp. 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /flatland_msgs/msg/Collision.msg: -------------------------------------------------------------------------------- 1 | string entity_A 2 | string body_A 3 | string entity_B 4 | string body_B 5 | float64[] magnitude_forces 6 | Vector2[] contact_positions 7 | Vector2[] contact_normals -------------------------------------------------------------------------------- /flatland_msgs/msg/Collisions.msg: -------------------------------------------------------------------------------- 1 | std_msgs/Header header 2 | Collision[] collisions -------------------------------------------------------------------------------- /flatland_msgs/msg/DebugTopicList.msg: -------------------------------------------------------------------------------- 1 | string[] topics -------------------------------------------------------------------------------- /flatland_msgs/msg/Vector2.msg: -------------------------------------------------------------------------------- 1 | float64 x 2 | float64 y -------------------------------------------------------------------------------- /flatland_msgs/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | flatland_msgs 4 | 1.4.1 5 | The flatland_msgs package 6 | BSD 7 | https://bitbucket.org/avidbots/flatland 8 | 9 | Joseph Duchesne 10 | Joseph Duchesne 11 | Chunshang Li 12 | 13 | catkin 14 | 15 | cmake_modules 16 | message_generation 17 | 18 | std_msgs 19 | geometry_msgs 20 | 21 | message_runtime 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /flatland_msgs/srv/DeleteModel.srv: -------------------------------------------------------------------------------- 1 | string name 2 | --- 3 | bool success 4 | string message 5 | -------------------------------------------------------------------------------- /flatland_msgs/srv/MoveModel.srv: -------------------------------------------------------------------------------- 1 | string name 2 | geometry_msgs/Pose2D pose 3 | --- 4 | bool success 5 | string message 6 | -------------------------------------------------------------------------------- /flatland_msgs/srv/SpawnModel.srv: -------------------------------------------------------------------------------- 1 | string yaml_path 2 | string name 3 | string ns 4 | geometry_msgs/Pose2D pose 5 | --- 6 | bool success 7 | string message 8 | -------------------------------------------------------------------------------- /flatland_plugins/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package flatland_plugins 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 1.4.1 (2023-11-24) 6 | ------------------ 7 | * CMake version required bump to fix ros build farm warning 8 | 9 | 1.4.0 (2023-11-22) 10 | ------------------ 11 | * Merge pull request `#103 `_ adding 12 | * Contributors: Marc Gallant, Marc Bosch-Jorge 13 | 14 | 1.3.3 (2023-02-06) 15 | ------------------ 16 | * Merge pull request `#95 `_ from avidbots/per-package-licenses 17 | Per package licenses 18 | * Contributors: Joseph Duchesne 19 | 20 | * Merge pull request `#95 `_ from avidbots/per-package-licenses 21 | Per package licenses 22 | * Contributors: Joseph Duchesne 23 | 24 | * Merge pull request `#95 `_ from avidbots/per-package-licenses 25 | Per package licenses 26 | * Contributors: Joseph Duchesne 27 | -------------------------------------------------------------------------------- /flatland_plugins/LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2023, Avidbots Corp. 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /flatland_plugins/flatland_plugins.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Flatland laser plugin 4 | 5 | 6 | Flatland tricycle plugin 7 | 8 | 9 | Flatland differential drive plugin 10 | 11 | 12 | Flatland imu plugin 13 | 14 | 15 | Publish body transformations 16 | 17 | 18 | Contact sensor for a robot 19 | 20 | 21 | Tween a model between two positions 22 | 23 | 24 | Publish a boolean topic on collision 25 | 26 | 27 | Simulate GPS receiver and publish a NavSatFix message 28 | 29 | 30 | Add random walls into the world 31 | 32 | 33 | -------------------------------------------------------------------------------- /flatland_plugins/include/thirdparty/tweeny/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Leonardo Guilherme de Freitas 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /flatland_plugins/include/thirdparty/tweeny/dispatcher.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the Tweeny library. 3 | 4 | Copyright (c) 2016-2017 Leonardo G. Lucena de Freitas 5 | Copyright (c) 2016 Guilherme R. Costa 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | this software and associated documentation files (the "Software"), to deal in 9 | the Software without restriction, including without limitation the rights to 10 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | the Software, and to permit persons to whom the Software is furnished to do so, 12 | subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | */ 24 | 25 | /* This file contains code to help call a function applying a tuple as its arguments. 26 | * This code is private and not documented. */ 27 | 28 | #ifndef TWEENY_DISPATCHER_H 29 | #define TWEENY_DISPATCHER_H 30 | 31 | #include 32 | 33 | namespace tweeny { 34 | namespace detail { 35 | template struct seq { }; 36 | template struct gens : gens { }; 37 | template struct gens<0, S...> { 38 | typedef seq type; 39 | }; 40 | 41 | template 42 | R dispatch(Func && f, TupleType && args, seq) { 43 | return f(std::get(args) ...); 44 | } 45 | 46 | template 47 | R call(Func && f, const std::tuple & args) { 48 | return dispatch(f, args, typename gens::type()); 49 | } 50 | } 51 | } 52 | 53 | #endif //TWEENY_DISPATCHER_H 54 | -------------------------------------------------------------------------------- /flatland_plugins/include/thirdparty/tweeny/int2type.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the Tweeny library. 3 | 4 | Copyright (c) 2016-2017 Leonardo G. Lucena de Freitas 5 | Copyright (c) 2016 Guilherme R. Costa 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | this software and associated documentation files (the "Software"), to deal in 9 | the Software without restriction, including without limitation the rights to 10 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | the Software, and to permit persons to whom the Software is furnished to do so, 12 | subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | */ 24 | 25 | /* 26 | * This file declares a helper struct to create a type from a integer value, to aid in template tricks. 27 | * This file is private. 28 | */ 29 | #ifndef TWEENY_INT2TYPE_H 30 | #define TWEENY_INT2TYPE_H 31 | 32 | namespace tweeny { 33 | namespace detail { 34 | template struct int2type { }; 35 | } 36 | } 37 | #endif //TWEENY_INT2TYPE_H 38 | -------------------------------------------------------------------------------- /flatland_plugins/include/thirdparty/tweeny/tweeny.tcc: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of the Tweeny library. 3 | 4 | Copyright (c) 2016-2017 Leonardo G. Lucena de Freitas 5 | Copyright (c) 2016 Guilherme R. Costa 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | this software and associated documentation files (the "Software"), to deal in 9 | the Software without restriction, including without limitation the rights to 10 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | the Software, and to permit persons to whom the Software is furnished to do so, 12 | subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | */ 24 | 25 | /* 26 | * This file provides the implementation for tweeny.h 27 | */ 28 | 29 | #ifndef TWEENY_TWEENY_TCC 30 | #define TWEENY_TWEENY_TCC 31 | 32 | #include "tween.h" 33 | 34 | namespace tweeny { 35 | template inline tween from(Ts... vs) { 36 | return tween::from(vs...); 37 | } 38 | } 39 | 40 | #endif //TWEENY_TWEENY_TCC 41 | -------------------------------------------------------------------------------- /flatland_plugins/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | flatland_plugins 4 | 1.4.1 5 | Default plugins for flatland 6 | BSD 7 | https://bitbucket.org/avidbots/flatland 8 | 9 | Joseph Duchesne 10 | Joseph Duchesne 11 | Chunshang Li 12 | Mike Brousseau 13 | 14 | catkin 15 | 16 | flatland_server 17 | pluginlib 18 | roscpp 19 | yaml-cpp 20 | cmake_modules 21 | tf 22 | std_msgs 23 | sensor_msgs 24 | flatland_msgs 25 | nav_msgs 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /flatland_plugins/test/bumper_test.test: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flatland_plugins/test/bumper_tests/collision_test/map_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avidbots/flatland/6601c6560190372f304a45f3a0f758ea9ca8ea5b/flatland_plugins/test/bumper_tests/collision_test/map_1.png -------------------------------------------------------------------------------- /flatland_plugins/test/bumper_tests/collision_test/map_1.yaml: -------------------------------------------------------------------------------- 1 | image: map_1.png 2 | resolution: 0.1 3 | origin: [-5, -5, 0] 4 | negate: 0 5 | occupied_thresh: 0.65 6 | free_thresh: 0.196 7 | 8 | -------------------------------------------------------------------------------- /flatland_plugins/test/bumper_tests/collision_test/robot.model.yaml: -------------------------------------------------------------------------------- 1 | # Turtlebot 2 | 3 | 4 | bodies: # List of named bodies 5 | - name: base_link_1 6 | pose: [0, 0, 0] 7 | type: dynamic 8 | color: [1, 1, 1, 0.5] 9 | footprints: 10 | - type: circle 11 | density: 30 12 | center: [0, 0] 13 | radius: 1 14 | sensor: true 15 | 16 | - name: base_link_2 17 | pose: [0, 0, 0] 18 | type: dynamic 19 | color: [1, 1, 1, 0.5] 20 | footprints: 21 | - type: circle 22 | density: 1 23 | center: [0, 0] 24 | radius: 0.4 25 | 26 | joints: 27 | - name: bodies_weld 28 | type: weld 29 | bodies: 30 | - name: base_link_1 31 | anchor: [0, 0] 32 | - name: base_link_2 33 | anchor: [0, 0] 34 | 35 | plugins: 36 | - type: Bumper 37 | name: Bumper_A 38 | 39 | - type: Bumper 40 | name: Bumper_B 41 | world_frame_id: world 42 | topic: collisions_B 43 | publish_all_collisions: false 44 | update_rate: 10 45 | exclude: ["base_link_1"] -------------------------------------------------------------------------------- /flatland_plugins/test/bumper_tests/collision_test/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: 3 | - name: "layer_1" 4 | map: "map_1.yaml" 5 | color: [0, 1, 0, 1] 6 | models: 7 | - name: robot1 8 | pose: [-2, 0, 0] 9 | model: robot.model.yaml -------------------------------------------------------------------------------- /flatland_plugins/test/bumper_tests/invalid_A/robot.model.yaml: -------------------------------------------------------------------------------- 1 | # Turtlebot 2 | 3 | 4 | bodies: # List of named bodies 5 | - name: base_link_1 6 | pose: [0, 0, 0] 7 | type: dynamic 8 | color: [1, 1, 1, 0.5] 9 | footprints: 10 | - type: circle 11 | density: 30 12 | center: [0, 0] 13 | radius: 1 14 | sensor: true 15 | 16 | plugins: 17 | - type: Bumper 18 | name: Bumper_B 19 | world_frame_id: world 20 | topic: collisions_B 21 | publish_all_collisions: false 22 | update_rate: 10 23 | exclude: ["random_body"] -------------------------------------------------------------------------------- /flatland_plugins/test/bumper_tests/invalid_A/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: 3 | - name: "layer_1" 4 | map: "../collision_test/map_1.yaml" 5 | color: [0, 1, 0, 1] 6 | models: 7 | - name: robot1 8 | pose: [-2, 0, 0] 9 | model: robot.model.yaml 10 | -------------------------------------------------------------------------------- /flatland_plugins/test/diff_drive_test.test: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flatland_plugins/test/gps_test.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | TEST(GpsPluginTest, load_test) { 8 | pluginlib::ClassLoader loader( 9 | "flatland_server", "flatland_server::ModelPlugin"); 10 | 11 | try { 12 | boost::shared_ptr plugin = 13 | loader.createInstance("flatland_plugins::Gps"); 14 | } catch (pluginlib::PluginlibException& e) { 15 | FAIL() << "Failed to load GPS plugin. " << e.what(); 16 | } 17 | } 18 | 19 | // Run all the tests that were declared with TEST() 20 | int main(int argc, char** argv) { 21 | ros::init(argc, argv, "gps_test"); 22 | testing::InitGoogleTest(&argc, argv); 23 | return RUN_ALL_TESTS(); 24 | } 25 | -------------------------------------------------------------------------------- /flatland_plugins/test/gps_test.test: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /flatland_plugins/test/imu_test.test: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /flatland_plugins/test/laser_test.test: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flatland_plugins/test/laser_tests/intensity_test/map_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avidbots/flatland/6601c6560190372f304a45f3a0f758ea9ca8ea5b/flatland_plugins/test/laser_tests/intensity_test/map_1.png -------------------------------------------------------------------------------- /flatland_plugins/test/laser_tests/intensity_test/map_1.yaml: -------------------------------------------------------------------------------- 1 | image: map_1.png 2 | resolution: 0.1 3 | origin: [0, 0, 0] 4 | negate: 0 5 | occupied_thresh: 0.65 6 | free_thresh: 0.196 7 | 8 | -------------------------------------------------------------------------------- /flatland_plugins/test/laser_tests/intensity_test/map_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avidbots/flatland/6601c6560190372f304a45f3a0f758ea9ca8ea5b/flatland_plugins/test/laser_tests/intensity_test/map_2.png -------------------------------------------------------------------------------- /flatland_plugins/test/laser_tests/intensity_test/map_2.yaml: -------------------------------------------------------------------------------- 1 | image: map_2.png 2 | resolution: 0.1 3 | origin: [0, 0, 0] 4 | negate: 0 5 | occupied_thresh: 0.65 6 | free_thresh: 0.196 7 | 8 | -------------------------------------------------------------------------------- /flatland_plugins/test/laser_tests/intensity_test/map_reflectance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avidbots/flatland/6601c6560190372f304a45f3a0f758ea9ca8ea5b/flatland_plugins/test/laser_tests/intensity_test/map_reflectance.png -------------------------------------------------------------------------------- /flatland_plugins/test/laser_tests/intensity_test/map_reflectance.yaml: -------------------------------------------------------------------------------- 1 | image: map_reflectance.png 2 | resolution: 0.1 3 | origin: [0, 0, 0] 4 | negate: 0 5 | occupied_thresh: 0.65 6 | free_thresh: 0.196 7 | 8 | -------------------------------------------------------------------------------- /flatland_plugins/test/laser_tests/intensity_test/robot.model.yaml: -------------------------------------------------------------------------------- 1 | # Turtlebot 2 | 3 | bodies: # List of named bodies 4 | - name: base_link 5 | pose: [0, 0, 0] 6 | type: dynamic 7 | color: [1, 1, 0, 1] 8 | footprints: 9 | - type: circle 10 | density: 1 11 | center: [0, 0] 12 | radius: 0.1 13 | 14 | plugins: 15 | - type: Laser 16 | name: laser_front 17 | body: base_link 18 | range: 5 19 | angle: {min: -1.5707963267948966, max: 1.5707963267948966, increment: 1.5707963267948966} 20 | 21 | - type: Laser 22 | name: laser_center 23 | topic: /scan_center 24 | frame: center_laser 25 | body: base_link 26 | origin: [0, 0, 0] 27 | range: 5 28 | update_rate: 5000 29 | angle: {min: 0, max: 6.283185307179586, increment: 1.5707963267948966} 30 | layers: ["layer_1", "reflectance"] 31 | 32 | - type: Laser 33 | name: laser_back 34 | topic: scan_back 35 | body: base_link 36 | origin: [-1, -1, 1.5707963267948966] 37 | range: 4 38 | update_rate: 1 39 | angle: {min: 0, max: 6.283185307179586, increment: 1.5707963267948966} 40 | layers: ["layer_2", "reflectance"] 41 | -------------------------------------------------------------------------------- /flatland_plugins/test/laser_tests/intensity_test/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: 3 | - name: "layer_1" 4 | map: "map_1.yaml" 5 | color: [0, 1, 0, 1] 6 | - name: "layer_2" 7 | map: "map_2.yaml" 8 | color: [0, 1, 0, 1] 9 | - name: "reflectance" 10 | map: "map_reflectance.yaml" 11 | color: [0, 1, 0, 1] 12 | models: 13 | - name: robot1 14 | pose: [5, 5, 0] 15 | model: robot.model.yaml 16 | namespace: "r" 17 | -------------------------------------------------------------------------------- /flatland_plugins/test/laser_tests/invalid_A/robot.model.yaml: -------------------------------------------------------------------------------- 1 | # Turtlebot 2 | 3 | bodies: # List of named bodies 4 | - name: base_link 5 | pose: [0, 0, 0] 6 | type: dynamic 7 | color: [1, 1, 0, 1] 8 | footprints: 9 | - type: circle 10 | density: 1 11 | center: [0, 0] 12 | radius: 0.1 13 | plugins: 14 | - type: Laser 15 | name: laser_center 16 | body: base_link 17 | # range: 5 18 | update_rate: 5000 19 | angle: {min: 0, max: 6.283185307179586, increment: 1.5707963267948966} 20 | layers: ["layer_1"] -------------------------------------------------------------------------------- /flatland_plugins/test/laser_tests/invalid_A/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: 3 | - name: "layer_1" 4 | map: "../range_test/map_1.yaml" 5 | color: [0, 1, 0, 1] 6 | models: 7 | - name: robot1 8 | pose: [5, 5, 0] 9 | model: robot.model.yaml 10 | -------------------------------------------------------------------------------- /flatland_plugins/test/laser_tests/invalid_B/robot.model.yaml: -------------------------------------------------------------------------------- 1 | # Turtlebot 2 | 3 | bodies: # List of named bodies 4 | - name: base_link 5 | pose: [0, 0, 0] 6 | type: dynamic 7 | color: [1, 1, 0, 1] 8 | footprints: 9 | - type: circle 10 | density: 1 11 | center: [0, 0] 12 | radius: 0.1 13 | plugins: 14 | - type: Laser 15 | name: laser_center 16 | body: base_link 17 | range: 5 18 | update_rate: 5000 19 | angle: {min: 0, max: -6.283185307179586, increment: 1.5707963267948966} #invalid 20 | layers: ["layer_1"] -------------------------------------------------------------------------------- /flatland_plugins/test/laser_tests/invalid_B/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: 3 | - name: "layer_1" 4 | map: "../range_test/map_1.yaml" 5 | color: [0, 1, 0, 1] 6 | models: 7 | - name: robot1 8 | pose: [5, 5, 0] 9 | model: robot.model.yaml 10 | -------------------------------------------------------------------------------- /flatland_plugins/test/laser_tests/range_test/map_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avidbots/flatland/6601c6560190372f304a45f3a0f758ea9ca8ea5b/flatland_plugins/test/laser_tests/range_test/map_1.png -------------------------------------------------------------------------------- /flatland_plugins/test/laser_tests/range_test/map_1.yaml: -------------------------------------------------------------------------------- 1 | image: map_1.png 2 | resolution: 0.1 3 | origin: [0, 0, 0] 4 | negate: 0 5 | occupied_thresh: 0.65 6 | free_thresh: 0.196 7 | 8 | -------------------------------------------------------------------------------- /flatland_plugins/test/laser_tests/range_test/map_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avidbots/flatland/6601c6560190372f304a45f3a0f758ea9ca8ea5b/flatland_plugins/test/laser_tests/range_test/map_2.png -------------------------------------------------------------------------------- /flatland_plugins/test/laser_tests/range_test/map_2.yaml: -------------------------------------------------------------------------------- 1 | image: map_2.png 2 | resolution: 0.1 3 | origin: [0, 0, 0] 4 | negate: 0 5 | occupied_thresh: 0.65 6 | free_thresh: 0.196 7 | 8 | -------------------------------------------------------------------------------- /flatland_plugins/test/laser_tests/range_test/robot.model.cw.asymmetrical.yaml: -------------------------------------------------------------------------------- 1 | # Turtlebot 2 | 3 | bodies: # List of named bodies 4 | - name: base_link 5 | pose: [0, 0, 0] 6 | type: dynamic 7 | color: [1, 1, 0, 1] 8 | footprints: 9 | - type: polygon 10 | density: 1.0 11 | points: [[-.5, -0.25], [-.5, 0.25], [.5, 0.25], [.5, -0.25]] 12 | 13 | plugins: 14 | - type: Laser 15 | name: laser_flipped 16 | body: base_link 17 | range: 5 18 | topic: scan1 19 | frame: laser_flipped_custom 20 | upside_down: true 21 | angle: {min: 0, max: 0.21, increment: 0.1} 22 | - type: Laser 23 | name: laser_normal 24 | body: base_link 25 | range: 5 26 | topic: scan2 27 | upside_down: false 28 | angle: {min: 0, max: 0.21, increment: 0.1} 29 | - type: ModelTfPublisher 30 | name: state_publisher 31 | update_rate: .inf 32 | publish_tf_world: true 33 | world_frame_id: map 34 | reference: base_link -------------------------------------------------------------------------------- /flatland_plugins/test/laser_tests/range_test/robot.model.cw.yaml: -------------------------------------------------------------------------------- 1 | # Turtlebot 2 | 3 | bodies: # List of named bodies 4 | - name: base_link 5 | pose: [0, 0, 0] 6 | type: dynamic 7 | color: [1, 1, 0, 1] 8 | footprints: 9 | - type: circle 10 | density: 1 11 | center: [0, 0] 12 | radius: 0.1 13 | 14 | plugins: 15 | - type: Laser 16 | name: laser_front 17 | body: base_link 18 | range: 5 19 | upside_down: true 20 | angle: {min: -1.5707963267948966, max: 1.5707963267948966, increment: 1.5707963267948966} 21 | -------------------------------------------------------------------------------- /flatland_plugins/test/laser_tests/range_test/robot.model.yaml: -------------------------------------------------------------------------------- 1 | # Turtlebot 2 | 3 | bodies: # List of named bodies 4 | - name: base_link 5 | pose: [0, 0, 0] 6 | type: dynamic 7 | color: [1, 1, 0, 1] 8 | footprints: 9 | - type: circle 10 | density: 1 11 | center: [0, 0] 12 | radius: 0.1 13 | 14 | plugins: 15 | - type: Laser 16 | name: laser_front 17 | body: base_link 18 | range: 5 19 | angle: {min: -1.5707963267948966, max: 1.5707963267948966, increment: 1.5707963267948966} 20 | 21 | - type: Laser 22 | name: laser_center 23 | topic: /scan_center 24 | frame: center_laser 25 | body: base_link 26 | origin: [0, 0, 0] 27 | range: 5 28 | update_rate: 5000 29 | angle: {min: 0, max: 6.283185307179586, increment: 1.5707963267948966} 30 | layers: ["layer_1"] 31 | 32 | - type: Laser 33 | name: laser_back 34 | topic: scan_back 35 | body: base_link 36 | origin: [-1, -1, 1.5707963267948966] 37 | range: 4 38 | update_rate: 1 39 | angle: {min: 0, max: 6.283185307179586, increment: 1.5707963267948966} 40 | layers: ["layer_2"] 41 | -------------------------------------------------------------------------------- /flatland_plugins/test/laser_tests/range_test/world.cw.asymmetrical.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: 3 | - name: "layer_1" 4 | map: "map_1.yaml" 5 | color: [0, 1, 0, 1] 6 | - name: "layer_2" 7 | map: "map_2.yaml" 8 | color: [0, 1, 0, 1] 9 | models: 10 | - name: robot1 11 | pose: [5, 5, 0.2] 12 | model: robot.model.cw.asymmetrical.yaml 13 | namespace: "r" 14 | -------------------------------------------------------------------------------- /flatland_plugins/test/laser_tests/range_test/world.cw.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: 3 | - name: "layer_1" 4 | map: "map_1.yaml" 5 | color: [0, 1, 0, 1] 6 | - name: "layer_2" 7 | map: "map_2.yaml" 8 | color: [0, 1, 0, 1] 9 | models: 10 | - name: robot1 11 | pose: [5, 5, 0] 12 | model: robot.model.cw.yaml 13 | namespace: "r" 14 | -------------------------------------------------------------------------------- /flatland_plugins/test/laser_tests/range_test/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: 3 | - name: "layer_1" 4 | map: "map_1.yaml" 5 | color: [0, 1, 0, 1] 6 | - name: "layer_2" 7 | map: "map_2.yaml" 8 | color: [0, 1, 0, 1] 9 | models: 10 | - name: robot1 11 | pose: [5, 5, 0] 12 | model: robot.model.yaml 13 | namespace: "r" 14 | -------------------------------------------------------------------------------- /flatland_plugins/test/model_tf_publisher_test.test: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flatland_plugins/test/model_tf_publisher_tests/invalid_A/robot.model.yaml: -------------------------------------------------------------------------------- 1 | # Turtlebot 2 | 3 | bodies: # List of named bodies 4 | - name: base 5 | pose: [0, 0, 0] 6 | type: dynamic 7 | color: [1, 1, 0, 1] 8 | footprints: 9 | - type: polygon 10 | density: 1 11 | points: [[1.5, 0], [0.9, 0.7], [-0.9, 0.7], [-0.9, -0.7], [0.9, -0.7]] 12 | 13 | plugins: 14 | - type: ModelTfPublisher 15 | name: model_tf_publisher 16 | reference: random_body -------------------------------------------------------------------------------- /flatland_plugins/test/model_tf_publisher_tests/invalid_A/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: 3 | - name: "layer_1" 4 | map: "../tf_publish_test_A/map_1.yaml" 5 | color: [0, 1, 0, 1] 6 | models: 7 | - name: robot1 8 | pose: [8, 6, -0.575958653] 9 | model: robot.model.yaml 10 | -------------------------------------------------------------------------------- /flatland_plugins/test/model_tf_publisher_tests/invalid_B/robot.model.yaml: -------------------------------------------------------------------------------- 1 | # Turtlebot 2 | 3 | bodies: # List of named bodies 4 | - name: base 5 | pose: [0, 0, 0] 6 | type: dynamic 7 | color: [1, 1, 0, 1] 8 | footprints: 9 | - type: polygon 10 | density: 1 11 | points: [[1.5, 0], [0.9, 0.7], [-0.9, 0.7], [-0.9, -0.7], [0.9, -0.7]] 12 | 13 | plugins: 14 | - type: ModelTfPublisher 15 | name: model_tf_publisher 16 | exclude: [random_body_1, random_body_2] -------------------------------------------------------------------------------- /flatland_plugins/test/model_tf_publisher_tests/invalid_B/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: 3 | - name: "layer_1" 4 | map: "../tf_publish_test_A/map_1.yaml" 5 | color: [0, 1, 0, 1] 6 | models: 7 | - name: robot1 8 | pose: [8, 6, -0.575958653] 9 | model: robot.model.yaml 10 | -------------------------------------------------------------------------------- /flatland_plugins/test/model_tf_publisher_tests/tf_publish_test_A/map_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avidbots/flatland/6601c6560190372f304a45f3a0f758ea9ca8ea5b/flatland_plugins/test/model_tf_publisher_tests/tf_publish_test_A/map_1.png -------------------------------------------------------------------------------- /flatland_plugins/test/model_tf_publisher_tests/tf_publish_test_A/map_1.yaml: -------------------------------------------------------------------------------- 1 | image: map_1.png 2 | resolution: 0.5 3 | origin: [-25, -25, 0] 4 | negate: 0 5 | occupied_thresh: 0.65 6 | free_thresh: 0.196 7 | 8 | -------------------------------------------------------------------------------- /flatland_plugins/test/model_tf_publisher_tests/tf_publish_test_A/robot.model.yaml: -------------------------------------------------------------------------------- 1 | # Turtlebot 2 | 3 | bodies: # List of named bodies 4 | - name: base 5 | pose: [0, 0, 0] 6 | type: dynamic 7 | color: [1, 1, 0, 1] 8 | footprints: 9 | - type: polygon 10 | density: 1 11 | points: [[1.5, 0], [0.9, 0.7], [-0.9, 0.7], [-0.9, -0.7], [0.9, -0.7]] 12 | 13 | - name: left_wheel 14 | pose: [-0.25, 1, 0] 15 | type: dynamic 16 | color: [1, 0, 0, 1] 17 | footprints: 18 | - type: polygon 19 | density: 1 20 | points: [[0.75, 0.2], [-0.75, .2], [-0.75, -.2], [0.75, -.2]] 21 | 22 | - name: right_wheel 23 | pose: [-0.25, -1, 0] 24 | type: dynamic 25 | color: [0, 1, 0, 1] 26 | footprints: 27 | - type: polygon 28 | density: 1 29 | points: [[0.75, 0.2], [-0.75, .2], [-0.75, -.2], [0.75, -.2]] 30 | 31 | - name: antenna 32 | pose: [0, 0, 0] 33 | type: dynamic 34 | color: [1, 1, 1, 1] 35 | footprints: 36 | - type: circle 37 | center: [0, 0] 38 | radius: 0.25 39 | density: 1 40 | 41 | - name: front_bumper 42 | pose: [2, 0, 0] 43 | type: dynamic 44 | color: [1, 1, 1, 1] 45 | footprints: 46 | - type: polygon 47 | density: 0 48 | points: [[0.1, 0.1], [-0.1, 0.1], [-0.1, -0.1], [0.1, -0.1]] 49 | 50 | - name: rear_bumper 51 | pose: [-2, 0, 0] 52 | type: dynamic 53 | color: [1, 1, 1, 1] 54 | footprints: 55 | - type: polygon 56 | density: 0 57 | points: [[0.1, 0.1], [-0.1, 0.1], [-0.1, -0.1], [0.1, -0.1]] 58 | 59 | plugins: 60 | - type: ModelTfPublisher 61 | name: model_tf_publisher 62 | update_rate: 5000 63 | world_frame_id: world 64 | publish_tf_world: true 65 | reference: antenna 66 | exclude: ["front_bumper", "rear_bumper"] 67 | 68 | joints: 69 | - name: weld 70 | type: weld 71 | bodies: 72 | - name: base 73 | anchor: [0, 0] 74 | - name: antenna 75 | anchor: [0, 0] 76 | -------------------------------------------------------------------------------- /flatland_plugins/test/model_tf_publisher_tests/tf_publish_test_A/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: 3 | - name: "layer_1" 4 | map: "map_1.yaml" 5 | color: [0, 1, 0, 1] 6 | models: 7 | - name: robot1 8 | pose: [8, 6, -0.575958653] 9 | model: robot.model.yaml 10 | namespace: "my_robot" 11 | -------------------------------------------------------------------------------- /flatland_plugins/test/model_tf_publisher_tests/tf_publish_test_B/robot.model.yaml: -------------------------------------------------------------------------------- 1 | # Turtlebot 2 | 3 | bodies: # List of named bodies 4 | - name: base 5 | pose: [0, 0, 0] 6 | type: dynamic 7 | color: [1, 1, 0, 1] 8 | footprints: 9 | - type: polygon 10 | density: 1 11 | points: [[1.5, 0], [0.9, 0.7], [-0.9, 0.7], [-0.9, -0.7], [0.9, -0.7]] 12 | 13 | - name: left_wheel 14 | pose: [-0.25, 1, 0] 15 | type: dynamic 16 | color: [1, 0, 0, 1] 17 | footprints: 18 | - type: polygon 19 | density: 1 20 | points: [[0.75, 0.2], [-0.75, .2], [-0.75, -.2], [0.75, -.2]] 21 | 22 | - name: right_wheel 23 | pose: [-0.25, -1, 0] 24 | type: dynamic 25 | color: [0, 1, 0, 1] 26 | footprints: 27 | - type: polygon 28 | density: 1 29 | points: [[0.75, 0.2], [-0.75, .2], [-0.75, -.2], [0.75, -.2]] 30 | 31 | - name: antenna 32 | pose: [0, 0, 0] 33 | type: dynamic 34 | color: [1, 1, 1, 1] 35 | footprints: 36 | - type: circle 37 | center: [0, 0] 38 | radius: 0.25 39 | density: 1 40 | 41 | - name: front_bumper 42 | pose: [2, 0, 0] 43 | type: dynamic 44 | color: [1, 1, 1, 1] 45 | footprints: 46 | - type: polygon 47 | density: 0 48 | points: [[0.1, 0.1], [-0.1, 0.1], [-0.1, -0.1], [0.1, -0.1]] 49 | 50 | - name: rear_bumper 51 | pose: [-2, 0, 0] 52 | type: dynamic 53 | color: [1, 1, 1, 1] 54 | footprints: 55 | - type: polygon 56 | density: 0 57 | points: [[0.1, 0.1], [-0.1, 0.1], [-0.1, -0.1], [0.1, -0.1]] 58 | 59 | plugins: 60 | - type: ModelTfPublisher 61 | name: model_tf_publisher 62 | 63 | joints: 64 | - name: weld 65 | type: weld 66 | bodies: 67 | - name: base 68 | anchor: [0, 0] 69 | - name: antenna 70 | anchor: [0, 0] 71 | -------------------------------------------------------------------------------- /flatland_plugins/test/model_tf_publisher_tests/tf_publish_test_B/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: 3 | - name: "layer_1" 4 | map: "../tf_publish_test_A/map_1.yaml" 5 | color: [0, 1, 0, 1] 6 | models: 7 | - name: robot1 8 | pose: [8, 6, -0.575958653] 9 | model: robot.model.yaml -------------------------------------------------------------------------------- /flatland_plugins/test/tricycle_drive_test.test: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flatland_plugins/test/tricycle_drive_tests/cleaner.model.yaml: -------------------------------------------------------------------------------- 1 | 2 | bodies: 3 | - name: base 4 | type: dynamic 5 | color: [1, 1, 1, 0.75] 6 | footprints: 7 | - type: polygon 8 | density: 100 9 | points: [ [-1.03, -0.337], 10 | [.07983, -0.337], 11 | [.30, -.16111], 12 | [.30, .16111], 13 | [.07983, 0.337], 14 | [-1.03, 0.337] ] 15 | - name: front_wheel 16 | color: [1, 1, 1, 0.75] 17 | footprints: 18 | - type: polygon 19 | density: 1.0 20 | points: [[ 0.0875, -0.0250], 21 | [ 0.0875, 0.0250], 22 | [-0.0875, 0.0250], 23 | [-0.0875, -0.0250]] 24 | 25 | - name: rear_left_wheel 26 | color: [1, 1, 1, 0.75] 27 | footprints: 28 | - type: polygon 29 | density: 1.0 30 | points: [[ 0.0875, -0.0255], 31 | [ 0.0875, 0.0255], 32 | [-0.0875, 0.0255], 33 | [-0.0875, -0.0255]] 34 | 35 | - name: rear_right_wheel 36 | color: [1, 1, 1, 0.75] 37 | footprints: 38 | - type: polygon 39 | density: 1.0 40 | points: [[ 0.0875, -0.0255], 41 | [ 0.0875, 0.0255], 42 | [-0.0875, 0.0255], 43 | [-0.0875, -0.0255]] 44 | 45 | joints: 46 | - type: revolute 47 | name: front_wheel_revolute 48 | bodies: 49 | - name: front_wheel 50 | anchor: [0, 0] 51 | - name: base 52 | anchor: [0, 0] 53 | 54 | - type: weld 55 | name: rear_right_wheel_weld 56 | bodies: 57 | - name: rear_left_wheel 58 | anchor: [0, 0] 59 | - name: base 60 | anchor: [-0.83, 0.29] 61 | 62 | - type: weld 63 | name: rear_left_wheel_weld 64 | bodies: 65 | - name: rear_right_wheel 66 | anchor: [0, 0] 67 | - name: base 68 | anchor: [-0.83, -0.29] 69 | 70 | plugins: 71 | - type: TricycleDrive 72 | name: cleaner_drive 73 | body: base 74 | front_wheel_joint: front_wheel_revolute 75 | rear_left_wheel_joint: rear_left_wheel_weld 76 | rear_right_wheel_joint: rear_right_wheel_weld 77 | odom_frame_id: map 78 | 79 | - type: ModelTfPublisher 80 | name: tf_publisher 81 | publish_tf_world: true 82 | 83 | - type: Laser 84 | name: laser_front 85 | frame: laser_front 86 | topic: scan 87 | body: base 88 | broadcast_tf: true 89 | origin: [0.28, 0, 0] 90 | range: 20 91 | angle: {min: -2.356194490192345, max: 2.356194490192345, increment: 0.004363323129985824} 92 | noise_std_dev: 0.05 93 | update_rate: 40 94 | -------------------------------------------------------------------------------- /flatland_plugins/test/tricycle_drive_tests/cleaner2.model.yaml: -------------------------------------------------------------------------------- 1 | 2 | bodies: 3 | - name: base 4 | type: dynamic 5 | color: [1, 1, 1, 0.75] 6 | footprints: 7 | - type: polygon 8 | density: 100 9 | points: [ [-1.03, -0.337], 10 | [.07983, -0.337], 11 | [.30, -.16111], 12 | [.30, .16111], 13 | [.07983, 0.337], 14 | [-1.03, 0.337] ] 15 | - name: front_wheel 16 | color: [1, 1, 1, 0.75] 17 | footprints: 18 | - type: polygon 19 | density: 1.0 20 | points: [[ 0.0875, -0.0250], 21 | [ 0.0875, 0.0250], 22 | [-0.0875, 0.0250], 23 | [-0.0875, -0.0250]] 24 | 25 | - name: rear_left_wheel 26 | color: [1, 1, 1, 0.75] 27 | footprints: 28 | - type: polygon 29 | density: 1.0 30 | points: [[ 0.0875, -0.0255], 31 | [ 0.0875, 0.0255], 32 | [-0.0875, 0.0255], 33 | [-0.0875, -0.0255]] 34 | 35 | - name: rear_right_wheel 36 | color: [1, 1, 1, 0.75] 37 | footprints: 38 | - type: polygon 39 | density: 1.0 40 | points: [[ 0.0875, -0.0255], 41 | [ 0.0875, 0.0255], 42 | [-0.0875, 0.0255], 43 | [-0.0875, -0.0255]] 44 | 45 | joints: 46 | - type: revolute 47 | name: front_wheel_revolute 48 | bodies: 49 | - name: front_wheel 50 | anchor: [0, 0] 51 | - name: base 52 | anchor: [0, 0] 53 | 54 | - type: weld 55 | name: rear_right_wheel_weld 56 | bodies: 57 | - name: rear_left_wheel 58 | anchor: [0, 0] 59 | - name: base 60 | anchor: [-0.83, 0.29] 61 | 62 | - type: weld 63 | name: rear_left_wheel_weld 64 | bodies: 65 | - name: rear_right_wheel 66 | anchor: [0, 0] 67 | - name: base 68 | anchor: [-0.83, -0.29] 69 | 70 | plugins: 71 | - type: TricycleDrive 72 | name: cleaner_drive 73 | body: base 74 | front_wheel_joint: front_wheel_revolute 75 | rear_left_wheel_joint: rear_left_wheel_weld 76 | rear_right_wheel_joint: rear_right_wheel_weld 77 | odom_frame_id: map 78 | linear_dynamics: 79 | velocity_limit: 0.2 80 | 81 | - type: ModelTfPublisher 82 | name: tf_publisher 83 | publish_tf_world: true 84 | 85 | - type: Laser 86 | name: laser_front 87 | frame: laser_front 88 | topic: scan 89 | body: base 90 | broadcast_tf: true 91 | origin: [0.28, 0, 0] 92 | range: 20 93 | angle: {min: -2.356194490192345, max: 2.356194490192345, increment: 0.004363323129985824} 94 | noise_std_dev: 0.05 95 | update_rate: 40 96 | -------------------------------------------------------------------------------- /flatland_plugins/test/tricycle_drive_tests/map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avidbots/flatland/6601c6560190372f304a45f3a0f758ea9ca8ea5b/flatland_plugins/test/tricycle_drive_tests/map.png -------------------------------------------------------------------------------- /flatland_plugins/test/tricycle_drive_tests/map.yaml: -------------------------------------------------------------------------------- 1 | image: map.png 2 | resolution: 0.050000 3 | origin: [-16.600000, -6.650000, 0.000000] 4 | negate: 0 5 | occupied_thresh: 0.65 6 | free_thresh: 0.196 7 | 8 | -------------------------------------------------------------------------------- /flatland_plugins/test/tricycle_drive_tests/map3d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avidbots/flatland/6601c6560190372f304a45f3a0f758ea9ca8ea5b/flatland_plugins/test/tricycle_drive_tests/map3d.png -------------------------------------------------------------------------------- /flatland_plugins/test/tricycle_drive_tests/map3d.yaml: -------------------------------------------------------------------------------- 1 | image: map3d.png 2 | resolution: 0.050000 3 | origin: [-16.600000, -6.650000, 0.000000] 4 | negate: 0 5 | occupied_thresh: 0.65 6 | free_thresh: 0.196 -------------------------------------------------------------------------------- /flatland_plugins/test/tricycle_drive_tests/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} # For later use 2 | layers: # Support for arbitrary number of layers 3 | - name: "2d" # layer 0 named "2d" 4 | map: "map.yaml" # leading / denotes absolute file path, otherwise relative 5 | color: [0, 1, 0, 1] # List of floats [r,g,b,a] to color debug boundary 6 | - name: "3d" # layer 1 named "3d" 7 | map: "map3d.yaml" 8 | color: [1.0, 0.0, 0.0, 0.5] # red 50% transparent 9 | models: 10 | - name: cleaner1 11 | pose: [12, 0, 0] 12 | model: "cleaner.model.yaml" 13 | -------------------------------------------------------------------------------- /flatland_plugins/test/tricycle_drive_tests/world2.yaml: -------------------------------------------------------------------------------- 1 | properties: {} # For later use 2 | layers: # Support for arbitrary number of layers 3 | - name: "2d" # layer 0 named "2d" 4 | map: "map.yaml" # leading / denotes absolute file path, otherwise relative 5 | color: [0, 1, 0, 1] # List of floats [r,g,b,a] to color debug boundary 6 | - name: "3d" # layer 1 named "3d" 7 | map: "map3d.yaml" 8 | color: [1.0, 0.0, 0.0, 0.5] # red 50% transparent 9 | models: 10 | - name: cleaner1 11 | pose: [12, 0, 0] 12 | model: "cleaner2.model.yaml" 13 | -------------------------------------------------------------------------------- /flatland_plugins/test/tricycle_drive_tests/world3.yaml: -------------------------------------------------------------------------------- 1 | properties: {} # For later use 2 | layers: # Support for arbitrary number of layers 3 | - name: "2d" # layer 0 named "2d" 4 | map: "map.yaml" # leading / denotes absolute file path, otherwise relative 5 | color: [0, 1, 0, 1] # List of floats [r,g,b,a] to color debug boundary 6 | - name: "3d" # layer 1 named "3d" 7 | map: "map3d.yaml" 8 | color: [1.0, 0.0, 0.0, 0.5] # red 50% transparent 9 | models: 10 | - name: cleaner1 11 | pose: [12, 0, 0] 12 | model: "cleaner3.model.yaml" 13 | -------------------------------------------------------------------------------- /flatland_plugins/test/tween_test.test: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flatland_plugins/test/tween_tests/loop.model.yaml: -------------------------------------------------------------------------------- 1 | # Turtlebot 2 | 3 | bodies: # List of named bodies 4 | - name: base 5 | pose: [0, 0, 0] 6 | type: dynamic 7 | color: [1, 1, 0, 1] 8 | footprints: 9 | - type: polygon 10 | density: 1 11 | points: [[1.5, 0], [0.9, 0.7], [-0.9, 0.7], [-0.9, -0.7], [0.9, -0.7]] 12 | plugins: 13 | - type: Tween 14 | name: Tween0 15 | body: base 16 | delta: [10, 10, 1] 17 | duration: 2.0 18 | mode: loop 19 | easing: linear -------------------------------------------------------------------------------- /flatland_plugins/test/tween_tests/loop.world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: 3 | - name: "layer_1" 4 | map: "map_1.yaml" 5 | color: [0, 1, 0, 1] 6 | models: 7 | - name: robot1 8 | pose: [0, 0, 0] 9 | model: loop.model.yaml 10 | -------------------------------------------------------------------------------- /flatland_plugins/test/tween_tests/map_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avidbots/flatland/6601c6560190372f304a45f3a0f758ea9ca8ea5b/flatland_plugins/test/tween_tests/map_1.png -------------------------------------------------------------------------------- /flatland_plugins/test/tween_tests/map_1.yaml: -------------------------------------------------------------------------------- 1 | image: map_1.png 2 | resolution: 0.25 3 | origin: [0, 0, 0] 4 | negate: 0 5 | occupied_thresh: 0.65 6 | free_thresh: 0.196 7 | 8 | -------------------------------------------------------------------------------- /flatland_plugins/test/tween_tests/once.model.yaml: -------------------------------------------------------------------------------- 1 | # Turtlebot 2 | 3 | bodies: # List of named bodies 4 | - name: base 5 | pose: [0, 0, 0] 6 | type: dynamic 7 | color: [1, 1, 0, 1] 8 | footprints: 9 | - type: polygon 10 | density: 1 11 | points: [[1.5, 0], [0.9, 0.7], [-0.9, 0.7], [-0.9, -0.7], [0.9, -0.7]] 12 | plugins: 13 | - type: Tween 14 | name: Tween0 15 | body: base 16 | delta: [1, 3, 2.0] 17 | duration: 1.0 18 | mode: once 19 | easing: linear -------------------------------------------------------------------------------- /flatland_plugins/test/tween_tests/once.world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: 3 | - name: "layer_1" 4 | map: "map_1.yaml" 5 | color: [0, 1, 0, 1] 6 | models: 7 | - name: robot1 8 | pose: [2, 1, 0] 9 | model: once.model.yaml 10 | -------------------------------------------------------------------------------- /flatland_plugins/test/tween_tests/yoyo.model.yaml: -------------------------------------------------------------------------------- 1 | # Turtlebot 2 | 3 | bodies: # List of named bodies 4 | - name: base 5 | pose: [0, 0, 0] 6 | type: dynamic 7 | color: [1, 1, 0, 1] 8 | footprints: 9 | - type: polygon 10 | density: 1 11 | points: [[1.5, 0], [0.9, 0.7], [-0.9, 0.7], [-0.9, -0.7], [0.9, -0.7]] 12 | plugins: 13 | - type: Tween 14 | name: Tween0 15 | body: base 16 | delta: [10, 10, 1] 17 | duration: 1.0 18 | mode: yoyo 19 | easing: linear -------------------------------------------------------------------------------- /flatland_plugins/test/tween_tests/yoyo.world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: 3 | - name: "layer_1" 4 | map: "map_1.yaml" 5 | color: [0, 1, 0, 1] 6 | models: 7 | - name: robot1 8 | pose: [0, 0, 0] 9 | model: yoyo.model.yaml 10 | -------------------------------------------------------------------------------- /flatland_plugins/test/update_timer_test.test: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flatland_plugins/test/update_timer_test/map_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avidbots/flatland/6601c6560190372f304a45f3a0f758ea9ca8ea5b/flatland_plugins/test/update_timer_test/map_1.png -------------------------------------------------------------------------------- /flatland_plugins/test/update_timer_test/map_1.yaml: -------------------------------------------------------------------------------- 1 | image: map_1.png 2 | resolution: 0.25 3 | origin: [0, 0, 0] 4 | negate: 0 5 | occupied_thresh: 0.65 6 | free_thresh: 0.196 7 | 8 | -------------------------------------------------------------------------------- /flatland_plugins/test/update_timer_test/robot.model.yaml: -------------------------------------------------------------------------------- 1 | # Turtlebot 2 | 3 | bodies: # List of named bodies 4 | - name: base 5 | pose: [0, 0, 0] 6 | type: dynamic 7 | color: [1, 1, 0, 1] 8 | footprints: 9 | - type: polygon 10 | density: 1 11 | points: [[1.5, 0], [0.9, 0.7], [-0.9, 0.7], [-0.9, -0.7], [0.9, -0.7]] -------------------------------------------------------------------------------- /flatland_plugins/test/update_timer_test/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: 3 | - name: "layer_1" 4 | map: "map_1.yaml" 5 | color: [0, 1, 0, 1] 6 | models: 7 | - name: robot1 8 | pose: [0, 0, 0] 9 | model: robot.model.yaml 10 | -------------------------------------------------------------------------------- /flatland_server/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package flatland_server 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 1.4.1 (2023-11-24) 6 | ------------------ 7 | * CMake version required bump to fix ros build farm warning 8 | 9 | 1.4.0 (2023-11-22) 10 | ------------------ 11 | * Version Bump 12 | 13 | 1.3.3 (2023-02-06) 14 | ------------------ 15 | * added missing std_srvs dep 16 | * Merge pull request `#95 `_ from avidbots/per-package-licenses 17 | Per package licenses 18 | * Contributors: Joseph Duchesne 19 | 20 | * added missing std_srvs dep 21 | * Merge pull request `#95 `_ from avidbots/per-package-licenses 22 | Per package licenses 23 | * Contributors: Joseph Duchesne 24 | 25 | * added missing std_srvs dep 26 | * Merge pull request `#95 `_ from avidbots/per-package-licenses 27 | Per package licenses 28 | * Contributors: Joseph Duchesne 29 | -------------------------------------------------------------------------------- /flatland_server/LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2023, Avidbots Corp. 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /flatland_server/flatland_plugins.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Flatland Dummy Model Plugin, used for testing 4 | 5 | 6 | Flatland Dummy World Plugin, used for testing 7 | 8 | 9 | -------------------------------------------------------------------------------- /flatland_server/launch/benchmark.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /flatland_server/launch/server.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /flatland_server/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | flatland_server 4 | 1.5.0 5 | The flatland_server package 6 | BSD 7 | https://bitbucket.org/avidbots/flatland 8 | 9 | Joseph Duchesne 10 | Joseph Duchesne 11 | Chunshang Li 12 | Mike Brousseau 13 | 14 | catkin 15 | 16 | cmake_modules 17 | 18 | libopencv-dev 19 | pluginlib 20 | roscpp 21 | std_msgs 22 | std_srvs 23 | tf2 24 | tf2_geometry_msgs 25 | geometry_msgs 26 | yaml-cpp 27 | visualization_msgs 28 | interactive_markers 29 | flatland_msgs 30 | lua-dev 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /flatland_server/test/benchmark_world/cleaner.model.yaml: -------------------------------------------------------------------------------- 1 | 2 | bodies: 3 | - name: base 4 | type: dynamic 5 | color: [1, 1, 1, 0.75] 6 | footprints: 7 | - type: polygon 8 | density: 100 9 | points: [ [-1.03, -0.337], 10 | [.07983, -0.337], 11 | [.30, -.16111], 12 | [.30, .16111], 13 | [.07983, 0.337], 14 | [-1.03, 0.337] ] 15 | - name: front_wheel 16 | color: [1, 1, 1, 0.75] 17 | footprints: 18 | - type: polygon 19 | density: 1.0 20 | points: [[ 0.0875, -0.0250], 21 | [ 0.0875, 0.0250], 22 | [-0.0875, 0.0250], 23 | [-0.0875, -0.0250]] 24 | 25 | - name: rear_left_wheel 26 | color: [1, 1, 1, 0.75] 27 | footprints: 28 | - type: polygon 29 | density: 1.0 30 | points: [[ 0.0875, -0.0255], 31 | [ 0.0875, 0.0255], 32 | [-0.0875, 0.0255], 33 | [-0.0875, -0.0255]] 34 | 35 | - name: rear_right_wheel 36 | color: [1, 1, 1, 0.75] 37 | footprints: 38 | - type: polygon 39 | density: 1.0 40 | points: [[ 0.0875, -0.0255], 41 | [ 0.0875, 0.0255], 42 | [-0.0875, 0.0255], 43 | [-0.0875, -0.0255]] 44 | 45 | joints: 46 | - type: revolute 47 | name: front_wheel_revolute 48 | bodies: 49 | - name: front_wheel 50 | anchor: [0, 0] 51 | - name: base 52 | anchor: [0, 0] 53 | 54 | - type: weld 55 | name: rear_right_wheel_weld 56 | bodies: 57 | - name: rear_left_wheel 58 | anchor: [0, 0] 59 | - name: base 60 | anchor: [-0.83, 0.29] 61 | 62 | - type: weld 63 | name: rear_left_wheel_weld 64 | bodies: 65 | - name: rear_right_wheel 66 | anchor: [0, 0] 67 | - name: base 68 | anchor: [-0.83, -0.29] 69 | 70 | plugins: 71 | - type: ModelTfPublisher 72 | name: tf_publisher 73 | publish_tf_world: true 74 | 75 | - type: TricycleDrive 76 | name: cleaner_drive 77 | body: base 78 | front_wheel_joint: front_wheel_revolute 79 | rear_left_wheel_joint: rear_left_wheel_weld 80 | rear_right_wheel_joint: rear_right_wheel_weld 81 | odom_frame_id: map 82 | 83 | - type: Laser 84 | name: laser_front 85 | frame: laser_front 86 | topic: scan 87 | body: base 88 | broadcast_tf: true 89 | origin: [0.28, 0, 0] 90 | range: 20 91 | always_publish: true 92 | angle: {min: -2.356194490192345, max: 2.356194490192345, increment: 0.004363323129985824} 93 | noise_std_dev: 0.05 94 | update_rate: 40 95 | -------------------------------------------------------------------------------- /flatland_server/test/benchmark_world/map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avidbots/flatland/6601c6560190372f304a45f3a0f758ea9ca8ea5b/flatland_server/test/benchmark_world/map.png -------------------------------------------------------------------------------- /flatland_server/test/benchmark_world/map.yaml: -------------------------------------------------------------------------------- 1 | image: map.png 2 | resolution: 0.050000 3 | origin: [-16.600000, -6.650000, 0.000000] 4 | negate: 0 5 | occupied_thresh: 0.65 6 | free_thresh: 0.196 7 | 8 | -------------------------------------------------------------------------------- /flatland_server/test/benchmark_world/map3d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avidbots/flatland/6601c6560190372f304a45f3a0f758ea9ca8ea5b/flatland_server/test/benchmark_world/map3d.png -------------------------------------------------------------------------------- /flatland_server/test/benchmark_world/map3d.yaml: -------------------------------------------------------------------------------- 1 | image: map3d.png 2 | resolution: 0.050000 3 | origin: [-16.600000, -6.650000, 0.000000] 4 | negate: 0 5 | occupied_thresh: 0.65 6 | free_thresh: 0.196 -------------------------------------------------------------------------------- /flatland_server/test/benchmark_world/turtlebot.model.yaml: -------------------------------------------------------------------------------- 1 | # Turtlebot w/ lidar 2 | bodies: # List of named bodies 3 | - name: base 4 | pose: [0, 0, 0] 5 | type: dynamic 6 | color: [1, 1, 1, 0.75] 7 | footprints: 8 | - type: circle 9 | radius: 0.5 10 | center: [-1, 0.0] 11 | density: 1 12 | 13 | - type: polygon 14 | sensor: true 15 | points: [[-.45, -.05], [-.45, 0.05], [-.35, 0.05], [-.35, -0.05]] 16 | layers: [] 17 | density: 1 18 | 19 | - type: polygon 20 | sensor: true 21 | points: [[-.125, -.4], [-.125, -.3], [.125, -.3], [.125, -.4]] 22 | density: 1 23 | 24 | - type: polygon 25 | sensor: true 26 | points: [[-.125, .4], [-.125, .3], [.125, .3], [.125, .4]] 27 | density: 100000 28 | plugins: 29 | - type: DiffDrive 30 | name: turtlebot_drive 31 | body: base 32 | odom_frame_id: map 33 | pub_rate: 10 34 | # odom_pose_noise: [0.1, 0.1, 0.1] 35 | # odom_twist_noise: [0.1, 0.1, 0.1] 36 | # odom_pose_covariance: [0.00, 0.01, 0.02, 0.03, 0.04, 0.05, 37 | # 0.06, 0.07, 0.08, 0.09, 0.10, 0.11, 38 | # 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 39 | # 0.18, 0.19, 0.20, 0.21, 0.22, 0.23, 40 | # 0.24, 0.25, 0.26, 0.27, 0.28, 0.29, 41 | # 0.30, 0.31, 0.32, 0.33, 0.34, 0.35] 42 | 43 | - type: ModelTfPublisher 44 | name: tf_publisher 45 | publish_tf_world: true 46 | 47 | - type: Laser 48 | name: laser_front 49 | body: base 50 | always_publish: true 51 | range: 20 52 | update_rate: 25 # Hz 53 | angle: {min: -2.35619, max: 2.35619, increment: 0.004363323} # 1080 scans, 270 deg arc, 0.25deg inc 54 | -------------------------------------------------------------------------------- /flatland_server/test/benchmark_world/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} # For later use 2 | layers: # Support for arbitrary number of layers 3 | - name: "2d" # layer 0 named "2d" 4 | map: "map.yaml" # leading / denotes absolute file path, otherwise relative 5 | color: [0, 1, 0, 1] # List of floats [r,g,b,a] to color debug boundary 6 | - name: "3d" # layer 1 named "3d" 7 | map: "map3d.yaml" 8 | color: [1.0, 0.0, 0.0, 0.5] # red 50% transparent 9 | models: 10 | - name: cleaner1 11 | pose: [12, 0, 0] 12 | model: "cleaner.model.yaml" 13 | # - name: turtlebot1 14 | # pose: [12, 0, 0] 15 | # model: "turtlebot.model.yaml" 16 | -------------------------------------------------------------------------------- /flatland_server/test/conestogo_office_test/cleaner.model.yaml: -------------------------------------------------------------------------------- 1 | 2 | bodies: 3 | - name: base 4 | type: dynamic 5 | color: [1, 1, 1, 0.75] 6 | footprints: 7 | - type: polygon 8 | density: 100 9 | points: [ [-1.03, -0.337], 10 | [.07983, -0.337], 11 | [.30, -.16111], 12 | [.30, .16111], 13 | [.07983, 0.337], 14 | [-1.03, 0.337] ] 15 | - name: front_wheel 16 | color: [1, 1, 1, 0.75] 17 | footprints: 18 | - type: polygon 19 | density: 1.0 20 | points: [[ 0.0875, -0.0250], 21 | [ 0.0875, 0.0250], 22 | [-0.0875, 0.0250], 23 | [-0.0875, -0.0250]] 24 | 25 | - name: rear_left_wheel 26 | color: [1, 1, 1, 0.75] 27 | footprints: 28 | - type: polygon 29 | density: 1.0 30 | points: [[ 0.0875, -0.0255], 31 | [ 0.0875, 0.0255], 32 | [-0.0875, 0.0255], 33 | [-0.0875, -0.0255]] 34 | 35 | - name: rear_right_wheel 36 | color: [1, 1, 1, 0.75] 37 | footprints: 38 | - type: polygon 39 | density: 1.0 40 | points: [[ 0.0875, -0.0255], 41 | [ 0.0875, 0.0255], 42 | [-0.0875, 0.0255], 43 | [-0.0875, -0.0255]] 44 | 45 | joints: 46 | - type: revolute 47 | name: front_wheel_revolute 48 | bodies: 49 | - name: front_wheel 50 | anchor: [0, 0] 51 | - name: base 52 | anchor: [0, 0] 53 | 54 | - type: weld 55 | name: rear_right_wheel_weld 56 | bodies: 57 | - name: rear_left_wheel 58 | anchor: [0, 0] 59 | - name: base 60 | anchor: [-0.83, 0.29] 61 | 62 | - type: weld 63 | name: rear_left_wheel_weld 64 | bodies: 65 | - name: rear_right_wheel 66 | anchor: [0, 0] 67 | - name: base 68 | anchor: [-0.83, -0.29] 69 | 70 | plugins: 71 | - type: ModelTfPublisher 72 | name: tf_publisher 73 | publish_tf_world: true 74 | 75 | - type: TricycleDrive 76 | name: cleaner_drive 77 | body: base 78 | front_wheel_joint: front_wheel_revolute 79 | rear_left_wheel_joint: rear_left_wheel_weld 80 | rear_right_wheel_joint: rear_right_wheel_weld 81 | odom_frame_id: map 82 | 83 | - type: Laser 84 | name: laser_front 85 | frame: laser_front 86 | topic: scan 87 | body: base 88 | broadcast_tf: true 89 | origin: [0.28, 0, 0] 90 | range: 20 91 | angle: {min: -2.356194490192345, max: 2.356194490192345, increment: 0.004363323129985824} 92 | noise_std_dev: 0.05 93 | update_rate: 40 94 | -------------------------------------------------------------------------------- /flatland_server/test/conestogo_office_test/map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avidbots/flatland/6601c6560190372f304a45f3a0f758ea9ca8ea5b/flatland_server/test/conestogo_office_test/map.png -------------------------------------------------------------------------------- /flatland_server/test/conestogo_office_test/map.yaml: -------------------------------------------------------------------------------- 1 | image: map.png 2 | resolution: 0.050000 3 | origin: [-16.600000, -6.650000, 0.000000] 4 | negate: 0 5 | occupied_thresh: 0.65 6 | free_thresh: 0.196 7 | 8 | -------------------------------------------------------------------------------- /flatland_server/test/conestogo_office_test/map3d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avidbots/flatland/6601c6560190372f304a45f3a0f758ea9ca8ea5b/flatland_server/test/conestogo_office_test/map3d.png -------------------------------------------------------------------------------- /flatland_server/test/conestogo_office_test/map3d.yaml: -------------------------------------------------------------------------------- 1 | image: map3d.png 2 | resolution: 0.050000 3 | origin: [-16.600000, -6.650000, 0.000000] 4 | negate: 0 5 | occupied_thresh: 0.65 6 | free_thresh: 0.196 -------------------------------------------------------------------------------- /flatland_server/test/conestogo_office_test/sensor.model.yaml: -------------------------------------------------------------------------------- 1 | # A cylindar that walks back and forth 2 | bodies: 3 | - name: detector 4 | pose: [0, 0, 0] 5 | type: dynamic 6 | color: [0.2, 0.2, 1, 0.9] 7 | footprints: 8 | - type: polygon 9 | sensor: true 10 | points: [[-.5, -.5], [-.5, 0.5], [0.5, 0.5], [0.5, -0.5]] 11 | layers: ["all"] 12 | density: 1 13 | plugins: 14 | - type: BoolSensor 15 | name: detector0 16 | topic: detector_out 17 | update_rate: 10 18 | body: detector 19 | -------------------------------------------------------------------------------- /flatland_server/test/conestogo_office_test/turtlebot.model.yaml: -------------------------------------------------------------------------------- 1 | # Turtlebot 2 | 3 | 4 | bodies: # List of named bodies 5 | - name: base 6 | pose: [0, 0, 0] 7 | type: dynamic 8 | color: [1, 1, 1, 0.75] 9 | footprints: 10 | - type: circle 11 | radius: 0.5 12 | center: [-1, 0.0] 13 | density: 1 14 | 15 | - type: polygon 16 | sensor: true 17 | points: [[-.45, -.05], [-.45, 0.05], [-.35, 0.05], [-.35, -0.05]] 18 | layers: [] 19 | density: 1 20 | 21 | - type: polygon 22 | sensor: true 23 | points: [[-.125, -.4], [-.125, -.3], [.125, -.3], [.125, -.4]] 24 | density: 1 25 | 26 | - type: polygon 27 | sensor: true 28 | points: [[-.125, .4], [-.125, .3], [.125, .3], [.125, .4]] 29 | density: 100000 30 | plugins: 31 | - type: DiffDrive 32 | name: turtlebot_drive 33 | body: base 34 | odom_frame_id: map 35 | pub_rate: 10 36 | # odom_pose_noise: [0.1, 0.1, 0.1] 37 | # odom_twist_noise: [0.1, 0.1, 0.1] 38 | # odom_pose_covariance: [0.00, 0.01, 0.02, 0.03, 0.04, 0.05, 39 | # 0.06, 0.07, 0.08, 0.09, 0.10, 0.11, 40 | # 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 41 | # 0.18, 0.19, 0.20, 0.21, 0.22, 0.23, 42 | # 0.24, 0.25, 0.26, 0.27, 0.28, 0.29, 43 | # 0.30, 0.31, 0.32, 0.33, 0.34, 0.35] 44 | 45 | 46 | 47 | 48 | - type: ModelTfPublisher 49 | name: tf_publisher 50 | publish_tf_world: true -------------------------------------------------------------------------------- /flatland_server/test/conestogo_office_test/walker.model.yaml: -------------------------------------------------------------------------------- 1 | # A cylindar that walks back and forth 2 | bodies: 3 | - name: base 4 | pose: [0, 0, 0] 5 | type: dynamic 6 | color: [1, 1, 1, 0.75] 7 | footprints: 8 | - type: circle 9 | radius: 0.5 10 | center: [-1, 0.0] 11 | density: 1 12 | # layers: ["2d"] 13 | plugins: 14 | - type: Tween 15 | name: Tween 16 | body: base 17 | delta: [5, 3, 3.141592] 18 | duration: 2.0 19 | mode: yoyo 20 | easing: quadraticInOut -------------------------------------------------------------------------------- /flatland_server/test/conestogo_office_test/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} # For later use 2 | layers: # Support for arbitrary number of layers 3 | - name: "2d" # layer 0 named "2d" 4 | map: "map.yaml" # leading / denotes absolute file path, otherwise relative 5 | color: [0, 1, 0, 1] # List of floats [r,g,b,a] to color debug boundary 6 | - name: "3d" # layer 1 named "3d" 7 | map: "map3d.yaml" 8 | color: [1.0, 0.0, 0.0, 0.5] # red 50% transparent 9 | models: 10 | - name: cleaner1 11 | pose: [12, 0, 0] 12 | model: "cleaner.model.yaml" 13 | - name: walker1 14 | pose: [0, 0, 0] 15 | model: "walker.model.yaml" 16 | - name: sensor 17 | pose: [2, 0, 0] 18 | model: "sensor.model.yaml" 19 | # plugins: 20 | # - name: test1 21 | # type: RandomWall 22 | # layer: "2d" 23 | # num_of_walls: 10 24 | # wall_wall_dist: 1 25 | # double_wall: true 26 | # robot_name: cleaner1 27 | 28 | 29 | # - name: turtlebot1 30 | # pose: [12, 0, 0] 31 | # model: "turtlebot.model.yaml" 32 | -------------------------------------------------------------------------------- /flatland_server/test/debug_visualization.test: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flatland_server/test/dummy_model_plugin_test.test: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flatland_server/test/dummy_world_plugin_test.test: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flatland_server/test/load_world_test.test: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/map_invalid_A/map.yaml: -------------------------------------------------------------------------------- 1 | image: ../simple_test_A/map.png 2 | resolution: 0.050000 3 | origins: [-16.600000, -6.650000, 0.000000] # invalid 4 | negate: 0 5 | occupied_thresh: 0.65 6 | free_thresh: 0.196 7 | 8 | -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/map_invalid_A/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: 3 | - name: "2d" 4 | map: "map.yaml" 5 | color: [0, 1, 0, 0] 6 | - name: "3d" 7 | map: "map3d.yaml" 8 | color: [1.0, 0.0, 0.0, 0.5] 9 | models: [] 10 | -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/map_invalid_B/map.yaml: -------------------------------------------------------------------------------- 1 | image: random_map.png 2 | resolution: 0.050000 3 | origin: [-16.600000, -6.650000, 0.000000] 4 | negate: 0 5 | occupied_thresh: 0.65 6 | free_thresh: 0.196 7 | -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/map_invalid_B/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: 3 | - name: "2d" 4 | map: "map.yaml" 5 | color: [0, 1, 0, 0] 6 | - name: "3d" 7 | map: "map3d.yaml" 8 | color: [1.0, 0.0, 0.0, 0.5] 9 | models: [] 10 | -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/map_invalid_C/map_lines.yaml: -------------------------------------------------------------------------------- 1 | type: line_segments 2 | data: random_file.dat 3 | scale: 1 4 | origin: [0, 0, 0] 5 | -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/map_invalid_C/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: 3 | - name: "2d" 4 | map: "../simple_test_A/map.yaml" 5 | color: [0, 1, 0, 0] 6 | - name: "3d" 7 | map: "../simple_test_A/map3d.yaml" 8 | color: [1.0, 0.0, 0.0, 0.5] 9 | - name: ["lines"] 10 | map: "map_lines.yaml" 11 | models: [] 12 | -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/map_invalid_D/map_lines.dat: -------------------------------------------------------------------------------- 1 | 1 2 3 4 2 | 1 2 3 4 3 | 1 2 3 4 4 | 1 2 3 4 5 | 1 2 3 4 6 | 1 2 3 7 | 1 2 3 4 8 | 1 2 3 4 9 | 1 2 3 4 10 | 1 2 3 4 -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/map_invalid_D/map_lines.yaml: -------------------------------------------------------------------------------- 1 | type: line_segments 2 | data: map_lines.dat 3 | scale: 1 4 | origin: [0, 0, 0] 5 | -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/map_invalid_D/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: 3 | - name: "2d" 4 | map: "../simple_test_A/map.yaml" 5 | color: [0, 1, 0, 0] 6 | - name: "3d" 7 | map: "../simple_test_A/map3d.yaml" 8 | color: [1.0, 0.0, 0.0, 0.5] 9 | - name: ["lines"] 10 | map: "map_lines.yaml" 11 | models: [] 12 | -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/map_invalid_E/map_lines.yaml: -------------------------------------------------------------------------------- 1 | type: line_segments 2 | data: random_file.dat 3 | # scale: 1 4 | origin: [0, 0, 0] 5 | -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/map_invalid_E/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: 3 | - name: "2d" 4 | map: "../simple_test_A/map.yaml" 5 | color: [0, 1, 0, 0] 6 | - name: "3d" 7 | map: "../simple_test_A/map3d.yaml" 8 | color: [1.0, 0.0, 0.0, 0.5] 9 | - name: ["lines"] 10 | map: "map_lines.yaml" 11 | models: [] 12 | -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/model_invalid_A/turtlebot.model.yaml: -------------------------------------------------------------------------------- 1 | # Turtlebot 2 | 3 | bodies: 4 | # - name: base # invalid, the entry is a map without the dash 5 | pose: [0, 0, 0] 6 | type: dynamic 7 | color: [1, 1, 0, 0.25] 8 | footprints: 9 | - type: circle 10 | center: [0, 0] 11 | radius: 1.777 12 | density: 0 13 | - type: polygon 14 | points: [[-0.1, 0.1], [-0.1, -0.1], [0.1, -0.1], [0.1, 0.1]] 15 | density: 0 16 | -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/model_invalid_A/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: [] 3 | models: 4 | - name: turtlebot 5 | pose: [0, 0, 0] 6 | model: "turtlebot.model.yaml" 7 | -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/model_invalid_B/turtlebot.model.yaml: -------------------------------------------------------------------------------- 1 | # Turtlebot 2 | 3 | bodies: 4 | - name: base 5 | pose: [0, 0, 0] 6 | type: dynamic 7 | color: [1, 1, 0, 0.25] 8 | footprints: 9 | - type: circle 10 | center: [0, 0] 11 | radius: 1.777 12 | density: 0 13 | - type: polygon 14 | points: [[-0.1, 0.1], [-0.1, -0.1]] 15 | density: 0 16 | -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/model_invalid_B/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: [] 3 | models: 4 | - name: turtlebot 5 | pose: [0, 0, 0] 6 | model: "turtlebot.model.yaml" 7 | -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/model_invalid_C/turtlebot.model.yaml: -------------------------------------------------------------------------------- 1 | # Turtlebot 2 | 3 | 4 | bodies: # List of named bodies 5 | - name: base 6 | pose: [0, 0, 0] 7 | type: dynamic 8 | color: [1, 1, 0, 0.25] 9 | linear_damping: 0.1 10 | angular_damping: 0.125 11 | footprints: 12 | - type: circle 13 | center: [0, 0] 14 | radius: 1.777 15 | density: 0 16 | - type: polygon 17 | points: [[-0.1, 0.1], [-0.1, -0.1], [0.1, -0.1], [0.1, 0.1]] 18 | density: 0 19 | 20 | - name: left_wheel 21 | pose: [-1, 0, 0] 22 | type: dynamic 23 | color: [1, 0, 0, 0.25] 24 | footprints: 25 | - type: polygon 26 | sensor: true 27 | density: 0 28 | points: [[-.2, 0.75], [-.2, -.75], [.2, -.75], [.2, .75]] 29 | 30 | - name: right_wheel 31 | pose: [1, 0, 0] 32 | type: dynamic 33 | color: [0, 1, 0, 0.25] 34 | footprints: 35 | - type: polygon 36 | density: 0 37 | points: [[-.2, 0.75], [-.2, -.75], [.2, -.75], [.2, .75]] 38 | 39 | joints: 40 | - name: left_wheel_weld 41 | type: weld 42 | bodies: 43 | - name: base 44 | anchor: [-1, 0] 45 | - name: left_wheel 46 | anchor: [0, 0] 47 | 48 | - name: right_wheel_weld 49 | type: weld 50 | bodies: 51 | - name: base 52 | anchor: [1, 0] 53 | - name: right_wheel 54 | anchor: [0, 0, 3] # invalid shoudl be 2 55 | -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/model_invalid_C/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: [] 3 | models: 4 | - name: turtlebot 5 | pose: [0, 0, 0] 6 | model: "turtlebot.model.yaml" 7 | -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/model_invalid_D/turtlebot.model.yaml: -------------------------------------------------------------------------------- 1 | # Turtlebot 2 | 3 | 4 | bodies: # List of named bodies 5 | - name: base 6 | pose: [0, 0, 0] 7 | type: dynamic 8 | color: [1, 1, 0, 0.25] 9 | linear_damping: 0.1 10 | angular_damping: 0.125 11 | footprints: 12 | - type: circle 13 | center: [0, 0] 14 | radius: 1.777 15 | density: 0 16 | - type: polygon 17 | points: [[-0.1, 0.1], [-0.1, -0.1], [0.1, -0.1], [0.1, 0.1]] 18 | density: 0 19 | 20 | - name: left_wheel 21 | pose: [-1, 0, 0] 22 | type: dynamic 23 | color: [1, 0, 0, 0.25] 24 | footprints: 25 | - type: polygon 26 | sensor: true 27 | density: 0 28 | points: [[-.2, 0.75], [-.2, -.75], [.2, -.75], [.2, .75]] 29 | 30 | - name: right_wheel 31 | pose: [1, 0, 0] 32 | type: dynamic 33 | color: [0, 1, 0, 0.25] 34 | footprints: 35 | - type: polygon 36 | density: 0 37 | points: [[-.2, 0.75], [-.2, -.75], [.2, -.75], [.2, .75]] 38 | 39 | joints: 40 | - name: left_wheel_weld 41 | type: weld 42 | bodies: 43 | - name: base 44 | anchor: [-1, 0] 45 | - name: left_wheel_123 # does not exist 46 | anchor: [0, 0] 47 | 48 | - name: right_wheel_weld 49 | type: weld 50 | bodies: 51 | - name: base 52 | anchor: [1, 0] 53 | - name: right_wheel 54 | anchor: [0, 0] -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/model_invalid_D/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: [] 3 | models: 4 | - name: turtlebot 5 | pose: [0, 0, 0] 6 | model: "turtlebot.model.yaml" 7 | -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/model_invalid_E/turtlebot.model.yaml: -------------------------------------------------------------------------------- 1 | # Turtlebot 2 | 3 | 4 | bodies: # List of named bodies 5 | - name: base 6 | pose: [0, 0, 0] 7 | type: dynamic 8 | color: [1, 1, 0, 0.25] 9 | linear_damping: 0.1 10 | angular_damping: 0.125 11 | footprints: 12 | - type: circle 13 | center: [0, 0] 14 | radius: 1.777 15 | density: 0 16 | - type: polygon 17 | points: [[-0.1, 0.1], [-0.1, -0.1], [0.1, -0.1], [0.1, 0.1]] 18 | density: 0 19 | 20 | - name: left_wheel 21 | pose: [-1, 0, 0] 22 | type: dynamic 23 | color: [1, 0, 0, 0.25] 24 | footprints: 25 | - type: polygon 26 | layers: ["3d", "random_layer"] # invalid, random_layer does not exist 27 | sensor: true 28 | points: [[-.2, 0.75], [-.2, -.75], [.2, -.75], [.2, .75]] 29 | density: 0 30 | 31 | - name: right_wheel 32 | pose: [1, 0, 0] 33 | type: dynamic 34 | color: [0, 1, 0, 0.25] 35 | footprints: 36 | - type: polygon 37 | points: [[-.2, 0.75], [-.2, -.75], [.2, -.75], [.2, .75]] 38 | density: 0 -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/model_invalid_E/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: 3 | - name: "2d" 4 | map: "../simple_test_A/map.yaml" 5 | color: [0, 1, 0, 0] 6 | - name: "3d" 7 | map: "../simple_test_A/map3d.yaml" 8 | color: [1.0, 0.0, 0.0, 0.5] 9 | models: 10 | - name: turtlebot 11 | pose: [0, 0, 0] 12 | model: "turtlebot.model.yaml" 13 | -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/model_invalid_F/turtlebot.model.yaml: -------------------------------------------------------------------------------- 1 | # Turtlebot 2 | 3 | bodies: 4 | - name: base # invalid, the entry is a map without the dash 5 | pose: [0, 0, 0] 6 | type: dynamic 7 | color: [1, 1, 0, 0.25] 8 | footprints: 9 | - type: circle 10 | center: [0, 0] 11 | radius: 1.777 12 | density: 0 13 | random_paramter: 123 14 | - type: polygon 15 | points: [[-0.1, 0.1], [-0.1, -0.1], [0.1, -0.1], [0.1, 0.1]] 16 | density: 0 17 | -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/model_invalid_F/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: [] 3 | models: 4 | - name: turtlebot 5 | pose: [0, 0, 0] 6 | model: "turtlebot.model.yaml" 7 | -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/model_invalid_G/turtlebot.model.yaml: -------------------------------------------------------------------------------- 1 | # Turtlebot 2 | 3 | bodies: 4 | - name: base 5 | pose: [0, 0, 0] 6 | type: dynamic 7 | color: [1, 1, 0, 0.25] 8 | random_paramter: 123 9 | footprints: 10 | - type: circle 11 | center: [0, 0] 12 | radius: 1.777 13 | density: 0 14 | - type: polygon 15 | points: [[-0.1, 0.1], [-0.1, -0.1], [0.1, -0.1], [0.1, 0.1]] 16 | density: 0 17 | -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/model_invalid_G/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: [] 3 | models: 4 | - name: turtlebot 5 | pose: [0, 0, 0] 6 | model: "turtlebot.model.yaml" 7 | -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/model_invalid_H/turtlebot.model.yaml: -------------------------------------------------------------------------------- 1 | # Turtlebot 2 | 3 | bodies: 4 | - name: base 5 | pose: [0, 0, 0] 6 | type: dynamic 7 | color: [1, 1, 0, 0.25] 8 | footprints: 9 | - type: circle 10 | center: [0, 0] 11 | radius: 1.777 12 | density: 0 13 | - name: base 14 | type: dynamic 15 | footprints: 16 | - type: polygon 17 | points: [[-0.1, 0.1], [-0.1, -0.1], [0.1, -0.1], [0.1, 0.1]] 18 | density: 0 19 | -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/model_invalid_H/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: [] 3 | models: 4 | - name: turtlebot 5 | pose: [0, 0, 0] 6 | model: "turtlebot.model.yaml" 7 | -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/model_invalid_I/turtlebot.model.yaml: -------------------------------------------------------------------------------- 1 | # Turtlebot 2 | 3 | 4 | bodies: # List of named bodies 5 | - name: base 6 | type: dynamic 7 | footprints: 8 | - type: circle 9 | radius: 1.777 10 | density: 0 11 | - type: polygon 12 | density: 982.24 13 | points: [[-0.1, 0.1], [-0.1, -0.1], [0.1, -0.1], [0.1, 0.1]] 14 | 15 | - name: left_wheel 16 | type: dynamic 17 | footprints: 18 | - type: polygon 19 | density: 0 20 | points: [[-.2, 0.75], [-.2, -.75], [.2, -.75], [.2, .75]] 21 | 22 | - name: right_wheel 23 | type: dynamic 24 | footprints: 25 | - type: polygon 26 | density: 0 27 | points: [[-.2, 0.75], [-.2, -.75], [.2, -.75], [.2, .75]] 28 | 29 | joints: 30 | - name: wheel_weld 31 | type: weld 32 | bodies: 33 | - name: base 34 | anchor: [-1, 0] 35 | - name: left_wheel 36 | anchor: [0, 0] 37 | 38 | - name: wheel_weld 39 | type: weld 40 | bodies: 41 | - name: base 42 | anchor: [1, 0] 43 | - name: right_wheel 44 | anchor: [0, 0] -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/model_invalid_I/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: [] 3 | models: 4 | - name: turtlebot 5 | pose: [0, 0, 0] 6 | model: "turtlebot.model.yaml" 7 | -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/model_invalid_J/turtlebot.model.yaml: -------------------------------------------------------------------------------- 1 | # Turtlebot 2 | 3 | 4 | bodies: # List of named bodies 5 | - name: base 6 | type: dynamic 7 | footprints: 8 | - type: polygon 9 | density: 0 10 | points: [[0, 0], [0, 10], [1, 9], [2, 7], [3, 4], [4, 0], [5, -5], [6, -11]] 11 | - type: polygon 12 | density: 0 13 | points: [[0, 0], [0, 10], [1, 9], [2, 7], [3, 4], [4, 0], [5, -5], [6, -11], [7, -18]] # invalid, max is 8 14 | -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/model_invalid_J/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: [] 3 | models: 4 | - name: turtlebot 5 | pose: [0, 0, 0] 6 | model: "turtlebot.model.yaml" 7 | -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/simple_test_A/chair.model.yaml: -------------------------------------------------------------------------------- 1 | # Chair 2 | 3 | bodies: 4 | - name: chair 5 | pose: [0, 0, 0] 6 | type: static 7 | footprints: 8 | # represented by a 1 m circle and a center pole, probably a bad representation 9 | - type: circle 10 | center: [0, 0] 11 | radius: 1 12 | density: 0 13 | layers: ["4d", "5d"] 14 | 15 | - type: circle 16 | center: [0, 0] 17 | density: 0 18 | radius: 0.2 -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/simple_test_A/map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avidbots/flatland/6601c6560190372f304a45f3a0f758ea9ca8ea5b/flatland_server/test/load_world_tests/simple_test_A/map.png -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/simple_test_A/map.yaml: -------------------------------------------------------------------------------- 1 | image: map.png 2 | resolution: 0.050000 3 | origin: [0.05e0, -5e-2, 1.57] # the angle is ignored 4 | negate: 0 5 | occupied_thresh: 0.65 6 | free_thresh: 0.196 7 | 8 | -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/simple_test_A/map3d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avidbots/flatland/6601c6560190372f304a45f3a0f758ea9ca8ea5b/flatland_server/test/load_world_tests/simple_test_A/map3d.png -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/simple_test_A/map3d.yaml: -------------------------------------------------------------------------------- 1 | image: map3d.png 2 | resolution: 1.5 3 | origin: [0.0, 0.0, 0.0] 4 | negate: 0 5 | occupied_thresh: 0.5153 6 | free_thresh: 0.2234 7 | 8 | -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/simple_test_A/map_lines.dat: -------------------------------------------------------------------------------- 1 | 1 2 3 4 2 | -1 -2 -3 -4 3 | 0.1 0.2 0.3 0.4 -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/simple_test_A/map_lines.yaml: -------------------------------------------------------------------------------- 1 | type: line_segments 2 | data: map_lines.dat 3 | scale: 0.1 4 | origin: [-1.20, -5, 1.23] 5 | -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/simple_test_A/person.model.yaml: -------------------------------------------------------------------------------- 1 | # Person 2 | 3 | bodies: 4 | - name: body 5 | pose: [0, 0, 0] 6 | type: kinematic 7 | color: [0, 0.75, 0.75, 0.25] 8 | footprints: 9 | # represented by circle 10 | - type: circle 11 | density: 0 12 | radius: 0.5 -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/simple_test_A/world.yaml: -------------------------------------------------------------------------------- 1 | properties: 2 | velocity_iterations: 11 3 | position_iterations: 12 4 | layers: 5 | - name: "2d" 6 | map: "map.yaml" 7 | color: [0, 1, 0, 0.675] 8 | - name: ["3d", "4d", "5d"] 9 | map: "map3d.yaml" 10 | - name: ["lines"] 11 | map: "map_lines.yaml" 12 | - name: "robot" 13 | models: 14 | - name: turtlebot1 15 | model: "turtlebot.model.yaml" 16 | - name: turtlebot2 17 | pose: [3, 4.5, 3.14159] 18 | model: "turtlebot.model.yaml" 19 | namespace: robot2 20 | - name: chair1 21 | pose: [1.2, 3.5, 2.123] 22 | model: "chair.model.yaml" 23 | - name: person1 24 | pose: [0, 1, 2] 25 | model: "person.model.yaml" -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/world_invalid_A/world.yaml: -------------------------------------------------------------------------------- 1 | properties_____: {} # invalid 2 | layers: 3 | - name: "2d" 4 | map: "map.yaml" 5 | color: [0, 1, 0, 0] 6 | - name: "3d" 7 | map: "map3d.yaml" 8 | color: [1.0, 0.0, 0.0, 0.5] 9 | models: [] 10 | -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/world_invalid_B/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: 3 | - name: "2d" 4 | map: "map.yaml" 5 | color: [0, 1, 0, 0, 1234] # invalid 6 | - name: "3d" 7 | map: "map3d.yaml" 8 | color: [1.0, 0.0, 0.0, 0.5] 9 | models: [] 10 | -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/world_invalid_C/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: 3 | - name: "2d" 4 | map: "map.yaml" 5 | color: [0, 1, 0, 0] 6 | random_param_1: 123 7 | random_param_2: 123 8 | random_param_3: 123 9 | - name: "3d" 10 | map: "map3d.yaml" 11 | color: [1.0, 0.0, 0.0, 0.5] 12 | models: [] 13 | -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/world_invalid_D/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: 3 | - name: "layer" 4 | map: "../simple_test_A/map.yaml" 5 | - name: "layer" 6 | map: "../simple_test_A/map3d.yaml" 7 | models: [] 8 | -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/world_invalid_E/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: 3 | - name: "2d" 4 | map: "../simple_test_A/map.yaml" 5 | color: [0, 1, 0, 0] 6 | - name: "3d" 7 | map: "../simple_test_A/map3d.yaml" 8 | color: [1.0, 0.0, 0.0, 0.5] 9 | models: 10 | - name: turtlebot 11 | model: "../simple_test_A/turtlebot.model.yaml" 12 | - name: turtlebot 13 | model: "../simple_test_A/turtlebot.model.yaml" -------------------------------------------------------------------------------- /flatland_server/test/load_world_tests/world_invalid_F/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: 3 | - {name: "layer_1", map: "../simple_test_A/map.yaml"} 4 | - {name: ["layer_2", "layer_3", "layer_4"], map: "../simple_test_A/map.yaml"} 5 | - {name: "layer_5", map: "../simple_test_A/map.yaml"} 6 | - {name: "layer_6", map: "../simple_test_A/map.yaml"} 7 | - {name: ["layer_7", "layer_8"], map: "../simple_test_A/map.yaml"} 8 | - {name: "layer_9", map: "../simple_test_A/map.yaml"} 9 | - {name: "layer_10", map: "../simple_test_A/map.yaml"} 10 | - {name: "layer_11", map: "../simple_test_A/map.yaml"} 11 | - {name: "layer_12", map: "../simple_test_A/map.yaml"} 12 | - {name: "layer_13", map: "../simple_test_A/map.yaml"} 13 | - {name: "layer_14", map: "../simple_test_A/map.yaml"} 14 | - {name: ["layer_15", layer_16, layer_17], map: "../simple_test_A/map.yaml"} 15 | -------------------------------------------------------------------------------- /flatland_server/test/model_test.test: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flatland_server/test/plugin_manager_test.test: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flatland_server/test/plugin_manager_tests/collision_test/turtlebot.model.yaml: -------------------------------------------------------------------------------- 1 | # Turtlebot 2 | 3 | bodies: 4 | - name: base 5 | pose: [0, 0, 0] 6 | type: dynamic 7 | color: [1, 1, 0, 0.25] 8 | footprints: 9 | - type: circle 10 | center: [0, 0] 11 | radius: 0.4 12 | density: 0 13 | sensor: true -------------------------------------------------------------------------------- /flatland_server/test/plugin_manager_tests/collision_test/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: 3 | - name: "2d" 4 | map: "../load_dummy_test/map.yaml" 5 | color: [0, 1, 0, 1] 6 | models: 7 | - name: turtlebot1 8 | pose: [0, 0, 0] 9 | model: "turtlebot.model.yaml" 10 | - name: person1 11 | pose: [-2, 1, 0] 12 | model: "../load_dummy_test/person.model.yaml" 13 | -------------------------------------------------------------------------------- /flatland_server/test/plugin_manager_tests/duplicate_plugin/turtlebot.model.yaml: -------------------------------------------------------------------------------- 1 | # Turtlebot 2 | 3 | bodies: 4 | - name: base 5 | pose: [0, 0, 0] 6 | type: dynamic 7 | color: [1, 1, 0, 0.25] 8 | footprints: 9 | - type: circle 10 | center: [0, 0] 11 | radius: 0.4 12 | sensor: true 13 | density: 0 14 | 15 | plugins: 16 | - type: DummyModelPlugin 17 | name: dummy_test_plugin 18 | dummy_param_float: 0.123456 19 | dummy_param_int: 123456 20 | dummy_param_string: dummy_test_123456 21 | 22 | - type: DummyModelPlugin 23 | name: dummy_test_plugin 24 | dummy_param_float: 0.123456 25 | dummy_param_int: 123456 26 | dummy_param_string: dummy_test_123456 27 | -------------------------------------------------------------------------------- /flatland_server/test/plugin_manager_tests/duplicate_plugin/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: 3 | - name: "2d" 4 | map: "../load_dummy_test/map.yaml" 5 | color: [0, 1, 0, 1] 6 | models: 7 | - name: turtlebot1 8 | pose: [0, 0, 0] 9 | model: "turtlebot.model.yaml" 10 | - name: person1 11 | pose: [-2, 1, 0] 12 | model: "../load_dummy_test/person.model.yaml" 13 | -------------------------------------------------------------------------------- /flatland_server/test/plugin_manager_tests/invalid_plugin_yaml/turtlebot.model.yaml: -------------------------------------------------------------------------------- 1 | # Turtlebot 2 | 3 | bodies: 4 | - name: base 5 | pose: [0, 0, 0] 6 | type: dynamic 7 | color: [1, 1, 0, 0.25] 8 | footprints: 9 | - type: circle 10 | center: [0, 0] 11 | density: 0 12 | radius: 0.4 13 | sensor: true 14 | 15 | plugins: 16 | - type: DummyModelPlugin 17 | # invalid, no name 18 | -------------------------------------------------------------------------------- /flatland_server/test/plugin_manager_tests/invalid_plugin_yaml/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: 3 | - name: "2d" 4 | map: "../load_dummy_test/map.yaml" 5 | color: [0, 1, 0, 1] 6 | models: 7 | - name: turtlebot1 8 | pose: [0, 0, 0] 9 | model: "turtlebot.model.yaml" 10 | - name: person1 11 | pose: [-2, 1, 0] 12 | model: "../load_dummy_test/person.model.yaml" 13 | -------------------------------------------------------------------------------- /flatland_server/test/plugin_manager_tests/load_dummy_test/map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avidbots/flatland/6601c6560190372f304a45f3a0f758ea9ca8ea5b/flatland_server/test/plugin_manager_tests/load_dummy_test/map.png -------------------------------------------------------------------------------- /flatland_server/test/plugin_manager_tests/load_dummy_test/map.yaml: -------------------------------------------------------------------------------- 1 | image: map.png 2 | resolution: 0.01 3 | origin: [-5, -5, 0] # the angle is ignored 4 | negate: 0 5 | occupied_thresh: 0.65 6 | free_thresh: 0.196 7 | 8 | -------------------------------------------------------------------------------- /flatland_server/test/plugin_manager_tests/load_dummy_test/person.model.yaml: -------------------------------------------------------------------------------- 1 | # Person 2 | 3 | bodies: 4 | - name: body 5 | pose: [0, 0, 0] 6 | type: dynamic 7 | color: [0, 0.75, 0.75, 0.25] 8 | footprints: 9 | - type: circle 10 | center: [0, 0] 11 | radius: 0.4 12 | sensor: true 13 | density: 0 -------------------------------------------------------------------------------- /flatland_server/test/plugin_manager_tests/load_dummy_test/turtlebot.model.yaml: -------------------------------------------------------------------------------- 1 | # Turtlebot 2 | 3 | bodies: 4 | - name: base 5 | pose: [0, 0, 0] 6 | type: dynamic 7 | color: [1, 1, 0, 0.25] 8 | footprints: 9 | - type: circle 10 | center: [0, 0] 11 | radius: 0.4 12 | sensor: true 13 | density: 0 14 | 15 | plugins: 16 | - type: DummyModelPlugin 17 | name: dummy_test_plugin 18 | dummy_param_float: 0.123456 19 | dummy_param_string: dummy_test_123456 20 | dummy_param_int: 123456 -------------------------------------------------------------------------------- /flatland_server/test/plugin_manager_tests/load_dummy_test/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: 3 | - name: "2d" 4 | map: "map.yaml" 5 | color: [0, 1, 0, 1] 6 | models: 7 | - name: turtlebot1 8 | pose: [0, 0, 0] 9 | model: "turtlebot.model.yaml" -------------------------------------------------------------------------------- /flatland_server/test/plugin_manager_tests/nonexistent_plugin/turtlebot.model.yaml: -------------------------------------------------------------------------------- 1 | # Turtlebot 2 | 3 | bodies: 4 | - name: base 5 | pose: [0, 0, 0] 6 | type: dynamic 7 | color: [1, 1, 0, 0.25] 8 | footprints: 9 | - type: circle 10 | center: [0, 0] 11 | radius: 0.4 12 | density: 0 13 | sensor: true 14 | 15 | plugins: 16 | - type: RandomPlugin 17 | name: plugin_not_there 18 | var1: 123 19 | var2: 1234 20 | -------------------------------------------------------------------------------- /flatland_server/test/plugin_manager_tests/nonexistent_plugin/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: 3 | - name: "2d" 4 | map: "../load_dummy_test/map.yaml" 5 | color: [0, 1, 0, 1] 6 | models: 7 | - name: turtlebot1 8 | pose: [0, 0, 0] 9 | model: "turtlebot.model.yaml" 10 | - name: person1 11 | pose: [-2, 1, 0] 12 | model: "../load_dummy_test/person.model.yaml" 13 | -------------------------------------------------------------------------------- /flatland_server/test/plugin_manager_tests/plugin_throws_exception/turtlebot.model.yaml: -------------------------------------------------------------------------------- 1 | # Turtlebot 2 | 3 | bodies: 4 | - name: base 5 | pose: [0, 0, 0] 6 | type: dynamic 7 | color: [1, 1, 0, 0.25] 8 | footprints: 9 | - type: circle 10 | center: [0, 0] 11 | radius: 0.4 12 | sensor: true 13 | density: 0 14 | 15 | plugins: 16 | - type: DummyModelPlugin 17 | name: dummy_test_plugin 18 | dummy_param_float: 0.123456 19 | dummy_param_int: 123456 20 | dummy_param_string: wrong_message 21 | -------------------------------------------------------------------------------- /flatland_server/test/plugin_manager_tests/plugin_throws_exception/world.yaml: -------------------------------------------------------------------------------- 1 | properties: {} 2 | layers: 3 | - name: "2d" 4 | map: "../load_dummy_test/map.yaml" 5 | color: [0, 1, 0, 1] 6 | models: 7 | - name: turtlebot1 8 | pose: [0, 0, 0] 9 | model: "turtlebot.model.yaml" 10 | - name: person1 11 | pose: [-2, 1, 0] 12 | model: "../load_dummy_test/person.model.yaml" 13 | -------------------------------------------------------------------------------- /flatland_server/test/service_manager_test.test: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flatland_server/test/yaml_preprocessor/yaml/eval.strings.out.yaml: -------------------------------------------------------------------------------- 1 | foo: Hello World 2 | bar: Hello World 3 | baz: Hello World 4 | bash: 1234 5 | boop: 6 | bal: 12.34 7 | foop: 8 | - A 9 | - B 10 | - C 11 | bom: | 12 | Some 13 | multiline 14 | string 15 | testEnv: 16 | env1: Bar 17 | env2: 123.4 18 | env3: Bar 19 | env4: 123.4 20 | env5: "" 21 | env6: 444.4 22 | env7: ZZZ 23 | env8: true 24 | testParam: 25 | param1: Foo 26 | param2: 7 27 | param3: Foo 28 | param4: 10.5 29 | param5: "" 30 | param6: 223 31 | param7: BBBC 32 | param8: true 33 | param9: true -------------------------------------------------------------------------------- /flatland_server/test/yaml_preprocessor/yaml/eval.strings.yaml: -------------------------------------------------------------------------------- 1 | foo: $eval return "Hello World" 2 | bar: $eval return string.gsub("Hello banana", "banana", "World") 3 | baz: $eval string.gsub("Hello banana", "banana", "World") 4 | bash: $eval 1234 5 | boop: 6 | bal: $eval 12.34 7 | foop: 8 | - A 9 | - $eval "B" 10 | - C 11 | bom: | 12 | $eval 13 | [[Some 14 | multiline 15 | string 16 | ]] 17 | testEnv: 18 | env1: $eval env("VALIDSTRING") 19 | env2: $eval env("VALIDNUMBER") 20 | env3: $eval env("VALIDSTRING","YYY") 21 | env4: $eval env("VALIDNUMBER","333.3") 22 | env5: $eval env("INVALID") 23 | env6: $eval env("INVALID","444.4") 24 | env7: $eval env("INVALID","ZZZ") 25 | env8: $eval env("INVALID", true) 26 | 27 | testParam: 28 | param1: $eval param("/string") 29 | param2: $eval param("/int") 30 | param3: $eval param("/string","AAA") 31 | param4: $eval param("/float","111") 32 | param5: $eval param("/invalid") 33 | param6: $eval param("/invalid","222")+1 34 | param7: $eval param("/invalid","BBB").."C" 35 | param8: $eval param("/invalid", true) 36 | param9: $eval true -------------------------------------------------------------------------------- /flatland_server/test/yaml_preprocessor/yaml/include.child.yaml: -------------------------------------------------------------------------------- 1 | foo: bar 2 | spam: 2 3 | eggs: $include include.string.yaml 4 | -------------------------------------------------------------------------------- /flatland_server/test/yaml_preprocessor/yaml/include.parent.out.yaml: -------------------------------------------------------------------------------- 1 | a: this is a 2 | b: 52 3 | c: this is a technically a YAML string. 4 | d: contents of absolute file 5 | e: 6 | foo: bar 7 | spam: 2 8 | eggs: this is a technically a YAML string. 9 | f: 10 | - parent first element 11 | - first element 12 | - second element 13 | - third element 14 | - parent last element 15 | g: [] 16 | -------------------------------------------------------------------------------- /flatland_server/test/yaml_preprocessor/yaml/include.parent.yaml: -------------------------------------------------------------------------------- 1 | a: this is a 2 | b: 52 3 | c: $include include.string.yaml 4 | d: $include /tmp/9aaafd40-2083-49d9-a300-9d01f94d6671.yaml 5 | e: $include include.child.yaml 6 | f: 7 | - parent first element 8 | - $[include] include.sequence.yaml 9 | - parent last element 10 | g: [] # Test: make sure empty lists are not modified -------------------------------------------------------------------------------- /flatland_server/test/yaml_preprocessor/yaml/include.sequence.yaml: -------------------------------------------------------------------------------- 1 | first element 2 | --- 3 | second element 4 | --- 5 | third element 6 | -------------------------------------------------------------------------------- /flatland_server/test/yaml_preprocessor/yaml/include.string.yaml: -------------------------------------------------------------------------------- 1 | this is a technically a YAML string. 2 | -------------------------------------------------------------------------------- /flatland_server/test/yaml_preprocessor/yaml_preprocessor_test.test: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /flatland_server/thirdparty/Box2D/Box2DConfig.cmake.in: -------------------------------------------------------------------------------- 1 | # -*- cmake -*- 2 | # 3 | # Box2dConfig.cmake(.in) 4 | # 5 | 6 | # Use the following variables to compile and link against Box2d: 7 | # BOX2D_FOUND - True if Box2d was found on your system 8 | # BOX2D_USE_FILE - The file making Box2d usable 9 | # BOX2D_DEFINITIONS - Definitions needed to build with Box2d 10 | # BOX2D_INCLUDE_DIR - Box2d headers location 11 | # BOX2D_INCLUDE_DIRS - List of directories where Box2d header file are 12 | # BOX2D_LIBRARY - Library name 13 | # BOX2D_LIBRARIES - List of libraries to link against 14 | # BOX2D_LIBRARY_DIRS - List of directories containing Box2d libraries 15 | # BOX2D_ROOT_DIR - The base directory of Box2d 16 | # BOX2D_VERSION_STRING - A human-readable string containing the version 17 | 18 | set ( BOX2D_FOUND 1 ) 19 | set ( BOX2D_USE_FILE "@BOX2D_USE_FILE@" ) 20 | 21 | set ( BOX2D_DEFINITIONS "@BOX2D_DEFINITIONS@" ) 22 | set ( BOX2D_INCLUDE_DIR "@BOX2D_INCLUDE_DIR@" ) 23 | set ( Box2D_INCLUDE_DIRS "@BOX2D_INCLUDE_DIRS@" ) # deprecated 24 | set ( BOX2D_INCLUDE_DIRS "@BOX2D_INCLUDE_DIRS@" ) 25 | set ( BOX2D_LIBRARY "@BOX2D_LIBRARY@" ) 26 | set ( BOX2D_LIBRARIES "@BOX2D_LIBRARIES@" ) 27 | set ( BOX2D_LIBRARY_DIRS "@BOX2D_LIBRARY_DIRS@" ) 28 | set ( BOX2D_ROOT_DIR "@CMAKE_INSTALL_PREFIX@" ) 29 | 30 | set ( BOX2D_VERSION_STRING "@BOX2D_VERSION@" ) 31 | 32 | -------------------------------------------------------------------------------- /flatland_server/thirdparty/Box2D/Collision/Shapes/b2CircleShape.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #ifndef B2_CIRCLE_SHAPE_H 20 | #define B2_CIRCLE_SHAPE_H 21 | 22 | #include "Box2D/Collision/Shapes/b2Shape.h" 23 | 24 | /// A circle shape. 25 | class b2CircleShape : public b2Shape 26 | { 27 | public: 28 | b2CircleShape(); 29 | 30 | /// Implement b2Shape. 31 | b2Shape* Clone(b2BlockAllocator* allocator) const override; 32 | 33 | /// @see b2Shape::GetChildCount 34 | int32 GetChildCount() const override; 35 | 36 | /// Implement b2Shape. 37 | bool TestPoint(const b2Transform& transform, const b2Vec2& p) const override; 38 | 39 | /// Implement b2Shape. 40 | bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, 41 | const b2Transform& transform, int32 childIndex) const override; 42 | 43 | /// @see b2Shape::ComputeAABB 44 | void ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const override; 45 | 46 | /// @see b2Shape::ComputeMass 47 | void ComputeMass(b2MassData* massData, float32 density) const override; 48 | 49 | /// Position 50 | b2Vec2 m_p; 51 | }; 52 | 53 | inline b2CircleShape::b2CircleShape() 54 | { 55 | m_type = e_circle; 56 | m_radius = 0.0f; 57 | m_p.SetZero(); 58 | } 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /flatland_server/thirdparty/Box2D/Collision/b2TimeOfImpact.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #ifndef B2_TIME_OF_IMPACT_H 20 | #define B2_TIME_OF_IMPACT_H 21 | 22 | #include "Box2D/Common/b2Math.h" 23 | #include "Box2D/Collision/b2Distance.h" 24 | 25 | /// Input parameters for b2TimeOfImpact 26 | struct b2TOIInput 27 | { 28 | b2DistanceProxy proxyA; 29 | b2DistanceProxy proxyB; 30 | b2Sweep sweepA; 31 | b2Sweep sweepB; 32 | float32 tMax; // defines sweep interval [0, tMax] 33 | }; 34 | 35 | // Output parameters for b2TimeOfImpact. 36 | struct b2TOIOutput 37 | { 38 | enum State 39 | { 40 | e_unknown, 41 | e_failed, 42 | e_overlapped, 43 | e_touching, 44 | e_separated 45 | }; 46 | 47 | State state; 48 | float32 t; 49 | }; 50 | 51 | /// Compute the upper bound on time before two shapes penetrate. Time is represented as 52 | /// a fraction between [0,tMax]. This uses a swept separating axis and may miss some intermediate, 53 | /// non-tunneling collision. If you change the time interval, you should call this function 54 | /// again. 55 | /// Note: use b2Distance to compute the contact point and normal at the time of impact. 56 | void b2TimeOfImpact(b2TOIOutput* output, const b2TOIInput* input); 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /flatland_server/thirdparty/Box2D/Common/b2BlockAllocator.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #ifndef B2_BLOCK_ALLOCATOR_H 20 | #define B2_BLOCK_ALLOCATOR_H 21 | 22 | #include "Box2D/Common/b2Settings.h" 23 | 24 | const int32 b2_chunkSize = 16 * 1024; 25 | const int32 b2_maxBlockSize = 640; 26 | const int32 b2_blockSizes = 14; 27 | const int32 b2_chunkArrayIncrement = 128; 28 | 29 | struct b2Block; 30 | struct b2Chunk; 31 | 32 | /// This is a small object allocator used for allocating small 33 | /// objects that persist for more than one time step. 34 | /// See: http://www.codeproject.com/useritems/Small_Block_Allocator.asp 35 | class b2BlockAllocator 36 | { 37 | public: 38 | b2BlockAllocator(); 39 | ~b2BlockAllocator(); 40 | 41 | /// Allocate memory. This will use b2Alloc if the size is larger than b2_maxBlockSize. 42 | void* Allocate(int32 size); 43 | 44 | /// Free memory. This will use b2Free if the size is larger than b2_maxBlockSize. 45 | void Free(void* p, int32 size); 46 | 47 | void Clear(); 48 | 49 | private: 50 | 51 | b2Chunk* m_chunks; 52 | int32 m_chunkCount; 53 | int32 m_chunkSpace; 54 | 55 | b2Block* m_freeLists[b2_blockSizes]; 56 | 57 | static int32 s_blockSizes[b2_blockSizes]; 58 | static uint8 s_blockSizeLookup[b2_maxBlockSize + 1]; 59 | static bool s_blockSizeLookupInitialized; 60 | }; 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /flatland_server/thirdparty/Box2D/Common/b2Draw.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Erin Catto http://box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #include "Box2D/Common/b2Draw.h" 20 | 21 | b2Draw::b2Draw() 22 | { 23 | m_drawFlags = 0; 24 | } 25 | 26 | void b2Draw::SetFlags(uint32 flags) 27 | { 28 | m_drawFlags = flags; 29 | } 30 | 31 | uint32 b2Draw::GetFlags() const 32 | { 33 | return m_drawFlags; 34 | } 35 | 36 | void b2Draw::AppendFlags(uint32 flags) 37 | { 38 | m_drawFlags |= flags; 39 | } 40 | 41 | void b2Draw::ClearFlags(uint32 flags) 42 | { 43 | m_drawFlags &= ~flags; 44 | } 45 | -------------------------------------------------------------------------------- /flatland_server/thirdparty/Box2D/Common/b2GrowableStack.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #ifndef B2_GROWABLE_STACK_H 20 | #define B2_GROWABLE_STACK_H 21 | #include "Box2D/Common/b2Settings.h" 22 | #include 23 | 24 | /// This is a growable LIFO stack with an initial capacity of N. 25 | /// If the stack size exceeds the initial capacity, the heap is used 26 | /// to increase the size of the stack. 27 | template 28 | class b2GrowableStack 29 | { 30 | public: 31 | b2GrowableStack() 32 | { 33 | m_stack = m_array; 34 | m_count = 0; 35 | m_capacity = N; 36 | } 37 | 38 | ~b2GrowableStack() 39 | { 40 | if (m_stack != m_array) 41 | { 42 | b2Free(m_stack); 43 | m_stack = nullptr; 44 | } 45 | } 46 | 47 | void Push(const T& element) 48 | { 49 | if (m_count == m_capacity) 50 | { 51 | T* old = m_stack; 52 | m_capacity *= 2; 53 | m_stack = (T*)b2Alloc(m_capacity * sizeof(T)); 54 | memcpy(m_stack, old, m_count * sizeof(T)); 55 | if (old != m_array) 56 | { 57 | b2Free(old); 58 | } 59 | } 60 | 61 | m_stack[m_count] = element; 62 | ++m_count; 63 | } 64 | 65 | T Pop() 66 | { 67 | b2Assert(m_count > 0); 68 | --m_count; 69 | return m_stack[m_count]; 70 | } 71 | 72 | int32 GetCount() 73 | { 74 | return m_count; 75 | } 76 | 77 | private: 78 | T* m_stack; 79 | T m_array[N]; 80 | int32 m_count; 81 | int32 m_capacity; 82 | }; 83 | 84 | 85 | #endif 86 | -------------------------------------------------------------------------------- /flatland_server/thirdparty/Box2D/Common/b2Settings.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #include "Box2D/Common/b2Settings.h" 20 | #include 21 | #include 22 | #include 23 | 24 | b2Version b2_version = {2, 3, 2}; 25 | 26 | // Memory allocators. Modify these to use your own allocator. 27 | void* b2Alloc(int32 size) 28 | { 29 | return malloc(size); 30 | } 31 | 32 | void b2Free(void* mem) 33 | { 34 | free(mem); 35 | } 36 | 37 | // You can modify this to use your logging facility. 38 | void b2Log(const char* string, ...) 39 | { 40 | va_list args; 41 | va_start(args, string); 42 | vprintf(string, args); 43 | va_end(args); 44 | } 45 | -------------------------------------------------------------------------------- /flatland_server/thirdparty/Box2D/Common/b2StackAllocator.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #include "Box2D/Common/b2StackAllocator.h" 20 | #include "Box2D/Common/b2Math.h" 21 | 22 | b2StackAllocator::b2StackAllocator() 23 | { 24 | m_index = 0; 25 | m_allocation = 0; 26 | m_maxAllocation = 0; 27 | m_entryCount = 0; 28 | } 29 | 30 | b2StackAllocator::~b2StackAllocator() 31 | { 32 | b2Assert(m_index == 0); 33 | b2Assert(m_entryCount == 0); 34 | } 35 | 36 | void* b2StackAllocator::Allocate(int32 size) 37 | { 38 | b2Assert(m_entryCount < b2_maxStackEntries); 39 | 40 | b2StackEntry* entry = m_entries + m_entryCount; 41 | entry->size = size; 42 | if (m_index + size > b2_stackSize) 43 | { 44 | entry->data = (char*)b2Alloc(size); 45 | entry->usedMalloc = true; 46 | } 47 | else 48 | { 49 | entry->data = m_data + m_index; 50 | entry->usedMalloc = false; 51 | m_index += size; 52 | } 53 | 54 | m_allocation += size; 55 | m_maxAllocation = b2Max(m_maxAllocation, m_allocation); 56 | ++m_entryCount; 57 | 58 | return entry->data; 59 | } 60 | 61 | void b2StackAllocator::Free(void* p) 62 | { 63 | b2Assert(m_entryCount > 0); 64 | b2StackEntry* entry = m_entries + m_entryCount - 1; 65 | b2Assert(p == entry->data); 66 | if (entry->usedMalloc) 67 | { 68 | b2Free(p); 69 | } 70 | else 71 | { 72 | m_index -= entry->size; 73 | } 74 | m_allocation -= entry->size; 75 | --m_entryCount; 76 | 77 | p = nullptr; 78 | } 79 | 80 | int32 b2StackAllocator::GetMaxAllocation() const 81 | { 82 | return m_maxAllocation; 83 | } 84 | -------------------------------------------------------------------------------- /flatland_server/thirdparty/Box2D/Common/b2StackAllocator.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #ifndef B2_STACK_ALLOCATOR_H 20 | #define B2_STACK_ALLOCATOR_H 21 | 22 | #include "Box2D/Common/b2Settings.h" 23 | 24 | const int32 b2_stackSize = 100 * 1024; // 100k 25 | const int32 b2_maxStackEntries = 32; 26 | 27 | struct b2StackEntry 28 | { 29 | char* data; 30 | int32 size; 31 | bool usedMalloc; 32 | }; 33 | 34 | // This is a stack allocator used for fast per step allocations. 35 | // You must nest allocate/free pairs. The code will assert 36 | // if you try to interleave multiple allocate/free pairs. 37 | class b2StackAllocator 38 | { 39 | public: 40 | b2StackAllocator(); 41 | ~b2StackAllocator(); 42 | 43 | void* Allocate(int32 size); 44 | void Free(void* p); 45 | 46 | int32 GetMaxAllocation() const; 47 | 48 | private: 49 | 50 | char m_data[b2_stackSize]; 51 | int32 m_index; 52 | 53 | int32 m_allocation; 54 | int32 m_maxAllocation; 55 | 56 | b2StackEntry m_entries[b2_maxStackEntries]; 57 | int32 m_entryCount; 58 | }; 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /flatland_server/thirdparty/Box2D/Common/b2Timer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Erin Catto http://box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #ifndef B2_TIMER_H 20 | #define B2_TIMER_H 21 | 22 | #include "Box2D/Common/b2Settings.h" 23 | 24 | /// Timer for profiling. This has platform specific code and may 25 | /// not work on every platform. 26 | class b2Timer 27 | { 28 | public: 29 | 30 | /// Constructor 31 | b2Timer(); 32 | 33 | /// Reset the timer. 34 | void Reset(); 35 | 36 | /// Get the time since construction or the last reset. 37 | float32 GetMilliseconds() const; 38 | 39 | private: 40 | 41 | #if defined(_WIN32) 42 | float64 m_start; 43 | static float64 s_invFrequency; 44 | #elif defined(__linux__) || defined (__APPLE__) 45 | unsigned long m_start_sec; 46 | unsigned long m_start_usec; 47 | #endif 48 | }; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /flatland_server/thirdparty/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2010 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #include "Box2D/Dynamics/Contacts/b2ChainAndCircleContact.h" 20 | #include "Box2D/Common/b2BlockAllocator.h" 21 | #include "Box2D/Dynamics/b2Fixture.h" 22 | #include "Box2D/Collision/Shapes/b2ChainShape.h" 23 | #include "Box2D/Collision/Shapes/b2EdgeShape.h" 24 | 25 | #include 26 | 27 | b2Contact* b2ChainAndCircleContact::Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator) 28 | { 29 | void* mem = allocator->Allocate(sizeof(b2ChainAndCircleContact)); 30 | return new (mem) b2ChainAndCircleContact(fixtureA, indexA, fixtureB, indexB); 31 | } 32 | 33 | void b2ChainAndCircleContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) 34 | { 35 | ((b2ChainAndCircleContact*)contact)->~b2ChainAndCircleContact(); 36 | allocator->Free(contact, sizeof(b2ChainAndCircleContact)); 37 | } 38 | 39 | b2ChainAndCircleContact::b2ChainAndCircleContact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB) 40 | : b2Contact(fixtureA, indexA, fixtureB, indexB) 41 | { 42 | b2Assert(m_fixtureA->GetType() == b2Shape::e_chain); 43 | b2Assert(m_fixtureB->GetType() == b2Shape::e_circle); 44 | } 45 | 46 | void b2ChainAndCircleContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) 47 | { 48 | b2ChainShape* chain = (b2ChainShape*)m_fixtureA->GetShape(); 49 | b2EdgeShape edge; 50 | chain->GetChildEdge(&edge, m_indexA); 51 | b2CollideEdgeAndCircle( manifold, &edge, xfA, 52 | (b2CircleShape*)m_fixtureB->GetShape(), xfB); 53 | } 54 | -------------------------------------------------------------------------------- /flatland_server/thirdparty/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #ifndef B2_CHAIN_AND_CIRCLE_CONTACT_H 20 | #define B2_CHAIN_AND_CIRCLE_CONTACT_H 21 | 22 | #include "Box2D/Dynamics/Contacts/b2Contact.h" 23 | 24 | class b2BlockAllocator; 25 | 26 | class b2ChainAndCircleContact : public b2Contact 27 | { 28 | public: 29 | static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, 30 | b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); 31 | static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); 32 | 33 | b2ChainAndCircleContact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB); 34 | ~b2ChainAndCircleContact() {} 35 | 36 | void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) override; 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /flatland_server/thirdparty/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2010 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #include "Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.h" 20 | #include "Box2D/Common/b2BlockAllocator.h" 21 | #include "Box2D/Dynamics/b2Fixture.h" 22 | #include "Box2D/Collision/Shapes/b2ChainShape.h" 23 | #include "Box2D/Collision/Shapes/b2EdgeShape.h" 24 | 25 | #include 26 | 27 | b2Contact* b2ChainAndPolygonContact::Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator) 28 | { 29 | void* mem = allocator->Allocate(sizeof(b2ChainAndPolygonContact)); 30 | return new (mem) b2ChainAndPolygonContact(fixtureA, indexA, fixtureB, indexB); 31 | } 32 | 33 | void b2ChainAndPolygonContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) 34 | { 35 | ((b2ChainAndPolygonContact*)contact)->~b2ChainAndPolygonContact(); 36 | allocator->Free(contact, sizeof(b2ChainAndPolygonContact)); 37 | } 38 | 39 | b2ChainAndPolygonContact::b2ChainAndPolygonContact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB) 40 | : b2Contact(fixtureA, indexA, fixtureB, indexB) 41 | { 42 | b2Assert(m_fixtureA->GetType() == b2Shape::e_chain); 43 | b2Assert(m_fixtureB->GetType() == b2Shape::e_polygon); 44 | } 45 | 46 | void b2ChainAndPolygonContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) 47 | { 48 | b2ChainShape* chain = (b2ChainShape*)m_fixtureA->GetShape(); 49 | b2EdgeShape edge; 50 | chain->GetChildEdge(&edge, m_indexA); 51 | b2CollideEdgeAndPolygon( manifold, &edge, xfA, 52 | (b2PolygonShape*)m_fixtureB->GetShape(), xfB); 53 | } 54 | -------------------------------------------------------------------------------- /flatland_server/thirdparty/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #ifndef B2_CHAIN_AND_POLYGON_CONTACT_H 20 | #define B2_CHAIN_AND_POLYGON_CONTACT_H 21 | 22 | #include "Box2D/Dynamics/Contacts/b2Contact.h" 23 | 24 | class b2BlockAllocator; 25 | 26 | class b2ChainAndPolygonContact : public b2Contact 27 | { 28 | public: 29 | static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, 30 | b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); 31 | static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); 32 | 33 | b2ChainAndPolygonContact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB); 34 | ~b2ChainAndPolygonContact() {} 35 | 36 | void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) override; 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /flatland_server/thirdparty/Box2D/Dynamics/Contacts/b2CircleContact.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #include "Box2D/Dynamics/Contacts/b2CircleContact.h" 20 | #include "Box2D/Dynamics/b2Body.h" 21 | #include "Box2D/Dynamics/b2Fixture.h" 22 | #include "Box2D/Dynamics/b2WorldCallbacks.h" 23 | #include "Box2D/Common/b2BlockAllocator.h" 24 | #include "Box2D/Collision/b2TimeOfImpact.h" 25 | 26 | #include 27 | 28 | b2Contact* b2CircleContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) 29 | { 30 | void* mem = allocator->Allocate(sizeof(b2CircleContact)); 31 | return new (mem) b2CircleContact(fixtureA, fixtureB); 32 | } 33 | 34 | void b2CircleContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) 35 | { 36 | ((b2CircleContact*)contact)->~b2CircleContact(); 37 | allocator->Free(contact, sizeof(b2CircleContact)); 38 | } 39 | 40 | b2CircleContact::b2CircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB) 41 | : b2Contact(fixtureA, 0, fixtureB, 0) 42 | { 43 | b2Assert(m_fixtureA->GetType() == b2Shape::e_circle); 44 | b2Assert(m_fixtureB->GetType() == b2Shape::e_circle); 45 | } 46 | 47 | void b2CircleContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) 48 | { 49 | b2CollideCircles(manifold, 50 | (b2CircleShape*)m_fixtureA->GetShape(), xfA, 51 | (b2CircleShape*)m_fixtureB->GetShape(), xfB); 52 | } 53 | -------------------------------------------------------------------------------- /flatland_server/thirdparty/Box2D/Dynamics/Contacts/b2CircleContact.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #ifndef B2_CIRCLE_CONTACT_H 20 | #define B2_CIRCLE_CONTACT_H 21 | 22 | #include "Box2D/Dynamics/Contacts/b2Contact.h" 23 | 24 | class b2BlockAllocator; 25 | 26 | class b2CircleContact : public b2Contact 27 | { 28 | public: 29 | static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, 30 | b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); 31 | static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); 32 | 33 | b2CircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB); 34 | ~b2CircleContact() {} 35 | 36 | void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) override; 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /flatland_server/thirdparty/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2010 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #include "Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.h" 20 | #include "Box2D/Common/b2BlockAllocator.h" 21 | #include "Box2D/Dynamics/b2Fixture.h" 22 | 23 | #include 24 | 25 | b2Contact* b2EdgeAndCircleContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) 26 | { 27 | void* mem = allocator->Allocate(sizeof(b2EdgeAndCircleContact)); 28 | return new (mem) b2EdgeAndCircleContact(fixtureA, fixtureB); 29 | } 30 | 31 | void b2EdgeAndCircleContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) 32 | { 33 | ((b2EdgeAndCircleContact*)contact)->~b2EdgeAndCircleContact(); 34 | allocator->Free(contact, sizeof(b2EdgeAndCircleContact)); 35 | } 36 | 37 | b2EdgeAndCircleContact::b2EdgeAndCircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB) 38 | : b2Contact(fixtureA, 0, fixtureB, 0) 39 | { 40 | b2Assert(m_fixtureA->GetType() == b2Shape::e_edge); 41 | b2Assert(m_fixtureB->GetType() == b2Shape::e_circle); 42 | } 43 | 44 | void b2EdgeAndCircleContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) 45 | { 46 | b2CollideEdgeAndCircle( manifold, 47 | (b2EdgeShape*)m_fixtureA->GetShape(), xfA, 48 | (b2CircleShape*)m_fixtureB->GetShape(), xfB); 49 | } 50 | -------------------------------------------------------------------------------- /flatland_server/thirdparty/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #ifndef B2_EDGE_AND_CIRCLE_CONTACT_H 20 | #define B2_EDGE_AND_CIRCLE_CONTACT_H 21 | 22 | #include "Box2D/Dynamics/Contacts/b2Contact.h" 23 | 24 | class b2BlockAllocator; 25 | 26 | class b2EdgeAndCircleContact : public b2Contact 27 | { 28 | public: 29 | static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, 30 | b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); 31 | static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); 32 | 33 | b2EdgeAndCircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB); 34 | ~b2EdgeAndCircleContact() {} 35 | 36 | void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) override; 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /flatland_server/thirdparty/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2010 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #include "Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.h" 20 | #include "Box2D/Common/b2BlockAllocator.h" 21 | #include "Box2D/Dynamics/b2Fixture.h" 22 | 23 | #include 24 | 25 | b2Contact* b2EdgeAndPolygonContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) 26 | { 27 | void* mem = allocator->Allocate(sizeof(b2EdgeAndPolygonContact)); 28 | return new (mem) b2EdgeAndPolygonContact(fixtureA, fixtureB); 29 | } 30 | 31 | void b2EdgeAndPolygonContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) 32 | { 33 | ((b2EdgeAndPolygonContact*)contact)->~b2EdgeAndPolygonContact(); 34 | allocator->Free(contact, sizeof(b2EdgeAndPolygonContact)); 35 | } 36 | 37 | b2EdgeAndPolygonContact::b2EdgeAndPolygonContact(b2Fixture* fixtureA, b2Fixture* fixtureB) 38 | : b2Contact(fixtureA, 0, fixtureB, 0) 39 | { 40 | b2Assert(m_fixtureA->GetType() == b2Shape::e_edge); 41 | b2Assert(m_fixtureB->GetType() == b2Shape::e_polygon); 42 | } 43 | 44 | void b2EdgeAndPolygonContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) 45 | { 46 | b2CollideEdgeAndPolygon( manifold, 47 | (b2EdgeShape*)m_fixtureA->GetShape(), xfA, 48 | (b2PolygonShape*)m_fixtureB->GetShape(), xfB); 49 | } 50 | -------------------------------------------------------------------------------- /flatland_server/thirdparty/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #ifndef B2_EDGE_AND_POLYGON_CONTACT_H 20 | #define B2_EDGE_AND_POLYGON_CONTACT_H 21 | 22 | #include "Box2D/Dynamics/Contacts/b2Contact.h" 23 | 24 | class b2BlockAllocator; 25 | 26 | class b2EdgeAndPolygonContact : public b2Contact 27 | { 28 | public: 29 | static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, 30 | b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); 31 | static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); 32 | 33 | b2EdgeAndPolygonContact(b2Fixture* fixtureA, b2Fixture* fixtureB); 34 | ~b2EdgeAndPolygonContact() {} 35 | 36 | void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) override; 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /flatland_server/thirdparty/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #include "Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.h" 20 | #include "Box2D/Common/b2BlockAllocator.h" 21 | #include "Box2D/Dynamics/b2Fixture.h" 22 | 23 | #include 24 | 25 | b2Contact* b2PolygonAndCircleContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) 26 | { 27 | void* mem = allocator->Allocate(sizeof(b2PolygonAndCircleContact)); 28 | return new (mem) b2PolygonAndCircleContact(fixtureA, fixtureB); 29 | } 30 | 31 | void b2PolygonAndCircleContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) 32 | { 33 | ((b2PolygonAndCircleContact*)contact)->~b2PolygonAndCircleContact(); 34 | allocator->Free(contact, sizeof(b2PolygonAndCircleContact)); 35 | } 36 | 37 | b2PolygonAndCircleContact::b2PolygonAndCircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB) 38 | : b2Contact(fixtureA, 0, fixtureB, 0) 39 | { 40 | b2Assert(m_fixtureA->GetType() == b2Shape::e_polygon); 41 | b2Assert(m_fixtureB->GetType() == b2Shape::e_circle); 42 | } 43 | 44 | void b2PolygonAndCircleContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) 45 | { 46 | b2CollidePolygonAndCircle( manifold, 47 | (b2PolygonShape*)m_fixtureA->GetShape(), xfA, 48 | (b2CircleShape*)m_fixtureB->GetShape(), xfB); 49 | } 50 | -------------------------------------------------------------------------------- /flatland_server/thirdparty/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #ifndef B2_POLYGON_AND_CIRCLE_CONTACT_H 20 | #define B2_POLYGON_AND_CIRCLE_CONTACT_H 21 | 22 | #include "Box2D/Dynamics/Contacts/b2Contact.h" 23 | 24 | class b2BlockAllocator; 25 | 26 | class b2PolygonAndCircleContact : public b2Contact 27 | { 28 | public: 29 | static b2Contact* Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); 30 | static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); 31 | 32 | b2PolygonAndCircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB); 33 | ~b2PolygonAndCircleContact() {} 34 | 35 | void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) override; 36 | }; 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /flatland_server/thirdparty/Box2D/Dynamics/Contacts/b2PolygonContact.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #include "Box2D/Dynamics/Contacts/b2PolygonContact.h" 20 | #include "Box2D/Common/b2BlockAllocator.h" 21 | #include "Box2D/Collision/b2TimeOfImpact.h" 22 | #include "Box2D/Dynamics/b2Body.h" 23 | #include "Box2D/Dynamics/b2Fixture.h" 24 | #include "Box2D/Dynamics/b2WorldCallbacks.h" 25 | 26 | #include 27 | 28 | b2Contact* b2PolygonContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator) 29 | { 30 | void* mem = allocator->Allocate(sizeof(b2PolygonContact)); 31 | return new (mem) b2PolygonContact(fixtureA, fixtureB); 32 | } 33 | 34 | void b2PolygonContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) 35 | { 36 | ((b2PolygonContact*)contact)->~b2PolygonContact(); 37 | allocator->Free(contact, sizeof(b2PolygonContact)); 38 | } 39 | 40 | b2PolygonContact::b2PolygonContact(b2Fixture* fixtureA, b2Fixture* fixtureB) 41 | : b2Contact(fixtureA, 0, fixtureB, 0) 42 | { 43 | b2Assert(m_fixtureA->GetType() == b2Shape::e_polygon); 44 | b2Assert(m_fixtureB->GetType() == b2Shape::e_polygon); 45 | } 46 | 47 | void b2PolygonContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) 48 | { 49 | b2CollidePolygons( manifold, 50 | (b2PolygonShape*)m_fixtureA->GetShape(), xfA, 51 | (b2PolygonShape*)m_fixtureB->GetShape(), xfB); 52 | } 53 | -------------------------------------------------------------------------------- /flatland_server/thirdparty/Box2D/Dynamics/Contacts/b2PolygonContact.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #ifndef B2_POLYGON_CONTACT_H 20 | #define B2_POLYGON_CONTACT_H 21 | 22 | #include "Box2D/Dynamics/Contacts/b2Contact.h" 23 | 24 | class b2BlockAllocator; 25 | 26 | class b2PolygonContact : public b2Contact 27 | { 28 | public: 29 | static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, 30 | b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); 31 | static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); 32 | 33 | b2PolygonContact(b2Fixture* fixtureA, b2Fixture* fixtureB); 34 | ~b2PolygonContact() {} 35 | 36 | void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) override; 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /flatland_server/thirdparty/Box2D/Dynamics/b2ContactManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #ifndef B2_CONTACT_MANAGER_H 20 | #define B2_CONTACT_MANAGER_H 21 | 22 | #include "Box2D/Collision/b2BroadPhase.h" 23 | 24 | class b2Contact; 25 | class b2ContactFilter; 26 | class b2ContactListener; 27 | class b2BlockAllocator; 28 | 29 | // Delegate of b2World. 30 | class b2ContactManager 31 | { 32 | public: 33 | b2ContactManager(); 34 | 35 | // Broad-phase callback. 36 | void AddPair(void* proxyUserDataA, void* proxyUserDataB); 37 | 38 | void FindNewContacts(); 39 | 40 | void Destroy(b2Contact* c); 41 | 42 | void Collide(); 43 | 44 | b2BroadPhase m_broadPhase; 45 | b2Contact* m_contactList; 46 | int32 m_contactCount; 47 | b2ContactFilter* m_contactFilter; 48 | b2ContactListener* m_contactListener; 49 | b2BlockAllocator* m_allocator; 50 | }; 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /flatland_server/thirdparty/Box2D/Dynamics/b2TimeStep.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2011 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #ifndef B2_TIME_STEP_H 20 | #define B2_TIME_STEP_H 21 | 22 | #include "Box2D/Common/b2Math.h" 23 | 24 | /// Profiling data. Times are in milliseconds. 25 | struct b2Profile 26 | { 27 | float32 step; 28 | float32 collide; 29 | float32 solve; 30 | float32 solveInit; 31 | float32 solveVelocity; 32 | float32 solvePosition; 33 | float32 broadphase; 34 | float32 solveTOI; 35 | }; 36 | 37 | /// This is an internal structure. 38 | struct b2TimeStep 39 | { 40 | float32 dt; // time step 41 | float32 inv_dt; // inverse time step (0 if dt == 0). 42 | float32 dtRatio; // dt * inv_dt0 43 | int32 velocityIterations; 44 | int32 positionIterations; 45 | bool warmStarting; 46 | }; 47 | 48 | /// This is an internal structure. 49 | struct b2Position 50 | { 51 | b2Vec2 c; 52 | float32 a; 53 | }; 54 | 55 | /// This is an internal structure. 56 | struct b2Velocity 57 | { 58 | b2Vec2 v; 59 | float32 w; 60 | }; 61 | 62 | /// Solver Data 63 | struct b2SolverData 64 | { 65 | b2TimeStep step; 66 | b2Position* positions; 67 | b2Velocity* velocities; 68 | }; 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /flatland_server/thirdparty/Box2D/Dynamics/b2WorldCallbacks.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2009 Erin Catto http://www.box2d.org 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 1. The origin of this software must not be misrepresented; you must not 11 | * claim that you wrote the original software. If you use this software 12 | * in a product, an acknowledgment in the product documentation would be 13 | * appreciated but is not required. 14 | * 2. Altered source versions must be plainly marked as such, and must not be 15 | * misrepresented as being the original software. 16 | * 3. This notice may not be removed or altered from any source distribution. 17 | */ 18 | 19 | #include "Box2D/Dynamics/b2WorldCallbacks.h" 20 | #include "Box2D/Dynamics/b2Fixture.h" 21 | 22 | // Return true if contact calculations should be performed between these two shapes. 23 | // If you implement your own collision filter you may want to build from this implementation. 24 | bool b2ContactFilter::ShouldCollide(b2Fixture* fixtureA, b2Fixture* fixtureB) 25 | { 26 | const b2Filter& filterA = fixtureA->GetFilterData(); 27 | const b2Filter& filterB = fixtureB->GetFilterData(); 28 | 29 | if (filterA.groupIndex == filterB.groupIndex && filterA.groupIndex != 0) 30 | { 31 | return filterA.groupIndex > 0; 32 | } 33 | 34 | bool collide = (filterA.maskBits & filterB.categoryBits) != 0 && (filterA.categoryBits & filterB.maskBits) != 0; 35 | return collide; 36 | } 37 | -------------------------------------------------------------------------------- /flatland_server/thirdparty/Box2D/License.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2006-2013 Erin Catto http://www.gphysics.com 2 | 3 | This software is provided 'as-is', without any express or implied 4 | warranty. In no event will the authors be held liable for any damages 5 | arising from the use of this software. 6 | 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it 9 | freely, subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not 12 | claim that you wrote the original software. If you use this software 13 | in a product, an acknowledgment in the product documentation would be 14 | appreciated but is not required. 15 | 2. Altered source versions must be plainly marked as such, and must not be 16 | misrepresented as being the original software. 17 | 3. This notice may not be removed or altered from any source distribution. 18 | 19 | -------------------------------------------------------------------------------- /flatland_server/thirdparty/Box2D/UseBox2D.cmake: -------------------------------------------------------------------------------- 1 | # -*- cmake -*- 2 | # 3 | # UseBox2d.cmake 4 | # 5 | 6 | add_definitions ( ${BOX2D_DEFINITIONS} ) 7 | include_directories ( ${BOX2D_INCLUDE_DIRS} ) 8 | link_directories ( ${BOX2D_LIBRARY_DIRS} ) 9 | 10 | -------------------------------------------------------------------------------- /flatland_viz/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package flatland_viz 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 1.4.1 (2023-11-24) 6 | ------------------ 7 | * CMake version required bump to fix ros build farm warning 8 | 9 | 1.4.0 (2023-11-22) 10 | ------------------ 11 | * Version Bump 12 | 13 | 1.3.3 (2023-02-06) 14 | ------------------ 15 | * Merge pull request `#95 `_ from avidbots/per-package-licenses 16 | Per package licenses 17 | * Contributors: Joseph Duchesne 18 | 19 | * Merge pull request `#95 `_ from avidbots/per-package-licenses 20 | Per package licenses 21 | * Contributors: Joseph Duchesne 22 | 23 | * Merge pull request `#95 `_ from avidbots/per-package-licenses 24 | Per package licenses 25 | * Contributors: Joseph Duchesne 26 | -------------------------------------------------------------------------------- /flatland_viz/LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2023, Avidbots Corp. 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /flatland_viz/include/flatland_viz/pause_sim_tool.h: -------------------------------------------------------------------------------- 1 | #ifndef PAUSE_SIM_TOOL_H 2 | #define PAUSE_SIM_TOOL_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace flatland_viz { 9 | 10 | /** 11 | * @name PauseSimTool 12 | * @brief Rviz tool to support pausing and unpausing the 13 | * simulation. 14 | */ 15 | class PauseSimTool : public rviz::Tool { 16 | public: 17 | PauseSimTool(); 18 | ~PauseSimTool(); 19 | 20 | private: 21 | /** 22 | * @name onInitialize 23 | * @brief Initializes tools currently loaded when rviz starts 24 | */ 25 | virtual void onInitialize(); 26 | 27 | /** 28 | virtual void activate(); 29 | * @name activate 30 | * @brief Call the pause toggle service 31 | */ 32 | virtual void activate(); 33 | 34 | /** 35 | * @name deactivate 36 | * @brief Cleanup when tool is removed 37 | */ 38 | virtual void deactivate(); 39 | 40 | ros::NodeHandle nh_; ///< NodeHandle to call the pause toggle service 41 | ros::ServiceClient 42 | pause_service_; ///< ServiceClient that calls the pause toggle service 43 | }; 44 | } 45 | 46 | #endif // PAUSE_SIM_TOOL_H 47 | -------------------------------------------------------------------------------- /flatland_viz/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | flatland_viz 4 | 1.4.1 5 | The flatland gui and visualization 6 | BSD 7 | https://bitbucket.org/avidbots/flatland 8 | 9 | Joseph Duchesne 10 | Joseph Duchesne 11 | Chunshang Li 12 | Mike Brousseau 13 | 14 | catkin 15 | 16 | cmake_modules 17 | 18 | qtbase5-dev 19 | libqt5-core 20 | libqt5-gui 21 | libqt5-widgets 22 | libogre-dev 23 | roscpp 24 | rviz 25 | flatland_server 26 | flatland_msgs 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /flatland_viz/plugin_description.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | Tool for spwaning models on the ground plane in flatland. 7 | 8 | 9 | 12 | 13 | Tool for pausing and unpausing flatland simulation. 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /flatland_viz/src/pause_sim_tool.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace flatland_viz { 4 | 5 | PauseSimTool::PauseSimTool() {} 6 | 7 | // Disconnect the service client when the tool's destructor is called 8 | PauseSimTool::~PauseSimTool() { pause_service_.shutdown(); } 9 | 10 | // When the tool is initially loaded, connect to the pause toggle service 11 | void PauseSimTool::onInitialize() { 12 | pause_service_ = nh_.serviceClient("toggle_pause"); 13 | setName("Pause/Resume"); 14 | } 15 | 16 | // Every time the user presses the tool's Rviz toolbar button, call the pause 17 | // toggle service 18 | void PauseSimTool::activate() { 19 | std_srvs::Empty empty; 20 | pause_service_.call(empty); 21 | } 22 | 23 | void PauseSimTool::deactivate() {} 24 | 25 | } // end namespace flatland_viz 26 | 27 | // Tell pluginlib about the tool class 28 | #include 29 | PLUGINLIB_EXPORT_CLASS(flatland_viz::PauseSimTool, rviz::Tool) 30 | -------------------------------------------------------------------------------- /scripts/ci_postbuild.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | # cd into catkin workspace 4 | cd ~/target_ws 5 | 6 | # run static analyzer 7 | source /opt/ros/*/setup.bash 8 | catkin clean -y 9 | catkin build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON 10 | 11 | echo "running clang tidy on flatland_server..." 12 | run-clang-tidy-3.8.py -j1 -clang-tidy-binary=clang-tidy-3.8 -p=build/flatland_server | ~/target_ws/src/flatland/scripts/parse_clang_tidy.py 13 | 14 | echo "running clang tidy on flatland_plugins..." 15 | run-clang-tidy-3.8.py -j1 -clang-tidy-binary=clang-tidy-3.8 -p=build/flatland_plugins | ~/target_ws/src/flatland/scripts/parse_clang_tidy.py 16 | 17 | echo "running clang tidy on flatland_viz..." 18 | run-clang-tidy-3.8.py -j1 -clang-tidy-binary=clang-tidy-3.8 -p=build/flatland_viz | ~/target_ws/src/flatland/scripts/parse_clang_tidy.py 19 | 20 | echo "ci_postbuild.sh completed." 21 | -------------------------------------------------------------------------------- /scripts/ci_prebuild.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | function print_er { 4 | if [ -n "$1" ]; then 5 | echo -e "\e[31m$1\e[0m" # print error in red 6 | fi 7 | } 8 | 9 | 10 | apt-get install clang clang-format clang-tidy -y 11 | 12 | # change to the file's directory 13 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 14 | cd $DIR/../ 15 | 16 | # check files are correctly formatted 17 | 18 | echo "running clang format..." 19 | CLANG_CHANGES_CNT=$(git ls-files | grep -E '\.[ch](pp)?$' | grep -v "thirdparty/" | xargs clang-format-3.8 --style=file -output-replacements-xml | grep -c " corresponds to one file ^^^^\n" 34 | 35 | print_er "Clang Format Error!" 36 | echo 'File not formatted correctly, please execute the command below in flatland repo to see what needs to be changed' 37 | echo 'git ls-files | grep -E "\.[ch](pp)?$" | grep -v "thirdparty/" | xargs clang-format-3.8 --style=file -i && git diff --exit-code' 38 | exit 1; 39 | fi 40 | 41 | echo "ci_prebuild.sh completed." 42 | -------------------------------------------------------------------------------- /scripts/clang_tidy_ignore.yaml: -------------------------------------------------------------------------------- 1 | - ".*/flatland/flatland_server/thirdparty/Box2D/.*" 2 | - ".*/flatland/flatland_server/.*warning: 'log_deprecated' is deprecated \\[clang-diagnostic-deprecated-declarations\\].*" 3 | - ".*/flatland/flatland_plugins/.*warning: 'log_deprecated' is deprecated \\[clang-diagnostic-deprecated-declarations\\].*" 4 | - ".*QtCore/qobject.h:235:16.*warning: Potential memory leak.*\\[clang-analyzer-cplusplus.NewDeleteLeaks\\].*" 5 | - ".*/flatland/flatland_viz/.*warning: 'log_deprecated' is deprecated \\[clang-diagnostic-deprecated-declarations\\].*" 6 | - ".*/eigen3/Eigen/.*warning.*" 7 | -------------------------------------------------------------------------------- /scripts/coverage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | # This script is used in CI testing (and can be used manually) 3 | # to generate code coverage statistics, showing which code has been unit tested 4 | # to use it, you must install "lcov" (`sudo apt-get install lcov`) 5 | # 6 | # Run from catkin workspace to generate coverage stats 7 | PROJECT_HOME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/.." 8 | 9 | rm -f $PROJECT_HOME/lcov.info 10 | catkin_make -DCMAKE_BUILD_TYPE=Debug -DCOVERAGE=ON -j1 11 | catkin_make run_tests -j1 12 | catkin_test_results 13 | lcov --path . --directory . --capture --output-file $PROJECT_HOME/lcov.info 14 | lcov --remove $PROJECT_HOME/lcov.info '/thirdparty/' '/test/' '/usr/' '/opt/' --output-file $PROJECT_HOME/lcov.info 15 | lcov --list $PROJECT_HOME/lcov.info -------------------------------------------------------------------------------- /scripts/doxygen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | dpkg -s doxygen 4 | 5 | # if doxygen is not installed, install doxygen 6 | if [ $? -ne 0 ]; then 7 | echo "Doxygen not installed, installing doxygen" 8 | sudo apt-get install doxygen -y 9 | fi 10 | 11 | # change directory to the doxygen file 12 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 13 | cd $DIR/../ 14 | 15 | # run doxygen 16 | doxygen Doxyfile -------------------------------------------------------------------------------- /scripts/parse_clang_tidy.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2.7 2 | 3 | import sys 4 | import os 5 | import yaml 6 | import re 7 | 8 | def match_ignores(line, ignores): 9 | for ignore in ignores: 10 | ignore_pattern = re.compile(ignore) 11 | if ignore_pattern.match(line): 12 | return True 13 | return False 14 | 15 | def main(): 16 | 17 | directory = os.path.dirname(os.path.realpath(__file__)) 18 | ignore_file = open(os.path.join(directory, "clang_tidy_ignore.yaml"), "r") 19 | ignores = yaml.load(ignore_file) 20 | 21 | clang_tidy_lines = sys.stdin.readlines() 22 | print("".join(clang_tidy_lines)); 23 | 24 | caught_problems = [] 25 | 26 | for line in clang_tidy_lines: 27 | line = line.strip() 28 | 29 | line_pattern = re.compile("/.*:\d+:\d+: (warning|error):.*\[.*\]") 30 | if not line_pattern.match(line): 31 | continue 32 | 33 | if match_ignores(line, ignores): 34 | continue 35 | 36 | caught_problems.append(line) 37 | 38 | print("\n\nIgnore List:") 39 | for ignore in ignores: 40 | print(ignore) 41 | 42 | 43 | if (len(caught_problems) > 0): 44 | 45 | print("\nCaught %d problem(s) not in the ignore list:" % len(caught_problems)) 46 | for problem in caught_problems: 47 | print(problem) 48 | 49 | print("\nSee clang tidy output for more information") 50 | 51 | exit(1) 52 | else: 53 | print("\nNo problems caught!\n\n\n") 54 | exit(0) 55 | 56 | if __name__ == "__main__": 57 | main() 58 | --------------------------------------------------------------------------------