Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nacho/remove ros 1 support #280

Merged
merged 8 commits into from
Feb 29, 2024
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: 1 addition & 21 deletions .github/workflows/ros.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,11 @@ on:
branches: ["main"]

jobs:
ros1_node:
runs-on: ubuntu-latest
strategy:
matrix:
release: [noetic]
container: osrf/ros:${{ matrix.release }}-desktop-full
steps:
- name: Setup cmake
uses: jwlawson/[email protected]
with:
cmake-version: "3.25.x"
- name: Prepare catkin_ws
run: mkdir -p catkin_ws/src
- uses: actions/checkout@v3
with:
path: catkin_ws/src
- name: Run catkin_make
run: source /opt/ros/${{ matrix.release }}/setup.bash && cd catkin_ws && catkin_make
shell: bash

ros2_node:
runs-on: ubuntu-latest
strategy:
matrix:
release: [humble, iron]
release: [humble, iron, rolling]
container: osrf/ros:${{ matrix.release }}-desktop
steps:
- name: Setup cmake
Expand Down
19 changes: 8 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@
<span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
<a href="https://github.com/PRBonn/kiss-icp/blob/main/README.md#Install">Install</a>
<span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
<a href="https://github.com/PRBonn/kiss-icp/blob/main/ros">ROS 1</a>
<span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
<a href="https://github.com/PRBonn/kiss-icp/blob/main/ros">ROS 2</a>
<span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
<a href=https://user-images.githubusercontent.com/21349875/214578180-b1d2431c-8fff-440e-aa6e-99a1d85989b5.mp4
>ROS Demo</a>
<span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
<a href=https://www.ipb.uni-bonn.de/wp-content/papercite-data/pdf/vizzo2023ral.pdf>Paper</a>
<span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
Expand Down Expand Up @@ -49,9 +44,10 @@ kiss_icp_pipeline --help
<summary>This should print the following help message:</summary>

![out](https://user-images.githubusercontent.com/21349875/193282970-25a400aa-ebcd-487a-b839-faa04eeca5b9.png)

</details>

For advanced instructions on the Python pacakge plase see [this README](python/README.md)
For advanced instructions on the Python package please see [this README](python/README.md)

## ROS support

Expand All @@ -61,17 +57,18 @@ For advanced instructions on the Python pacakge plase see [this README](python/R
```sh
cd ~/ros2_ws/src/ && git clone https://github.com/PRBonn/kiss-icp && cd ~/ros2_ws/ && colcon build --packages-select kiss_icp
```
For more detailed instructions on the ROS wrapper, please visit this [README](ros/README.md)

</details>

<details>
<summary>ROS 1</summary>

```sh
cd ~/catkin_ws/ && git clone https://github.com/PRBonn/kiss-icp && catkin build
```
</details>
⚠️ ⚠️ **ROS 1 is deprecated in KISS-ICP and is not officially supported anymore. Upgrade now to ROS 2!** ⚠️ ⚠️

For more detailed instructions on the ROS wrappers, please visit this [README](ros/README.md)
The last release that supports ROS 1 is [v0.3.0](https://github.com/PRBonn/kiss-icp/tree/v0.3.0), if you still need ROS 1 support please check that version.

</details>


## Citation
Expand Down
2 changes: 1 addition & 1 deletion cpp/kiss_icp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
cmake_minimum_required(VERSION 3.16...3.26)
project(kiss_icp_cpp VERSION 0.3.0 LANGUAGES CXX)
project(kiss_icp_cpp VERSION 0.4.0 LANGUAGES CXX)

# Setup build options
option(USE_CCACHE "Build using Ccache if found on the path" ON)
Expand Down
2 changes: 1 addition & 1 deletion python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
cmake_minimum_required(VERSION 3.16...3.26)
project(kiss_icp_pybind VERSION 0.3.0 LANGUAGES CXX)
project(kiss_icp_pybind VERSION 0.4.0 LANGUAGES CXX)

# Set build type
set(CMAKE_BUILD_TYPE Release)
Expand Down
2 changes: 0 additions & 2 deletions python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
<span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
<a href="https://github.com/PRBonn/kiss-icp/edit/main/README.md#install">Install</a>
<span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
<a href="https://github.com/PRBonn/kiss-icp/blob/main/ros">ROS 1</a>
<span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
<a href="https://github.com/PRBonn/kiss-icp/blob/main/ros">ROS 2</a>
<span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
<a href=https://user-images.githubusercontent.com/21349875/214578180-b1d2431c-8fff-440e-aa6e-99a1d85989b5.mp4
Expand Down
2 changes: 1 addition & 1 deletion python/kiss_icp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
__version__ = "0.3.0"
__version__ = "0.4.0"
2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "scikit_build_core.build"

[project]
name = "kiss-icp"
version = "0.3.0"
version = "0.4.0"
description = "Simple yet effective 3D LiDAR-Odometry registration pipeline"
readme = "README.md"
authors = [
Expand Down
81 changes: 26 additions & 55 deletions ros/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
cmake_minimum_required(VERSION 3.16...3.26)
project(kiss_icp VERSION 0.3.0 LANGUAGES CXX)
project(kiss_icp VERSION 0.4.0 LANGUAGES CXX)

set(ignore ${CATKIN_INSTALL_INTO_PREFIX_ROOT})
set(CMAKE_BUILD_TYPE Release)
Expand All @@ -40,61 +40,32 @@ else()
FetchContent_MakeAvailable(ext_kiss_icp_core)
endif()

if("$ENV{ROS_VERSION}" STREQUAL "1")
message(STATUS "KISS-ICP ROS 1 wrapper will be compiled")
find_package(
catkin REQUIRED
COMPONENTS geometry_msgs
nav_msgs
sensor_msgs
geometry_msgs
roscpp
rosbag
std_msgs
tf2
tf2_ros)
catkin_package()
find_package(ament_cmake REQUIRED)
find_package(nav_msgs REQUIRED)
find_package(rcutils REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclcpp_components REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(tf2_ros REQUIRED)

# ROS 1 node
add_executable(odometry_node ros1/OdometryServer.cpp)
target_compile_features(odometry_node PUBLIC cxx_std_20)
target_include_directories(odometry_node PUBLIC include ${catkin_INCLUDE_DIRS})
target_link_libraries(odometry_node kiss_icp::pipeline ${catkin_LIBRARIES})
install(TARGETS odometry_node RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})
install(DIRECTORY launch DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
elseif("$ENV{ROS_VERSION}" STREQUAL "2")
message(STATUS "KISS-ICP ROS 2 wrapper will be compiled")
# ROS 2 node
add_library(odometry_component SHARED src/OdometryServer.cpp)
target_compile_features(odometry_component PUBLIC cxx_std_20)
target_include_directories(odometry_component PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_link_libraries(odometry_component kiss_icp::pipeline)
ament_target_dependencies(
odometry_component
rcutils
rclcpp
rclcpp_components
nav_msgs
sensor_msgs
geometry_msgs
tf2_ros)

find_package(ament_cmake REQUIRED)
find_package(nav_msgs REQUIRED)
find_package(rcutils REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclcpp_components REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(tf2_ros REQUIRED)
rclcpp_components_register_node(odometry_component PLUGIN "kiss_icp_ros::OdometryServer" EXECUTABLE odometry_node)

# ROS 2 node
add_library(odometry_component SHARED ros2/OdometryServer.cpp)
target_compile_features(odometry_component PUBLIC cxx_std_20)
target_include_directories(odometry_component PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_link_libraries(odometry_component kiss_icp::pipeline)
ament_target_dependencies(
odometry_component
rcutils
rclcpp
rclcpp_components
nav_msgs
sensor_msgs
geometry_msgs
tf2_ros)
install(TARGETS odometry_component LIBRARY DESTINATION lib RUNTIME DESTINATION lib/${PROJECT_NAME})
install(DIRECTORY launch rviz DESTINATION share/${PROJECT_NAME}/)

rclcpp_components_register_node(odometry_component PLUGIN "kiss_icp_ros::OdometryServer" EXECUTABLE odometry_node)

install(TARGETS odometry_component LIBRARY DESTINATION lib RUNTIME DESTINATION lib/${PROJECT_NAME})
install(DIRECTORY launch rviz DESTINATION share/${PROJECT_NAME}/)

ament_package()

else()
message(FATAL_ERROR "catkin or colcon not found KISS-ICP-ROS disabled")
endif()
ament_package()
44 changes: 2 additions & 42 deletions ros/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
# KISS-ICP ROS wrappers

This node is just an application example on how to use the KISS-ICP C++ API. It's still considered
work in progress and we are very happy to receive any contribution from the comunity 👼

https://user-images.githubusercontent.com/21349875/214578180-b1d2431c-8fff-440e-aa6e-99a1d85989b5.mp4

## ROS 2
# KISS-ICP ROS 2 Wrapper

### How to build

Expand Down Expand Up @@ -37,43 +30,10 @@ and then,
ros2 bag play <path>*.bag
```

## ROS 1

### How to build

You should not need any extra dependency, just clone and build:

```sh
cd ~/catkin_ws/
git clone https://github.com/PRBonn/kiss-icp
catkin build
source devel/setup.bash
```

### How to run

The only required argument to provide is the **topic name** so KISS-ICP knows which PointCloud2 to proces:

```sh
roslaunch kiss_icp odometry.launch bagfile:=<path_to_rosbag> topic:=<topic_name>
```

You can optionally launch the node with any bagfile, and play the bagfiles on a different shell:

```sh
roslaunch kiss_icp odometry.launch topic:=<topic_name>
```

and then,

```sh
rosbag play <path>*.bag
```

## Out of source builds

Good news! If you don't have git or you don't need to change the core KISS-ICP library, you can just
copy paste this folder into your ROS1/ROS2 workspace and build as usual. The build system will fetch
copy paste this folder into your ROS2 workspace and build as usual. The build system will fetch
the latest stable release for you.

## Looking how to run KITTI on ROS along with KISS-ICP?
Expand Down
45 changes: 0 additions & 45 deletions ros/launch/odometry.launch

This file was deleted.

2 changes: 1 addition & 1 deletion ros/launch/odometry.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def generate_launch_description():
package="rviz2",
executable="rviz2",
output={"both": "log"},
arguments=["-d", PathJoinSubstitution([current_pkg, "rviz", "kiss_icp_ros2.rviz"])],
arguments=["-d", PathJoinSubstitution([current_pkg, "rviz", "kiss_icp.rviz"])],
condition=IfCondition(LaunchConfiguration("visualize")),
),
ExecuteProcess(
Expand Down
27 changes: 9 additions & 18 deletions ros/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,35 +25,26 @@
-->
<package format="3">
<name>kiss_icp</name>
<version>0.3.0</version>
<description>KISS-ICP ROS Wrappers</description>
<version>0.4.0</version>
<description>KISS-ICP ROS 2 Wrapper</description>
<maintainer email="[email protected]">ivizzo</maintainer>
<license>MIT</license>

<!-- Common ROS 1 / ROS 2 dependencies -->
<build_depend>ros_environment</build_depend>
<buildtool_depend>ament_cmake</buildtool_depend>

<!-- ROS 1 dependencies -->
<buildtool_depend condition="$ROS_VERSION == 1">catkin</buildtool_depend>
<depend condition="$ROS_VERSION == 1">roscpp</depend>

<!-- ROS 2 dependencies -->
<buildtool_depend condition="$ROS_VERSION == 2">ament_cmake</buildtool_depend>
<depend condition="$ROS_VERSION == 2">rcutils</depend>
<depend condition="$ROS_VERSION == 2">rclcpp</depend>
<depend condition="$ROS_VERSION == 2">rclcpp_components</depend>
<exec_depend condition="$ROS_VERSION == 2">ros2launch</exec_depend>

<!-- ROS1/2 dependencies -->
<depend>rcutils</depend>
<depend>rclcpp</depend>
<depend>rclcpp_components</depend>
<depend>geometry_msgs</depend>
<depend>nav_msgs</depend>
<depend>std_msgs</depend>
<depend>sensor_msgs</depend>
<depend>tf2</depend>
<depend>tf2_ros</depend>

<exec_depend>ros2launch</exec_depend>

<export>
<build_type condition="$ROS_VERSION == 1">catkin</build_type>
<build_type condition="$ROS_VERSION == 2">ament_cmake</build_type>
<build_type>ament_cmake</build_type>
</export>
</package>
Loading
Loading