Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
ARG ROS_DISTRO=humble
FROM ros:${ROS_DISTRO}

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y --no-install-recommends \
bash-completion \
ccache \
gdb \
git \
python3-colcon-common-extensions \
python3-rosdep \
&& rm -rf /var/lib/apt/lists/*

COPY . /tmp/flatland
RUN rosdep update && \
apt-get update && \
rosdep install --from-paths /tmp/flatland --ignore-src --rosdistro "$ROS_DISTRO" -y && \
rm -rf /tmp/flatland /var/lib/apt/lists/*

ENV CCACHE_DIR=/tmp/.ccache
WORKDIR /opt/overlay_ws
29 changes: 29 additions & 0 deletions .devcontainer/humble/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "Flatland (Humble)",
"build": {
"dockerfile": "../Dockerfile",
"context": "../..",
"args": { "ROS_DISTRO": "humble" }
},
"runArgs": ["--init"],
"workspaceFolder": "/opt/overlay_ws/src/flatland",
"workspaceMount": "source=${localWorkspaceFolder},target=${containerWorkspaceFolder},type=bind",
"mounts": [
{ "source": "overlay-${devcontainerId}", "target": "/opt/overlay_ws", "type": "volume" },
{ "source": "ccache-${devcontainerId}", "target": "/tmp/.ccache", "type": "volume" }
],
"remoteEnv": { "CCACHE_DIR": "/tmp/.ccache" },
"onCreateCommand": "bash .devcontainer/on-create-command.sh",
"updateContentCommand": "bash .devcontainer/update-content-command.sh",
"postCreateCommand": "bash .devcontainer/post-create-command.sh",
"customizations": {
"vscode": {
"extensions": [
"althack.ament-task-provider",
"eamodio.gitlens",
"ms-iot.vscode-ros",
"twxs.cmake"
]
}
}
}
29 changes: 29 additions & 0 deletions .devcontainer/jazzy/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "Flatland (Jazzy)",
"build": {
"dockerfile": "../Dockerfile",
"context": "../..",
"args": { "ROS_DISTRO": "jazzy" }
},
"runArgs": ["--init"],
"workspaceFolder": "/opt/overlay_ws/src/flatland",
"workspaceMount": "source=${localWorkspaceFolder},target=${containerWorkspaceFolder},type=bind",
"mounts": [
{ "source": "overlay-${devcontainerId}", "target": "/opt/overlay_ws", "type": "volume" },
{ "source": "ccache-${devcontainerId}", "target": "/tmp/.ccache", "type": "volume" }
],
"remoteEnv": { "CCACHE_DIR": "/tmp/.ccache" },
"onCreateCommand": "bash .devcontainer/on-create-command.sh",
"updateContentCommand": "bash .devcontainer/update-content-command.sh",
"postCreateCommand": "bash .devcontainer/post-create-command.sh",
"customizations": {
"vscode": {
"extensions": [
"althack.ament-task-provider",
"eamodio.gitlens",
"ms-iot.vscode-ros",
"twxs.cmake"
]
}
}
}
29 changes: 29 additions & 0 deletions .devcontainer/kilted/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "Flatland (Kilted)",
"build": {
"dockerfile": "../Dockerfile",
"context": "../..",
"args": { "ROS_DISTRO": "kilted" }
},
"runArgs": ["--init"],
"workspaceFolder": "/opt/overlay_ws/src/flatland",
"workspaceMount": "source=${localWorkspaceFolder},target=${containerWorkspaceFolder},type=bind",
"mounts": [
{ "source": "overlay-${devcontainerId}", "target": "/opt/overlay_ws", "type": "volume" },
{ "source": "ccache-${devcontainerId}", "target": "/tmp/.ccache", "type": "volume" }
],
"remoteEnv": { "CCACHE_DIR": "/tmp/.ccache" },
"onCreateCommand": "bash .devcontainer/on-create-command.sh",
"updateContentCommand": "bash .devcontainer/update-content-command.sh",
"postCreateCommand": "bash .devcontainer/post-create-command.sh",
"customizations": {
"vscode": {
"extensions": [
"althack.ament-task-provider",
"eamodio.gitlens",
"ms-iot.vscode-ros",
"twxs.cmake"
]
}
}
}
29 changes: 29 additions & 0 deletions .devcontainer/lyrical/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "Flatland (Lyrical)",
"build": {
"dockerfile": "../Dockerfile",
"context": "../..",
"args": { "ROS_DISTRO": "lyrical" }
},
"runArgs": ["--init"],
"workspaceFolder": "/opt/overlay_ws/src/flatland",
"workspaceMount": "source=${localWorkspaceFolder},target=${containerWorkspaceFolder},type=bind",
"mounts": [
{ "source": "overlay-${devcontainerId}", "target": "/opt/overlay_ws", "type": "volume" },
{ "source": "ccache-${devcontainerId}", "target": "/tmp/.ccache", "type": "volume" }
],
"remoteEnv": { "CCACHE_DIR": "/tmp/.ccache" },
"onCreateCommand": "bash .devcontainer/on-create-command.sh",
"updateContentCommand": "bash .devcontainer/update-content-command.sh",
"postCreateCommand": "bash .devcontainer/post-create-command.sh",
"customizations": {
"vscode": {
"extensions": [
"althack.ament-task-provider",
"eamodio.gitlens",
"ms-iot.vscode-ros",
"twxs.cmake"
]
}
}
}
5 changes: 5 additions & 0 deletions .devcontainer/on-create-command.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -euo pipefail

mkdir -p /opt/overlay_ws/src /tmp/.ccache
git config --global --add safe.directory /opt/overlay_ws/src/flatland
7 changes: 7 additions & 0 deletions .devcontainer/post-create-command.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail

setup_line='source /opt/overlay_ws/install/setup.bash'
if ! grep -Fxq "$setup_line" "$HOME/.bashrc"; then
printf '\n%s\n' "$setup_line" >> "$HOME/.bashrc"
fi
29 changes: 29 additions & 0 deletions .devcontainer/rolling/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "Flatland (Rolling)",
"build": {
"dockerfile": "../Dockerfile",
"context": "../..",
"args": { "ROS_DISTRO": "rolling" }
},
"runArgs": ["--init"],
"workspaceFolder": "/opt/overlay_ws/src/flatland",
"workspaceMount": "source=${localWorkspaceFolder},target=${containerWorkspaceFolder},type=bind",
"mounts": [
{ "source": "overlay-${devcontainerId}", "target": "/opt/overlay_ws", "type": "volume" },
{ "source": "ccache-${devcontainerId}", "target": "/tmp/.ccache", "type": "volume" }
],
"remoteEnv": { "CCACHE_DIR": "/tmp/.ccache" },
"onCreateCommand": "bash .devcontainer/on-create-command.sh",
"updateContentCommand": "bash .devcontainer/update-content-command.sh",
"postCreateCommand": "bash .devcontainer/post-create-command.sh",
"customizations": {
"vscode": {
"extensions": [
"althack.ament-task-provider",
"eamodio.gitlens",
"ms-iot.vscode-ros",
"twxs.cmake"
]
}
}
}
10 changes: 10 additions & 0 deletions .devcontainer/update-content-command.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -euo pipefail

source "/opt/ros/${ROS_DISTRO}/setup.bash"
cd /opt/overlay_ws
colcon build --symlink-install \
--cmake-args \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
4 changes: 2 additions & 2 deletions .github/workflows/industrial_ci_action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:
strategy:
matrix:
env:
# - {ROS_DISTRO: humble, ROS_REPO: main, AMENT_CPPCHECK_ALLOW_SLOW_VERSIONS: true}
- {ROS_DISTRO: humble, ROS_REPO: main, AMENT_CPPCHECK_ALLOW_SLOW_VERSIONS: true}
# - {ROS_DISTRO: jazzy, ROS_REPO: main, AMENT_CPPCHECK_ALLOW_SLOW_VERSIONS: true}
- {ROS_DISTRO: kilted, ROS_REPO: main, AMENT_CPPCHECK_ALLOW_SLOW_VERSIONS: true, TARGET_CMAKE_ARGS: '-DCMAKE_COMPILE_WARNING_AS_ERROR=ON'}
# - {ROS_DISTRO: kilted, ROS_REPO: main, AMENT_CPPCHECK_ALLOW_SLOW_VERSIONS: true, TARGET_CMAKE_ARGS: '-DCMAKE_COMPILE_WARNING_AS_ERROR=ON'}
- {ROS_DISTRO: lyrical, ROS_REPO: main, AMENT_CPPCHECK_ALLOW_SLOW_VERSIONS: true, TARGET_CMAKE_ARGS: '-DCMAKE_COMPILE_WARNING_AS_ERROR=ON'}
- {ROS_DISTRO: rolling, ROS_REPO: main, OS_CODE_NAME: noble, AMENT_CPPCHECK_ALLOW_SLOW_VERSIONS: true, TARGET_CMAKE_ARGS: '-DCMAKE_COMPILE_WARNING_AS_ERROR=ON'}
runs-on: ubuntu-24.04
Expand Down
13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

37 changes: 28 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,38 @@
# README #

![ci test result](https://travis-ci.com/avidbots/flatland.svg?branch=master "CI Test Result")
### What is Flatland? ###

Flatland is a lightweight 2.5D robot simulator for ROS 1 and ROS 2.

### What is this repository for? ###
- Simulate 2D motion with a variety of drivetrains.
- Extend worlds and robots with plugins for dynamic maps, lidar, and drive control.
- Run faster than real time; connected ROS nodes may encounter timing issues if they cannot keep up.
- Allows headless execution, with RViz based visualization if needed

* Flatland is a performance centric 2d robot simulator
* [Roadmap on trello](https://trello.com/b/s9poP2Jg/flatland-2d-simulator)
* Release Version: None
### Dev container (recommended) ###

### How do I get set up? ###
1. Install Docker, VS Code, and the Dev Containers extension.
2. Open the Flatland repository in VS Code and run **Dev Containers: Reopen in Container**.
3. Choose Humble, Jazzy, Kilted, Lyrical, or Rolling when prompted.

* Git clone flatland into your catkin workspace's src folder, and catkin build.
* Optionally check out [turtlebot_flatland](https://github.com/avidbots/turtlebot_flatland) and run the turtlebot nav stack
* Run `rosdep install --from-paths src --ignore-src` in your catkin workspace to install any missing rosdeps
Once the container opens, Flatland is ready to use. Run **Dev Containers: Rebuild Container** if you change package dependencies.

### Without a dev container (ROS 2) ###

Install ROS 2 on your host, or in a container, then run the following:

```bash
mkdir -p ~/flatland_ws/src
git clone https://github.com/avidbots/flatland.git ~/flatland_ws/src/flatland
source /opt/ros/*/setup.bash
cd ~/flatland_ws
rosdep update
rosdep install --from-paths src --ignore-src -y
colcon build --symlink-install
source install/setup.bash
```

For older ROS 1 / catkin setups, check out a ROS 1-compatible Flatland version in your catkin workspace's `src` directory. From the workspace root, run `rosdep install --from-paths src --ignore-src -y` and `catkin build`.

### Who do I talk to? ###

Expand Down
4 changes: 2 additions & 2 deletions flatland_plugins/test/bumper_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ TEST_F(BumperPluginTest, collision_test)
SpinRos(500, 10); // make sure the messages gets through

// check time is not zero to make sure message is received
ASSERT_NE(msg1.header.stamp, rclcpp::Time(0, 0));
ASSERT_NE(msg2.header.stamp, rclcpp::Time(0, 0));
ASSERT_NE(msg1.header.stamp, builtin_interfaces::msg::Time{});
ASSERT_NE(msg2.header.stamp, builtin_interfaces::msg::Time{});

// step 15 time which makes the body move 1.5 meters, will make base_link_1
// collide, but not base_link_2, not that base_link_1's fixture is a sensor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,43 +1,38 @@
/*
* @copyright Copyright 2022 FEUP
* Copyright (c) 2022, FEUP
* @name change_rate_dialog.cpp
* @brief dialog to change rate
* @author Ana Barros
* @author Henrique Ribeiro
* @author João Costa
*
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of the Avidbots Corp. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

// Copyright (c) 2022, FEUP
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
// * Neither the name of the Avidbots Corp. nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
// COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// @name change_rate_dialog.cpp
// @brief dialog to change rate
// @author Ana Barros
// @author Henrique Ribeiro
// @author João Costa
// All rights reserved.
#ifndef FLATLAND_RVIZ_PLUGINS__CHANGE_RATE_DIALOG_HPP_
#define FLATLAND_RVIZ_PLUGINS__CHANGE_RATE_DIALOG_HPP_

Expand Down
Loading
Loading