Skip to content

Commit

Permalink
use find_package to get Boost dependency
Browse files Browse the repository at this point in the history
clean up eigen

export eigen as dependency

laser_geometry should export Eigen3 include dirs

fix includes for case and type

Add visibility header modified from rclcpp

Make it compile, remove PointCloud support, and remove boost

- Compiles on Windows with VS2015/VS2017
- Compiles on Mac with clang
- Compiles on Linux with gcc
- Removed PointCloud support as this is deprecated and might not be needed in ROS 2
- Remove boost as per ROS 2 development guidelines

Build statically but position independent code

- This is necessary to link against shared libraries on Linux

Add tests (remove superfluous test cases) and linters

- Code now lints with standard ament linters
- Added test cases for LaserScan to PointCloud2
- Removed tests that were commented out + tests for LaserScan to PointCloud

Uncrustify

Use correct time unit

Fix cpplint

Disable second test for now

Test needs a correct lookupTransform
It would be best to make that call mockable, but that's not possible with tf2::BufferCore

Fix Windows warnings

Remove several test cases

- On not so fast machines, tests run into timeouts due to exponential explosion: test setup makes for about 7000 test cases
- Keep edge cases

Remove angle dependency as no longer necessary

Add Copyright

Fix package.xml

Add TODO for PointCloud 1 support

Build dynamically using visibility control

Make build export symbols

Increase tests timeout (needed for Mac)

Relicense visibility control file to BSD

Already relicensed in URDF repo.

Create LICENSE (#33) (#34)

fix eigen dependency name (#36)

fixup package.xml

changelogs

2.0.0

Use eigen3_cmake_module

Signed-off-by: Shane Loretz <[email protected]>

2.1.0

Signed-off-by: Michael Carroll <[email protected]>

Drop CMake extras redundant with eigen3_cmake_module. (#50)

Signed-off-by: Michel Hidalgo <[email protected]>

code style only: wrap after open parenthesis if not in one line (#52)

Signed-off-by: Dirk Thomas <[email protected]>

use target_include_directories

Signed-off-by: Karsten Knese <[email protected]>

use ament_export_targets()

Signed-off-by: Dirk Thomas <[email protected]>

Changelog.

Signed-off-by: Chris Lalancette <[email protected]>

2.2.0

increase test timeout

Signed-off-by: Dirk Thomas <[email protected]>

update maintainers

Signed-off-by: Mabel Zhang <[email protected]>

Use rclcpp::Duration::from_seconds (#72)

Signed-off-by: Ivan Santiago Paunovic <[email protected]>

Changelog.

Signed-off-by: Chris Lalancette <[email protected]>

2.2.1

Export sensor_msgs, tf2, and rclcpp as dependencies

Signed-off-by: Michel Hidalgo <[email protected]>

changelog

Signed-off-by: Mabel Zhang <[email protected]>

2.2.2

Update python code and tests for ros2 (#80)

* Enable projection nose test using ament

* Update python package and tests for ros2

* Remove unneeded python setup file

* Use pytest instead of nose

Nose was outputting xml that xUnit (jenkins plugin) couldn't read.

* Fix pytest warnings

Fix building on running on Windows Debug. (#82)

* Fix building on running on Windows Debug.

In particular, we need to set the python executable properly
when running on Windows Debug.  While we are in here, we also
fix up some dependencies in the package.xml and CMakeLists.txt.
We also have to remove WERROR ON, due to some Python
warnings that are outside of our control.  Finally, we heavily
reduce the number of tests being run here so that the tests
complete in a reasonable amount of time, even on (slow) Windows
debug.

Signed-off-by: Chris Lalancette <[email protected]>

2.3.0

Fix Duration casting issue leading to no undistortion

Signed-off-by: Marco Lampacrescia <[email protected]>

Explicit cast to double to prevent loss of precision

Signed-off-by: Marco Lampacrescia <[email protected]>

Install headers to include/${PROJECT_NAME} (#86)

Signed-off-by: Shane Loretz <[email protected]>

Changelog.

Signed-off-by: Chris Lalancette <[email protected]>

2.4.0

Mirror rolling to ros2

Update Maintainers (#88)

* Add Dharini Dutia to CODEOWNERs file

Signed-off-by: Audrow Nash <[email protected]>

Update laser_geometry to C++17. (#90)

The main reason to do this is so that we can compile laser_geometry
with the clang static analyzer.  As of clang++-14 (what is in
Ubuntu 22.04), the default still seems to be C++14, so we need
to specify C++17 so that new things in the rclcpp headers work
properly.

Further, due to reasons I don't fully understand, I needed to
set CMAKE_CXX_STANDARD_REQUIRED in order for clang to really use
that version.  So set this as well.

Signed-off-by: Chris Lalancette <[email protected]>

Changelog.

Signed-off-by: Michael Carroll <[email protected]>

2.5.0

Changelog

Signed-off-by: Chris Lalancette <[email protected]>

2.6.0

Switch to target_link_libraries. (#92)

This allows us to hide more of the libraries from downstream
consumers.

While we are in here, do slight cleanups so it is more clear
which libraries are depended on.

Signed-off-by: Chris Lalancette <[email protected]>

Changelog.

Signed-off-by: Chris Lalancette <[email protected]>

2.7.0

Changelog.

Signed-off-by: Marco A. Gutierrez <[email protected]>

2.8.0

Added common linters (#96)

Signed-off-by: Alejandro Hernández Cordero <[email protected]>

Changelog.

Signed-off-by: Chris Lalancette <[email protected]>

2.8.1

Stop using python_cmake_module. (#93)

* Stop using python_cmake_module.

We really don't need it anymore, and can just use the
builtin find_package(Python3).

* Add in missing ament_cmake_python dependency.

Signed-off-by: Chris Lalancette <[email protected]>
  • Loading branch information
bfjelds authored and CursedRock17 committed Nov 2, 2024
1 parent d39ce22 commit f8f22aa
Show file tree
Hide file tree
Showing 17 changed files with 1,472 additions and 1,753 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/mirror-rolling-to-ros2.yaml
Original file line number Diff line number Diff line change
@@ -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
71 changes: 71 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,77 @@
Changelog for package laser_geometry
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2.8.1 (2024-10-03)
------------------
* Added common linters (`#96 <https://github.com/ros-perception/laser_geometry/issues/96>`_)
* Contributors: Alejandro Hernández Cordero

2.8.0 (2024-04-26)
------------------

2.7.0 (2023-12-26)
------------------
* Switch to target_link_libraries. (`#92 <https://github.com/ros-perception/laser_geometry/issues/92>`_)
* Contributors: Chris Lalancette

2.6.0 (2023-04-28)
------------------

2.5.0 (2023-02-14)
------------------
* Update laser_geometry to C++17. (`#90 <https://github.com/ros-perception/laser_geometry/issues/90>`_)
* Update Maintainers (`#88 <https://github.com/ros-perception/laser_geometry/issues/88>`_)
* Mirror rolling to ros2
* Contributors: Audrow Nash, Chris Lalancette

2.4.0 (2022-03-01)
------------------
* Install headers to include/${PROJECT_NAME} (`#86 <https://github.com/ros-perception/laser_geometry/issues/86>`_)
* Explicit cast to double to prevent loss of precision
* Fix Duration casting issue leading to no undistortion
* Contributors: Jonathan Binney, Marco Lampacrescia, Shane Loretz

2.3.0 (2022-01-14)
------------------
* Fix building on running on Windows Debug (`#82 <https://github.com/ros-perception/laser_geometry/issues/82>`_)
* Update python code and tests for ros2 (`#80 <https://github.com/ros-perception/laser_geometry/issues/80>`_)
* Contributors: Chris Lalancette, Jonathan Binney

2.2.2 (2021-05-11)
------------------
* Export sensor_msgs, tf2, and rclcpp as dependencies
* Contributors: Mabel Zhang, Michel Hidalgo

2.2.1 (2020-12-08)
------------------
* Use rclcpp::Duration::from_seconds (`#72 <https://github.com/ros-perception/laser_geometry/issues/72>`_)
* update maintainers
* increase test timeout
* Contributors: Dirk Thomas, Ivan Santiago Paunovic, Jonathan Binney, Mabel Zhang

2.2.0 (2020-04-30)
------------------
* use ament_export_targets()
* code style only: wrap after open parenthesis if not in one line (`#52 <https://github.com/ros-perception/laser_geometry/issues/52>`_)
* use target_include_directories
* Drop CMake extras redundant with eigen3_cmake_module. (`#50 <https://github.com/ros-perception/laser_geometry/issues/50>`_)
* Contributors: Dirk Thomas, Jonathan Binney, Karsten Knese, Michel Hidalgo

2.1.0 (2019-09-27)
------------------
* Merge pull request `#46 <https://github.com/ros-perception/laser_geometry/issues/46>`_ from sloretz/eigen3_cmake_module
* Contributors: Jonathan Binney, Shane Loretz

2.0.0 (2018-06-27)
------------------
* Removed the ``angle`` dependency as no longer necessary.
* Updated to build statically but use position independent code.
* Updated to compile, and to remove PointCloud support, and remove boost.
* Added visibility headers modified from ``rclcpp``.
* Updated ``laser_geometry`` to build for ros2 (and on Windows 10).
* Improved use of numpy. (`#14 <https://github.com/ros-perception/laser_geometry/issues/14>`_)
* Contributors: Alessandro Bottero, Andreas Greimel, Brian Fjeldstad, Eric Wieser, Jon Binney, Jonathan Binney, Martin Idel, Mikael Arguedas, Vincent Rabaud, William Woodall

1.6.4 (2015-05-18)
------------------
* Fix segfault when laserscan ranges[] is empty
Expand Down
111 changes: 76 additions & 35 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,91 @@ cmake_minimum_required(VERSION 3.5)

project(laser_geometry)

if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif()

find_package(ament_cmake REQUIRED)
find_package(ament_cmake_python REQUIRED)

find_package(angles REQUIRED)
find_package(rclcpp REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(tf2 REQUIRED)
find_package(ecl_eigen REQUIRED)

# TODO(dhood): enable python support once ported to ROS 2
# catkin_python_setup()

#
#catkin_package(
# INCLUDE_DIRS include
# LIBRARIES laser_geometry
# DEPENDS Boost Eigen
#)
#

include_directories(include
${angles_INCLUDE_DIRS}
${rclcpp_INCLUDE_DIRS}
${sensor_msgs_INCLUDE_DIRS}
${tf2_INCLUDE_DIRS}
${tf2_eigen_INCLUDE_DIRS}
$ENV{BOOST_ROOT}
find_package(eigen3_cmake_module REQUIRED)
find_package(Eigen3 REQUIRED)

ament_python_install_package(laser_geometry PACKAGE_DIR src/laser_geometry)

add_library(laser_geometry SHARED src/laser_geometry.cpp)
target_include_directories(laser_geometry
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include/${PROJECT_NAME}>
${Eigen3_INCLUDE_DIRS}
)
target_link_libraries(laser_geometry PUBLIC
${sensor_msgs_TARGETS}
tf2::tf2
)
if(TARGET Eigen3::Eigen)
target_link_libraries(laser_geometry PUBLIC Eigen3::Eigen)
else()
target_include_directories(laser_geometry PUBLIC ${Eigen3_INCLUDE_DIRS})
endif()

add_library(laser_geometry src/laser_geometry.cpp)
target_link_libraries(laser_geometry
${angles_LIBRARIES}
${rclcpp_LIBRARIES}
${sensor_msgs_LIBRARIES}
${tf2_LIBRARIES}
${tf2_eigen_LIBRARIES}
target_link_libraries(laser_geometry PRIVATE
rclcpp::rclcpp
)

ament_export_include_directories(include)
# Causes the visibility macros to use dllexport rather than dllimport,
# which is appropriate when building the dll but not consuming it.
target_compile_definitions(laser_geometry PRIVATE "LASER_GEOMETRY_BUILDING_LIBRARY")

# Export old-style CMake variables
ament_export_include_directories("include/${PROJECT_NAME}")
ament_export_libraries(laser_geometry)
ament_package()

install(TARGETS laser_geometry
# Export modern CMake targets
ament_export_targets(laser_geometry)

ament_export_dependencies(
Eigen3
sensor_msgs
tf2
)

install(
TARGETS laser_geometry
EXPORT laser_geometry
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)
install(DIRECTORY include/laser_geometry/
DESTINATION include/${PROJECT_NAME}/
FILES_MATCHING PATTERN "*.h")
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
INCLUDES DESTINATION include
)

install(
DIRECTORY include/
DESTINATION include/${PROJECT_NAME}
)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
find_package(ament_cmake_gtest REQUIRED)

ament_add_gtest(projection_test
test/projection_test.cpp
TIMEOUT 240)
if(TARGET projection_test)
target_link_libraries(projection_test laser_geometry rclcpp::rclcpp)
endif()

find_package(ament_cmake_pytest REQUIRED)

ament_add_pytest_test(projection test/projection_test.py
TIMEOUT 120
)
endif()

ament_package()
2 changes: 2 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This file was generated by https://github.com/audrow/update-ros2-repos
* @quarkytale
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Any contribution that you make to this repository will
be under the 3-Clause BSD License, as dictated by that
[license](https://opensource.org/licenses/BSD-3-Clause).
29 changes: 29 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BSD 3-Clause License

Copyright (c) 2008, Willow Garage, Inc.
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 copyright holder 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.
Loading

0 comments on commit f8f22aa

Please sign in to comment.