diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 000000000..b7972978c
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,5 @@
+.circleci/
+.github/
+.gitignore/
+LICENSE/
+README.md
diff --git a/.github/.mergify.yml b/.github/.mergify.yml
new file mode 100644
index 000000000..1ba3b6a7a
--- /dev/null
+++ b/.github/.mergify.yml
@@ -0,0 +1,36 @@
+---
+pull_request_rules:
+ - name: backport to iron at reviewers discretion
+ conditions:
+ - base=rolling
+ - label=backport-iron
+ actions:
+ backport:
+ branches:
+ - iron
+
+ - name: backport to humble at reviewers discretion
+ conditions:
+ - base=rolling
+ - label=backport-humble
+ actions:
+ backport:
+ branches:
+ - humble
+
+ - name: delete head branch after merge
+ conditions:
+ - merged
+ actions:
+ delete_head_branch:
+
+ - name: ask to resolve conflict
+ conditions:
+ - conflict
+ - author!=mergify
+ actions:
+ comment:
+ message: This pull request is in conflict. Could you fix it @{{author}}?
+
+# TODO enable automatic merge of backports
+# https://docs.mergify.com/workflow/actions/backport/#combining-automatic-merge
diff --git a/.github/workflows/colcon.yaml b/.github/workflows/colcon.yaml
new file mode 100644
index 000000000..c923ad037
--- /dev/null
+++ b/.github/workflows/colcon.yaml
@@ -0,0 +1,51 @@
+name: Colcon Build Test
+on:
+ push:
+ branches:
+ - 'rolling'
+ - 'jazzy'
+ - 'iron'
+ - 'humble'
+ pull_request:
+ branches:
+ - '*'
+jobs:
+ build-test:
+ runs-on: ubuntu-22.04
+ strategy:
+ fail-fast: false
+ matrix:
+ config:
+ - {rosdistro: 'jazzy', container: 'ros:jazzy'}
+ container: ${{ matrix.config.container }}
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ path: src/grid_map
+ - name: Pull in repos with vcs
+ run: |
+ apt-get update
+ vcs import --shallow --skip-existing --input grid_map/tools/ros2_dependencies.repos
+ shell: bash
+ working-directory: src
+ if: ${{ matrix.config.rosdistro == 'rolling' }}
+ - name: Install Dependencies with Rosdep
+ run: |
+ apt update
+ rosdep update
+ source /opt/ros/${{matrix.config.rosdistro}}/setup.bash
+ rosdep install --from-paths src --ignore-src -y --skip-keys "slam_toolbox turtlebot3_gazebo gazebo_ros_pkgs octomap_server"
+ shell: bash
+ - name: Colcon Build (Release)
+ run: |
+ source /opt/ros/${{matrix.config.rosdistro}}/setup.bash
+ colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release --packages-up-to grid_map
+ shell: bash
+ - name: Test
+ run: |
+ source /opt/ros/${{matrix.config.rosdistro}}/setup.bash
+ source install/setup.bash
+ colcon test --paths src/grid_map/* --event-handlers=console_cohesion+
+ colcon test-result --all --verbose
+ shell: bash
+
diff --git a/.github/workflows/industrial-ci.yaml b/.github/workflows/industrial-ci.yaml
new file mode 100644
index 000000000..19aacbeb5
--- /dev/null
+++ b/.github/workflows/industrial-ci.yaml
@@ -0,0 +1,36 @@
+name: Industrial CI
+
+# Use industrial CI to ensure our packages express all dependencies.
+# Attempts to find issues like #490 before merge.
+# https://github.com/ros-industrial/industrial_ci?tab=readme-ov-file#for-github-actions
+
+on:
+ push:
+ branches:
+ - 'jazzy'
+ pull_request:
+ branches:
+ - '*'
+
+jobs:
+ industrial_ci:
+ strategy:
+ matrix:
+ env:
+ - {ROS_DISTRO: jazzy, ROS_REPO: testing}
+ - {ROS_DISTRO: jazzy, ROS_REPO: main}
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ # nav2 on rolling is not available with binaries
+ - name: Set UPSTREAM_WORKSPACE to bring in nav2 as a source dependency
+ if: ${{ matrix.env.ROS_DISTRO == 'rolling' }}
+ run: echo "UPSTREAM_WORKSPACE=https://raw.githubusercontent.com/ANYbotics/grid_map/rolling/tools/ros2_dependencies.repos" >> $GITHUB_ENV
+ # We duplicate NAV2's key skipping because I doubt they intend this bespoke file to be used by other CI jobs:
+ # https://github.com/ros-navigation/navigation2/blob/main/tools/skip_keys.txt
+ # It also is out of date, so grid_map is just going to skip keys we are sure don't work.
+ - name: set ROSDEP_SKIP_KEYS to skip nav2 keys
+ if: ${{ matrix.env.ROS_DISTRO == 'rolling' }}
+ run: echo "ROSDEP_SKIP_KEYS=slam_toolbox" >> $GITHUB_ENV
+ - uses: 'ros-industrial/industrial_ci@master'
+ env: ${{matrix.env}}
diff --git a/.github/workflows/mirror-rolling-to-ros2.yaml b/.github/workflows/mirror-rolling-to-ros2.yaml
new file mode 100644
index 000000000..fa4e69bf3
--- /dev/null
+++ b/.github/workflows/mirror-rolling-to-ros2.yaml
@@ -0,0 +1,13 @@
+name: Mirror rolling to ros2
+
+on:
+ push:
+ branches: [ rolling ]
+
+jobs:
+ mirror-to-ros2:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: zofrex/mirror-branch@v1
+ with:
+ target-branch: ros2
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 000000000..0ee0be8b5
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,36 @@
+ARG ROS_DISTRO=rolling
+FROM ros:${ROS_DISTRO}-ros-core
+
+WORKDIR /root/ros2_ws/
+
+# Install essential dependencies
+RUN apt-get update && \
+ apt-get install -y \
+ ros-dev-tools \
+ wget && \
+ apt-get clean && \
+ rm -rf /var/lib/apt/lists/*
+
+# Clone dependencies
+COPY tools/ros2_dependencies.repos .
+RUN mkdir -p src && \
+ vcs import --input ros2_dependencies.repos src
+
+# Initialize rosdep
+RUN rosdep init
+
+# Copy source code
+COPY . src/grid_map
+
+# Install dependencies
+SHELL ["/bin/bash", "-c"]
+RUN apt-get update && \
+ rosdep update && \
+ source /opt/ros/${ROS_DISTRO}/setup.bash && \
+ rosdep install -y --ignore-src --from-paths src --skip-keys slam_toolbox --skip-keys gazebo_ros_pkgs --skip-keys turtlebot3_gazebo && \
+ apt-get clean && \
+ rm -rf /var/lib/apt/lists/*
+
+# Build
+RUN source /opt/ros/${ROS_DISTRO}/setup.bash && \
+ colcon build --symlink-install --packages-up-to grid_map
diff --git a/README.md b/README.md
index 3bf4c0402..02a7a8557 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,7 @@ Features:
* **Visualizations:** The *grid_map_rviz_plugin* renders grid maps as 3d surface plots (height maps) in [RViz]. Additionally, the *grid_map_visualization* package helps to visualize grid maps as point clouds, occupancy grids, grid cells etc.
* **Filters:** The *grid_map_filters* provides are range of filters to process grid maps as a sequence of filters. Parsing of mathematical expressions allows to flexibly setup powerful computations such as thresholding, normal vectors, smoothening, variance, inpainting, and matrix kernel convolutions.
-The grid map package has been tested with [ROS] Indigo, Jade (under Ubuntu 14.04), Kinetic (under Ubuntu 16.04), and Melodic (under Ubuntu 18.04). This is research code, expect that it changes often and any fitness for a particular purpose is disclaimed.
+The grid map package has been tested with ROS2 Foxy (under Ubuntu 20.04). This is research code, expect that it changes often and any fitness for a particular purpose is disclaimed.
The source code is released under a [BSD 3-Clause license](LICENSE).
@@ -65,36 +65,56 @@ The C++ API is documented here:
* [grid_map_octomap](http://docs.ros.org/kinetic/api/grid_map_octomap/html/index.html)
* [grid_map_pcl](http://docs.ros.org/kinetic/api/grid_map_pcl/html/index.html)
-## Installation
+## ~~Installation~~
-### Installation from Packages
+### ~~Installation from Packages~~
-To install all packages from the grid map library as Debian packages use
+~~To install all packages from the grid map library as Debian packages use~~
- sudo apt-get install ros-$ROS_DISTRO-grid-map
+~~sudo apt-get install ros-$ROS_DISTRO-grid-map~~
### Building from Source
#### Dependencies
-The *grid_map_core* package depends only on the linear algebra library [Eigen].
+Install ROS 2 rolling from [here](https://docs.ros.org/en/rolling/Installation/Alternatives/Ubuntu-Install-Binary.html).
- sudo apt-get install libeigen3-dev
+Source the ROS 2 underlay workspace.
-The other packages depend additionally on the [ROS] standard installation (*roscpp*, *tf*, *filters*, *sensor_msgs*, *nav_msgs*, and *cv_bridge*). Other format specific conversion packages (e.g. *grid_map_cv*, *grid_map_pcl* etc.) depend on packages described below in *Packages Overview*.
+ source /opt/ros/rolling/setup.bash
-#### Building
+Clone and build grid_map ROS2 dependencies.
+The *grid_map_core* package depends only on the linear algebra library [Eigen] which is installed through rosdep.
-To build from source, clone the latest version from this repository into your catkin workspace and compile the package using
- cd catkin_ws/src
- git clone https://github.com/anybotics/grid_map.git
+ mkdir -p ~/gridmap_dep/src
+ cd ~/gridmap_dep
+ wget https://raw.githubusercontent.com/ANYbotics/grid_map/rolling/tools/ros2_dependencies.repos
+ vcs import src < ros2_dependencies.repos
+ rosdep install -y --ignore-src --from-paths src
+ colcon build --symlink-install --packages-up-to pcl_ros
+
+The other packages depend additionally on the [ROS] standard installation (*rclcpp*, *tf*, *filters*, *sensor_msgs*, *nav_msgs*, and *cv_bridge*). Other format specific conversion packages (e.g. *grid_map_cv*, *grid_map_pcl* etc.) depend on packages described below in *Packages Overview*.
+
+#### Building grid_map
+
+In a new terminal, source your underlay dependency workspace.
+
+ source ~/gridmap_dep/install/setup.bash
+
+Clone the latest version from this repository and build it in a new grid_map workspace.
+
+ mkdir -p ~/gridmap_ws/src
+ cd ~/gridmap_ws/src
+ git clone https://github.com/anybotics/grid_map.git --branch ros2
cd ../
- catkin_make
+ rosdep install -y --ignore-src --from-paths src
+ colcon build --symlink-install
+
To maximize performance, make sure to build in *Release* mode. You can specify the build type by setting
- catkin_make -DCMAKE_BUILD_TYPE=Release
+ colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release
### Packages Overview
@@ -106,7 +126,7 @@ This repository consists of following packages:
* ***grid_map_ros*** is the main package for [ROS] dependent projects using the grid map library. It provides the interfaces to convert grid maps from and to several [ROS] message types.
* ***grid_map_demos*** contains several nodes for demonstration purposes.
* ***grid_map_filters*** builds on the [ROS Filters] package to process grid maps as a sequence of filters.
-* ***grid_map_msgs*** holds the [ROS] message and service definitions around the [grid_map_msg/GridMap] message type.
+* ***grid_map_msgs*** holds the [ROS] message and service definitions around the [grid_map_msg/msg/GridMap] message type.
* ***grid_map_rviz_plugin*** is an [RViz] plugin to visualize grid maps as 3d surface plots (height maps).
* ***grid_map_visualization*** contains a node written to convert GridMap messages to other [ROS] message types for example for visualization in [RViz].
@@ -121,13 +141,13 @@ Additional conversion packages:
Run the unit tests with
- catkin_make run_tests_grid_map_core run_tests_grid_map_ros
+ colcon test --packages-up-to grid_map
-or
+View test results with
- catkin build grid_map --no-deps --verbose --catkin-make-args run_tests
+ colcon test-result --verbose
-if you are using [catkin tools](http://catkin-tools.readthedocs.org/).
+if you are using [colcon](https://colcon.readthedocs.io/en/released/index.html).
## Usage
@@ -135,37 +155,43 @@ if you are using [catkin tools](http://catkin-tools.readthedocs.org/).
The *grid_map_demos* package contains several demonstration nodes. Use this code to verify your installation of the grid map packages and to get you started with your own usage of the library.
+*Note: The octomap_to_gridmap_demo_launch.py is not working at the moment, pending the port of octomap_server see issue [OctoMap/octomap_mapping/#76](https://github.com/OctoMap/octomap_mapping/issues/76).*
+
+Before running the demos make sure you source your grid_map overlay workspace
+
+ source ~/gridmap_ws/install/setup.bash
+
* *[simple_demo](grid_map_demos/src/simple_demo_node.cpp)* demonstrates a simple example for using the grid map library. This ROS node creates a grid map, adds data to it, and publishes it. To see the result in RViz, execute the command
- roslaunch grid_map_demos simple_demo.launch
+ ros2 launch grid_map_demos simple_demo_launch.py
* *[tutorial_demo](grid_map_demos/src/tutorial_demo_node.cpp)* is an extended demonstration of the library's functionalities. Launch the *tutorial_demo* with
- roslaunch grid_map_demos tutorial_demo.launch
+ ros2 launch grid_map_demos tutorial_demo_launch.py
* *[iterators_demo](grid_map_demos/src/IteratorsDemo.cpp)* showcases the usage of the grid map iterators. Launch it with
- roslaunch grid_map_demos iterators_demo.launch
+ ros2 launch grid_map_demos iterators_demo_launch.py
* *[image_to_gridmap_demo](grid_map_demos/src/ImageToGridmapDemo.cpp)* demonstrates how to convert data from an [image](grid_map_demos/data/eth_logo.png) to a grid map. Start the demonstration with
- roslaunch grid_map_demos image_to_gridmap_demo.launch
+ ros2 launch grid_map_demos image_to_gridmap_demo_launch.py

* *[opencv_demo](grid_map_demos/src/opencv_demo_node.cpp)* demonstrates map manipulations with help of [OpenCV] functions. Start the demonstration with
- roslaunch grid_map_demos opencv_demo.launch
+ ros2 launch grid_map_demos opencv_demo_launch.py

* *[resolution_change_demo](grid_map_demos/src/resolution_change_demo_node.cpp)* shows how the resolution of a grid map can be changed with help of the [OpenCV] image scaling methods. The see the results, use
- roslaunch grid_map_demos resolution_change_demo.launch
+ ros2 launch grid_map_demos resolution_change_demo_launch.py
* *[filters_demo](grid_map_demos/src/FiltersDemo.cpp)* uses a chain of [ROS Filters] to process a grid map. Starting from the elevation of a terrain map, the demo uses several filters to show how to compute surface normals, use inpainting to fill holes, smoothen/blur the map, and use math expressions to detect edges, compute roughness and traversability. The filter chain setup is configured in the [`filters_demo_filter_chain.yaml`](grid_map_demos/config/filters_demo_filter_chain.yaml) file. Launch the demo with
- roslaunch grid_map_demos filters_demo.launch
+ ros2 launch grid_map_demos filters_demo_launch.py
[](grid_map_demos/doc/filters_demo.gif)
@@ -173,7 +199,7 @@ The *grid_map_demos* package contains several demonstration nodes. Use this code
* *[interpolation_demo](grid_map_demos/src/InterpolationDemo.cpp)* shows the result of different interpolation methods on the resulting surface. The start the demo, use
- roslaunch grid_map_demos interpolation_demo.launch
+ ros2 launch grid_map_demos interpolation_demo_launch.py
@@ -272,7 +298,7 @@ This [RViz] plugin visualizes a grid map layer as 3d surface plot (height map).
### grid_map_visualization
-This node subscribes to a topic of type [grid_map_msgs/GridMap] and publishes messages that can be visualized in [RViz]. The published topics of the visualizer can be fully configure with a YAML parameter file. Any number of visualizations with different parameters can be added. An example is [here](grid_map_demos/config/tutorial_demo.yaml) for the configuration file of the *tutorial_demo*.
+This node subscribes to a topic of type [grid_map_msgs/msg/GridMap] and publishes messages that can be visualized in [RViz]. The published topics of the visualizer can be fully configure with a YAML parameter file. Any number of visualizations with different parameters can be added. An example is [here](grid_map_demos/config/tutorial_demo.yaml) for the configuration file of the *tutorial_demo*.
Point cloud | Vectors | Occupancy grid | Grid cells
--- | --- | --- | ---
@@ -287,7 +313,7 @@ Point cloud | Vectors | Occupancy grid | Grid cells
#### Subscribed Topics
-* **`/grid_map`** ([grid_map_msgs/GridMap])
+* **`/grid_map`** ([grid_map_msgs/msg/GridMap])
The grid map to visualize.
@@ -296,7 +322,7 @@ Point cloud | Vectors | Occupancy grid | Grid cells
The published topics are configured with the [YAML parameter file](grid_map_demos/config/tutorial_demo.yaml). Possible topics are:
-* **`point_cloud`** ([sensor_msgs/PointCloud2])
+* **`point_cloud`** ([sensor_msgs/msg/PointCloud2])
Shows the grid map as a point cloud. Select which layer to transform as points with the `layer` parameter.
@@ -306,7 +332,7 @@ The published topics are configured with the [YAML parameter file](grid_map_demo
layer: elevation
flat: false # optional
-* **`flat_point_cloud`** ([sensor_msgs/PointCloud2])
+* **`flat_point_cloud`** ([sensor_msgs/msg/PointCloud2])
Shows the grid map as a "flat" point cloud, i.e. with all points at the same height *z*. This is convenient to visualize 2d maps or images (or even video streams) in [RViz] with help of its `Color Transformer`. The parameter `height` determines the desired *z*-position of the flat point cloud.
@@ -317,7 +343,7 @@ The published topics are configured with the [YAML parameter file](grid_map_demo
Note: In order to omit points in the flat point cloud from empty/invalid cells, specify the layers which should be checked for validity with `setBasicLayers(...)`.
-* **`vectors`** ([visualization_msgs/Marker])
+* **`vectors`** ([visualization_msgs/msg/Marker])
Visualizes vector data of the grid map as visual markers. Specify the layers which hold the *x*-, *y*-, and *z*-components of the vectors with the `layer_prefix` parameter. The parameter `position_layer` defines the layer to be used as start point of the vectors.
@@ -330,7 +356,7 @@ The published topics are configured with the [YAML parameter file](grid_map_demo
line_width: 0.005
color: 15600153 # red
-* **`occupancy_grid`** ([nav_msgs/OccupancyGrid])
+* **`occupancy_grid`** ([nav_msgs/msg/OccupancyGrid])
Visualizes a layer of the grid map as occupancy grid. Specify the layer to be visualized with the `layer` parameter, and the upper and lower bound with `data_min` and `data_max`.
@@ -341,7 +367,7 @@ The published topics are configured with the [YAML parameter file](grid_map_demo
data_min: -0.15
data_max: 0.15
-* **`grid_cells`** ([nav_msgs/GridCells])
+* **`grid_cells`** ([nav_msgs/msg/GridCells])
Visualizes a layer of the grid map as grid cells. Specify the layer to be visualized with the `layer` parameter, and the upper and lower bounds with `lower_threshold` and `upper_threshold`.
@@ -352,7 +378,7 @@ The published topics are configured with the [YAML parameter file](grid_map_demo
lower_threshold: -0.08 # optional, default: -inf
upper_threshold: 0.08 # optional, default: inf
-* **`region`** ([visualization_msgs/Marker])
+* **`region`** ([visualization_msgs/msg/Marker])
Shows the boundary of the grid map.
@@ -516,13 +542,13 @@ Please report bugs and request features using the [Issue Tracker](https://github
[OctoMap]: https://octomap.github.io/
[PCL]: http://pointclouds.org/
[costmap_2d]: http://wiki.ros.org/costmap_2d
-[grid_map_msgs/GridMapInfo]: http://docs.ros.org/api/grid_map_msgs/html/msg/GridMapInfo.html
-[grid_map_msgs/GridMap]: http://docs.ros.org/api/grid_map_msgs/html/msg/GridMap.html
-[grid_map_msgs/GetGridMap]: http://docs.ros.org/api/grid_map_msgs/html/srv/GetGridMap.html
-[sensor_msgs/PointCloud2]: http://docs.ros.org/api/sensor_msgs/html/msg/PointCloud2.html
-[visualization_msgs/Marker]: http://docs.ros.org/api/visualization_msgs/html/msg/Marker.html
-[geometry_msgs/PolygonStamped]: http://docs.ros.org/api/geometry_msgs/html/msg/PolygonStamped.html
-[nav_msgs/OccupancyGrid]: http://docs.ros.org/api/nav_msgs/html/msg/OccupancyGrid.html
-[nav_msgs/GridCells]: http://docs.ros.org/api/nav_msgs/html/msg/GridCells.html
+[grid_map_msgs/msg/GridMapInfo]: http://docs.ros.org/api/grid_map_msgs/msg/html/msg/GridMapInfo.html
+[grid_map_msgs/msg/GridMap]: http://docs.ros.org/api/grid_map_msgs/msg/html/msg/GridMap.html
+[grid_map_msgs/msg/GetGridMap]: http://docs.ros.org/api/grid_map_msgs/msg/html/srv/GetGridMap.html
+[sensor_msgs/msg/PointCloud2]: http://docs.ros.org/api/sensor_msgs/msg/html/msg/PointCloud2.html
+[visualization_msgs/msg/Marker]: http://docs.ros.org/api/visualization_msgs/msg/html/msg/Marker.html
+[geometry_msgs/msg/PolygonStamped]: http://docs.ros.org/api/geometry_msgs/msg/html/msg/PolygonStamped.html
+[nav_msgs/msg/OccupancyGrid]: http://docs.ros.org/api/nav_msgs/msg/html/msg/OccupancyGrid.html
+[nav_msgs/msg/GridCells]: http://docs.ros.org/api/nav_msgs/msg/html/msg/GridCells.html
[ROS Filters]: http://wiki.ros.org/filters
[EigenLab]: https://github.com/leggedrobotics/EigenLab
diff --git a/grid_map/CHANGELOG.rst b/grid_map/CHANGELOG.rst
index bf72135e9..7f6b78143 100644
--- a/grid_map/CHANGELOG.rst
+++ b/grid_map/CHANGELOG.rst
@@ -2,6 +2,31 @@
Changelog for package grid_map
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2.2.2 (2025-09-23)
+------------------
+
+2.2.1 (2025-01-18)
+------------------
+
+2.2.0 (2024-07-23)
+------------------
+* Merge pull request `#443 `_ from Ryanf55/update-maintainers
+ Add Ryan as maintainer, remove Steve
+* Add Ryan as maintainer, remove Steve
+* Merge pull request `#420 `_ from Ryanf55/enfore-cpp17
+ Enfore C++17
+* Enfore C++17
+* Contributors: Ryan, Ryan Friedman
+
+2.1.0 (2022-11-08)
+------------------
+
+2.0.0 (2022-09-13)
+------------------
+* fix: build error on jammy
+* Initial ROS2 port
+* Contributors: Maximilian Wulf, Steve Macenski
+
1.6.2 (2019-10-14)
------------------
diff --git a/grid_map/CMakeLists.txt b/grid_map/CMakeLists.txt
index 6d04c2c75..c6f567667 100644
--- a/grid_map/CMakeLists.txt
+++ b/grid_map/CMakeLists.txt
@@ -1,4 +1,9 @@
-cmake_minimum_required(VERSION 2.8.3)
+cmake_minimum_required(VERSION 3.5)
project(grid_map)
-find_package(catkin REQUIRED)
-catkin_metapackage()
+
+if(NOT CMAKE_CXX_STANDARD)
+ set(CMAKE_CXX_STANDARD 17)
+endif()
+
+find_package(ament_cmake REQUIRED)
+ament_package()
diff --git a/grid_map/package.xml b/grid_map/package.xml
index a150c1d10..11c5db340 100644
--- a/grid_map/package.xml
+++ b/grid_map/package.xml
@@ -1,25 +1,32 @@
-
+
+
grid_map
- 1.6.2
+ 2.2.2
Meta-package for the universal grid map library.
Maximilian Wulf
Yoshua Nava
+ Ryan Friedman
BSD
http://github.com/anybotics/grid_map
http://github.com/anybotics/grid_map/issues
Péter Fankhauser
- catkin
+ ament_cmake
+ grid_map_cmake_helpers
grid_map_core
- grid_map_ros
+ grid_map_costmap_2d
grid_map_cv
- grid_map_msgs
+ grid_map_demos
grid_map_filters
- grid_map_visualization
- grid_map_rviz_plugin
grid_map_loader
- grid_map_demos
+ grid_map_msgs
+ grid_map_octomap
+ grid_map_pcl
+ grid_map_ros
+ grid_map_rviz_plugin
+ grid_map_sdf
+ grid_map_visualization
-
+ ament_cmake
diff --git a/grid_map_cmake_helpers/CHANGELOG.rst b/grid_map_cmake_helpers/CHANGELOG.rst
new file mode 100644
index 000000000..878f51c64
--- /dev/null
+++ b/grid_map_cmake_helpers/CHANGELOG.rst
@@ -0,0 +1,93 @@
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Changelog for package grid_map_cmake_helpers
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+2.2.2 (2025-09-23)
+------------------
+
+2.2.1 (2025-01-18)
+------------------
+
+2.2.0 (2024-07-23)
+------------------
+* Merge pull request `#443 `_ from Ryanf55/update-maintainers
+ Add Ryan as maintainer, remove Steve
+* Add Ryan as maintainer, remove Steve
+* Merge pull request `#419 `_ from Ryanf55/stop-using-CMAKE_COMPILER_IS_GNUCXX
+ Stop using deprecated CMAKE_COMPILER_IS_GNUCXX
+* Merge pull request `#420 `_ from Ryanf55/enfore-cpp17
+ Enfore C++17
+* Enfore C++17
+* Stop using deprecated CMAKE_COMPILER_IS_GNUCXX
+ * Switch to CMAKE_CXX_COMPILER_ID
+ * https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_ID.html
+* Contributors: Ryan, Ryan Friedman
+
+2.1.0 (2022-11-08)
+------------------
+
+2.0.0 (2022-09-13)
+------------------
+* Initial ROS2 port
+* Contributors: Steve Macenski
+
+* Update for rolliing (`#296 `_)
+ Co-authored-by: Francisco Martin Rico
+* Initial ROS2 port
+* added grid_map_cmake_helpers maintainers
+* changed grid_map_common to grid_map_cmake_helpers
+* Contributors: Daisuke Nishimatsu, Marwan Taher, Steve Macenski
+
+1.6.2 (2019-10-24)
+------------------
+
+1.6.1 (2019-02-27)
+------------------
+
+1.6.0 (2017-11-24)
+------------------
+
+1.5.2 (2017-07-25 19:54)
+------------------------
+
+1.5.1 (2017-07-25 11:25)
+------------------------
+
+1.5.0 (2017-07-18)
+------------------
+
+1.4.2 (2017-01-24)
+------------------
+
+1.4.1 (2016-10-23)
+------------------
+
+1.4.0 (2016-08-22)
+------------------
+
+1.3.3 (2016-05-10 20:35)
+------------------------
+
+1.3.1 (2016-05-10 16:41)
+------------------------
+
+1.3.0 (2016-04-26)
+------------------
+
+1.2.0 (2016-03-03)
+------------------
+
+1.1.3 (2016-01-11 17:55:26 +0100)
+---------------------------------
+
+1.1.2 (2016-01-11 16:38)
+------------------------
+
+1.1.1 (2016-01-11 13:51)
+------------------------
+
+1.1.0 (2016-01-08)
+------------------
+
+1.0.0 (2015-11-20)
+------------------
diff --git a/grid_map_cmake_helpers/CMakeLists.txt b/grid_map_cmake_helpers/CMakeLists.txt
new file mode 100644
index 000000000..adbc3a8bc
--- /dev/null
+++ b/grid_map_cmake_helpers/CMakeLists.txt
@@ -0,0 +1,14 @@
+cmake_minimum_required(VERSION 3.5)
+
+project(grid_map_cmake_helpers NONE)
+
+find_package(ament_cmake_core REQUIRED)
+
+ament_package(
+ CONFIG_EXTRAS "grid_map_cmake_helpers-extras.cmake"
+)
+
+install(
+ DIRECTORY cmake
+ DESTINATION share/${PROJECT_NAME}
+)
diff --git a/grid_map_cmake_helpers/cmake/grid_map_package.cmake b/grid_map_cmake_helpers/cmake/grid_map_package.cmake
new file mode 100644
index 000000000..4867a92f4
--- /dev/null
+++ b/grid_map_cmake_helpers/cmake/grid_map_package.cmake
@@ -0,0 +1,40 @@
+# Standard grid_map project setup
+#
+# @public
+#
+macro(grid_map_package)
+ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
+ message(STATUS "Setting build type to Release as none was specified.")
+ set(CMAKE_BUILD_TYPE "Release" CACHE
+ STRING "Choose the type of build." FORCE)
+ # Set the possible values of build type for cmake-gui
+ set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
+ "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
+ endif()
+
+ if(NOT CMAKE_CXX_STANDARD)
+ set(CMAKE_CXX_STANDARD 17)
+ endif()
+
+ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+ add_compile_options(-Wall -Wextra -Wpedantic -Werror -Wdeprecated -fPIC)
+ endif()
+
+ if(COVERAGE_ENABLED)
+ add_compile_options(--coverage)
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --coverage")
+ endif()
+
+ # Defaults for Microsoft C++ compiler
+ if(MSVC)
+ # https://blog.kitware.com/create-dlls-on-windows-without-declspec-using-new-cmake-export-all-feature/
+ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
+
+ # Enable Math Constants
+ # https://docs.microsoft.com/en-us/cpp/c-runtime-library/math-constants?view=vs-2019
+ add_compile_definitions(
+ _USE_MATH_DEFINES
+ )
+ endif()
+endmacro()
diff --git a/grid_map_cmake_helpers/grid_map_cmake_helpers-extras.cmake b/grid_map_cmake_helpers/grid_map_cmake_helpers-extras.cmake
new file mode 100644
index 000000000..b4d2b3af9
--- /dev/null
+++ b/grid_map_cmake_helpers/grid_map_cmake_helpers-extras.cmake
@@ -0,0 +1,3 @@
+set(AMENT_BUILD_CONFIGURATION_KEYWORD_SEPARATOR ":")
+
+include("${grid_map_cmake_helpers_DIR}/grid_map_package.cmake")
diff --git a/grid_map_cmake_helpers/package.xml b/grid_map_cmake_helpers/package.xml
new file mode 100644
index 000000000..4217c8bf6
--- /dev/null
+++ b/grid_map_cmake_helpers/package.xml
@@ -0,0 +1,19 @@
+
+
+
+ grid_map_cmake_helpers
+ 2.2.2
+ CMake support functionality used throughout grid_map
+ Maximilian Wulf
+ Yoshua Nava
+ Ryan Friedman
+ BSD
+
+ ament_cmake_core
+
+ ament_cmake_core
+
+
+ ament_cmake
+
+
diff --git a/grid_map_core/CHANGELOG.rst b/grid_map_core/CHANGELOG.rst
index 413502356..1546c3b6a 100644
--- a/grid_map_core/CHANGELOG.rst
+++ b/grid_map_core/CHANGELOG.rst
@@ -2,6 +2,39 @@
Changelog for package grid_map_core
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+2.2.2 (2025-09-23)
+------------------
+
+2.2.1 (2025-01-18)
+------------------
+* Fix UB in SpiralIterator::operator++ (`#481 `_) (`#487 `_)
+ * Calling pop_back on an iterator past the end is UB
+ (cherry picked from commit 74dbbc83ad695c09bc60dcc856aa8a75741311a9)
+ Co-authored-by: Ryan <25047695+Ryanf55@users.noreply.github.com>
+* Contributors: mergify[bot]
+
+2.2.0 (2024-07-23)
+------------------
+* Merge pull request `#458 `_ from ANYbotics/ci-temp-skip-octomap-server
+ build: treat several build issues on rolling
+* suppress warning due to gcc13 bug
+* Merge pull request `#443 `_ from Ryanf55/update-maintainers
+ Add Ryan as maintainer, remove Steve
+* Add Ryan as maintainer, remove Steve
+* Merge pull request `#404 `_ from Ryanf55/bugfix-403-cmake
+ grid_map_core: Use ament_export_targets and improve eigen linkage
+* Update ament to latest recommendations
+ * Fixes include errors in grid_map_geo ros2 port
+* Contributors: Ryan, Ryan Friedman, wep21
+
+2.1.0 (2022-11-08)
+------------------
+
+2.0.0 (2022-09-13)
+------------------
+* Initial ROS2 port
+* Contributors: Maximilian Wulf, Steve Macenski
+
1.6.2 (2019-10-14)
------------------
* Implements a grid map transformation from one map frame to another map frame given the transform between the frames.
diff --git a/grid_map_core/CMakeLists.txt b/grid_map_core/CMakeLists.txt
index be6148752..cbf8ff5da 100644
--- a/grid_map_core/CMakeLists.txt
+++ b/grid_map_core/CMakeLists.txt
@@ -1,79 +1,49 @@
-cmake_minimum_required(VERSION 2.8.3)
+cmake_minimum_required(VERSION 3.5)
project(grid_map_core)
-set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
+## Find ament_cmake macros and libraries
+find_package(ament_cmake REQUIRED)
+find_package(grid_map_cmake_helpers REQUIRED)
-## Find catkin macros and libraries
-find_package(catkin REQUIRED COMPONENTS)
-
-## Define Eigen addons.
+## Define Eigen addons.
include(cmake/${PROJECT_NAME}-extras.cmake)
## System dependencies are found with CMake's conventions
-#find_package(Eigen3 REQUIRED)
-# Solution to find Eigen3 with Saucy.
-find_package(Eigen3 QUIET)
-if(NOT EIGEN3_FOUND)
- find_package(PkgConfig REQUIRED)
- pkg_check_modules(EIGEN3 REQUIRED eigen3)
- set(EIGEN3_INCLUDE_DIR ${EIGEN3_INCLUDE_DIRS})
-endif()
+find_package(Eigen3 REQUIRED)
-###################################
-## catkin specific configuration ##
-###################################
-## The catkin_package macro generates cmake config files for your package
-## Declare things to be passed to dependent projects
-## INCLUDE_DIRS: uncomment this if you package contains header files
-## LIBRARIES: libraries you create in this project that dependent projects also need
-## CATKIN_DEPENDS: catkin_packages dependent projects also need
-## DEPENDS: system dependencies of this project that dependent projects also need
-catkin_package(
- INCLUDE_DIRS
- include
- ${EIGEN3_INCLUDE_DIR}
- LIBRARIES
- ${PROJECT_NAME}
- CATKIN_DEPENDS
- DEPENDS
- #Eigen3
- CFG_EXTRAS
- ${PROJECT_NAME}-extras.cmake
-)
+grid_map_package()
###########
## Build ##
###########
-## Specify additional locations of header files
-include_directories(
- include
- ${catkin_INCLUDE_DIRS}
- ${EIGEN3_INCLUDE_DIR}
-)
-
## Declare a cpp library
add_library(${PROJECT_NAME}
- src/GridMap.cpp
- src/GridMapMath.cpp
- src/SubmapGeometry.cpp
- src/BufferRegion.cpp
- src/Polygon.cpp
- src/CubicInterpolation.cpp
- src/iterators/GridMapIterator.cpp
- src/iterators/SubmapIterator.cpp
- src/iterators/CircleIterator.cpp
- src/iterators/EllipseIterator.cpp
- src/iterators/SpiralIterator.cpp
- src/iterators/PolygonIterator.cpp
- src/iterators/LineIterator.cpp
- src/iterators/SlidingWindowIterator.cpp
+ src/GridMap.cpp
+ src/GridMapMath.cpp
+ src/SubmapGeometry.cpp
+ src/BufferRegion.cpp
+ src/Polygon.cpp
+ src/CubicInterpolation.cpp
+ src/iterators/GridMapIterator.cpp
+ src/iterators/SubmapIterator.cpp
+ src/iterators/CircleIterator.cpp
+ src/iterators/EllipseIterator.cpp
+ src/iterators/SpiralIterator.cpp
+ src/iterators/PolygonIterator.cpp
+ src/iterators/LineIterator.cpp
+ src/iterators/SlidingWindowIterator.cpp
)
-target_link_libraries(${PROJECT_NAME}
- ${catkin_LIBRARIES}
+## Specify additional locations of header files
+target_include_directories(${PROJECT_NAME}
+ PUBLIC
+ "$"
+ "$"
)
+target_link_libraries(${PROJECT_NAME} PUBLIC Eigen3::Eigen)
+
#############
## Install ##
#############
@@ -81,50 +51,82 @@ target_link_libraries(${PROJECT_NAME}
# Mark executables and/or libraries for installation
install(
TARGETS ${PROJECT_NAME}
- ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
- LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
- RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
+ EXPORT export_${PROJECT_NAME}
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+ RUNTIME DESTINATION lib/${PROJECT_NAME}
)
# Mark cpp header files for installation
install(
- DIRECTORY include/${PROJECT_NAME}/
- DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
+ DIRECTORY include/
+ DESTINATION include/${PROJECT_NAME}
FILES_MATCHING PATTERN "*.hpp"
)
# Mark other files for installation
install(
DIRECTORY doc
- DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
+ DESTINATION share/${PROJECT_NAME}
)
#############
## Testing ##
#############
-if(CATKIN_ENABLE_TESTING)
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
-## Add gtest based cpp test target and link libraries
-catkin_add_gtest(${PROJECT_NAME}-test
- test/test_grid_map_core.cpp
- test/test_helpers.cpp
- test/CubicConvolutionInterpolationTest.cpp
- test/CubicInterpolationTest.cpp
- test/GridMapMathTest.cpp
- test/GridMapTest.cpp
- test/GridMapIteratorTest.cpp
- test/LineIteratorTest.cpp
- test/EllipseIteratorTest.cpp
- test/SubmapIteratorTest.cpp
- test/PolygonIteratorTest.cpp
- test/PolygonTest.cpp
- test/EigenPluginsTest.cpp
- test/SpiralIteratorTest.cpp
- test/SlidingWindowIteratorTest.cpp
+if(BUILD_TESTING)
+ # Linting is setup this way to add a filter
+ # to ament_cpplint to ignore the lack of
+ # copyright messages at the top of files.
+ # Copyright messages are being checked for by both
+ # ament_cmake_cpplint & ament_cmake_copyright.
+
+ find_package(ament_lint_auto REQUIRED)
+ find_package(ament_lint_auto QUIET)
+ if(ament_lint_auto_FOUND)
+ # exclude copyright checks
+ list(APPEND AMENT_LINT_AUTO_EXCLUDE
+ ament_cmake_cpplint
+ ament_cmake_copyright
+ )
+ ament_lint_auto_find_test_dependencies()
+
+ # run cpplint without copyright filter
+ find_package(ament_cmake_cpplint)
+ ament_cpplint(
+ FILTERS -legal/copyright -build/include_order
+ )
+ endif()
+ ament_lint_auto_find_test_dependencies()
+
+ find_package(ament_cmake_gtest REQUIRED)
+
+ ## Add gtest based cpp test target and link libraries
+ ament_add_gtest(${PROJECT_NAME}-test
+ test/test_grid_map_core.cpp
+ test/test_helpers.cpp
+ test/CubicConvolutionInterpolationTest.cpp
+ test/CubicInterpolationTest.cpp
+ test/GridMapMathTest.cpp
+ test/GridMapTest.cpp
+ test/GridMapIteratorTest.cpp
+ test/LineIteratorTest.cpp
+ test/EllipseIteratorTest.cpp
+ test/SubmapIteratorTest.cpp
+ test/PolygonIteratorTest.cpp
+ test/PolygonTest.cpp
+ test/EigenPluginsTest.cpp
+ test/SpiralIteratorTest.cpp
+ test/SlidingWindowIteratorTest.cpp
)
endif()
if(TARGET ${PROJECT_NAME}-test)
target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
endif()
+
+ament_export_targets(export_${PROJECT_NAME} HAS_LIBRARY_TARGET)
+ament_export_dependencies(Eigen3)
+ament_package(CONFIG_EXTRAS
+ cmake/${PROJECT_NAME}-extras.cmake
+)
diff --git a/grid_map_core/cmake/grid_map_core-extras.cmake b/grid_map_core/cmake/grid_map_core-extras.cmake
index e63eae443..dd4089d4e 100644
--- a/grid_map_core/cmake/grid_map_core-extras.cmake
+++ b/grid_map_core/cmake/grid_map_core-extras.cmake
@@ -1,17 +1,17 @@
set(EIGEN_FUNCTORS_PLUGIN_PATH "grid_map_core/eigen_plugins/FunctorsPlugin.hpp")
-if (EIGEN_FUNCTORS_PLUGIN)
- if (NOT EIGEN_FUNCTORS_PLUGIN STREQUAL EIGEN_FUNCTORS_PLUGIN_PATH)
- MESSAGE(FATAL_ERROR "EIGEN_FUNCTORS_PLUGIN already defined!")
- endif ()
-else (EIGEN_FUNCTORS_PLUGIN)
+if(EIGEN_FUNCTORS_PLUGIN)
+ if(NOT EIGEN_FUNCTORS_PLUGIN STREQUAL EIGEN_FUNCTORS_PLUGIN_PATH)
+ message(FATAL_ERROR "EIGEN_FUNCTORS_PLUGIN already defined")
+ endif()
+else()
add_definitions(-DEIGEN_FUNCTORS_PLUGIN=\"${EIGEN_FUNCTORS_PLUGIN_PATH}\")
-endif (EIGEN_FUNCTORS_PLUGIN)
+endif()
set(EIGEN_DENSEBASE_PLUGIN_PATH "grid_map_core/eigen_plugins/DenseBasePlugin.hpp")
-if (EIGEN_DENSEBASE_PLUGIN)
- if (NOT EIGEN_DENSEBASE_PLUGIN STREQUAL EIGEN_DENSEBASE_PLUGIN_PATH)
- MESSAGE(FATAL_ERROR "EIGEN_DENSEBASE_PLUGIN already defined!")
- endif ()
-else (EIGEN_DENSEBASE_PLUGIN)
+if(EIGEN_DENSEBASE_PLUGIN)
+ if(NOT EIGEN_DENSEBASE_PLUGIN STREQUAL EIGEN_DENSEBASE_PLUGIN_PATH)
+ message(FATAL_ERROR "EIGEN_DENSEBASE_PLUGIN already defined!")
+ endif()
+else()
add_definitions(-DEIGEN_DENSEBASE_PLUGIN=\"${EIGEN_DENSEBASE_PLUGIN_PATH}\")
-endif (EIGEN_DENSEBASE_PLUGIN)
\ No newline at end of file
+endif()
\ No newline at end of file
diff --git a/grid_map_core/include/grid_map_core/BufferRegion.hpp b/grid_map_core/include/grid_map_core/BufferRegion.hpp
index bbe95c776..fbe2d205d 100644
--- a/grid_map_core/include/grid_map_core/BufferRegion.hpp
+++ b/grid_map_core/include/grid_map_core/BufferRegion.hpp
@@ -6,11 +6,13 @@
* Institute: ETH Zurich, ANYbotics
*/
-#pragma once
+#ifndef GRID_MAP_CORE__BUFFERREGION_HPP_
+#define GRID_MAP_CORE__BUFFERREGION_HPP_
#include "grid_map_core/TypeDefs.hpp"
-namespace grid_map {
+namespace grid_map
+{
/*!
* This class holds information about a rectangular region
@@ -18,8 +20,7 @@ namespace grid_map {
*/
class BufferRegion
{
- public:
-
+public:
/*!
* The definition of the buffer region positions.
*/
@@ -35,18 +36,19 @@ class BufferRegion
constexpr static unsigned int nQuadrants = 4;
BufferRegion();
- BufferRegion(const Index& startIndex, const Size& size, const BufferRegion::Quadrant& quadrant);
- virtual ~BufferRegion();
+ BufferRegion(
+ const Index & startIndex, const Size & size,
+ const BufferRegion::Quadrant & quadrant);
+ virtual ~BufferRegion() = default;
- const Index& getStartIndex() const;
- void setStartIndex(const Index& startIndex);
- const Size& getSize() const;
- void setSize(const Size& size);
+ const Index & getStartIndex() const;
+ void setStartIndex(const Index & startIndex);
+ const Size & getSize() const;
+ void setSize(const Size & size);
BufferRegion::Quadrant getQuadrant() const;
void setQuadrant(BufferRegion::Quadrant type);
- private:
-
+private:
//! Start index (typically top-left) of the buffer region.
Index staretIndex_;
@@ -56,8 +58,9 @@ class BufferRegion
//! Quadrant type of the buffer region.
Quadrant quadrant_;
- public:
+public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
};
-} /* namespace grid_map */
+} // namespace grid_map
+#endif // GRID_MAP_CORE__BUFFERREGION_HPP_
diff --git a/grid_map_core/include/grid_map_core/CubicInterpolation.hpp b/grid_map_core/include/grid_map_core/CubicInterpolation.hpp
index 7d6c6e6ec..26f9b7fb5 100644
--- a/grid_map_core/include/grid_map_core/CubicInterpolation.hpp
+++ b/grid_map_core/include/grid_map_core/CubicInterpolation.hpp
@@ -6,11 +6,14 @@
* Institute: ETH Zurich, Robotic Systems Lab
*/
-#pragma once
+
+#ifndef GRID_MAP_CORE__CUBICINTERPOLATION_HPP_
+#define GRID_MAP_CORE__CUBICINTERPOLATION_HPP_
#include
#include
#include