forked from ethz-asl/grid_map_geo
-
Notifications
You must be signed in to change notification settings - Fork 0
humble macos #1
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
Open
Ryanf55
wants to merge
14
commits into
Ryanf55:port-to-humble
Choose a base branch
from
srmainwaring:wips/wip-humble-macos
base: port-to-humble
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
humble macos #1
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
6eea0ef
Port to humble (#24)
Ryanf55 cdddb2e
Port to ROS 2
Ryanf55 afaeac9
Get launch file running aside from resources
Ryanf55 af1fc2a
ros2: update gdal include path if __APPLE__
srmainwaring 9f84500
ros2: consolidate cmake files and install executable
srmainwaring 9992aff
ros2: update rviz to rviz2 in launch file
srmainwaring caf822b
ros2: add arguments and rename python launch file
srmainwaring 5894c35
macOS: link directory workaround for yaml-cpp on aarch64
srmainwaring 57b4350
ros2: update launch files to use correct param name for tif_color_path
srmainwaring d00e645
ros2: CMakeLists.txt improvements
srmainwaring 8e2042b
ros2: remove target_include_directories for test_tif_loader
srmainwaring f55db93
ros2: add dependency on yaml_cpp_vendor
srmainwaring 8d533d1
ros2: restore namespace to tif_loader node in launch file
srmainwaring 01089c7
ros2: exclude executable from target exports and fix header install d…
srmainwaring File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,105 @@ | ||
cmake_minimum_required(VERSION 3.8) | ||
cmake_minimum_required(VERSION 3.14.4) | ||
project(grid_map_geo) | ||
|
||
if(NOT CMAKE_C_STANDARD) | ||
set(CMAKE_C_STANDARD 99) | ||
endif() | ||
if(NOT CMAKE_CXX_STANDARD) | ||
set(CMAKE_CXX_STANDARD 17) | ||
endif() | ||
|
||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||
# Set policy for 3.16 for CMP0076 defaulting to ON | ||
cmake_policy(VERSION 3.16) | ||
|
||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||
add_compile_options(-Wall -Wextra -Wpedantic) | ||
endif() | ||
|
||
# find dependencies | ||
find_package(GDAL REQUIRED) | ||
find_package(eigen3_cmake_module REQUIRED) | ||
find_package(Eigen3) | ||
|
||
find_package(ament_cmake REQUIRED) | ||
find_package(rclcpp REQUIRED) | ||
find_package(std_msgs REQUIRED) | ||
find_package(geometry_msgs REQUIRED) | ||
find_package(grid_map_core REQUIRED) | ||
find_package(grid_map_ros REQUIRED) | ||
find_package(grid_map_msgs REQUIRED) | ||
find_package(grid_map_ros REQUIRED) | ||
find_package(grid_map_core REQUIRED) | ||
find_package(rclcpp REQUIRED) | ||
|
||
find_package(Eigen3 REQUIRED) | ||
find_package(GDAL 3 REQUIRED) | ||
|
||
include_directories( | ||
include | ||
) | ||
find_package(yaml_cpp_vendor REQUIRED) | ||
link_directories(${yaml_cpp_vendor_LIBRARY_DIRS}) | ||
|
||
# Reverse compatability for GDAL<3.5 | ||
# https://gdal.org/development/cmake.html | ||
if(NOT TARGET GDAL::GDAL) | ||
add_library(GDAL::GDAL ALIAS ${GDAL_LIBRARY}) | ||
endif() | ||
|
||
# Build | ||
add_library(${PROJECT_NAME} | ||
src/grid_map_geo.cpp | ||
) | ||
ament_target_dependencies(${PROJECT_NAME} rclcpp std_msgs geometry_msgs grid_map_core grid_map_ros grid_map_msgs) | ||
target_include_directories(${PROJECT_NAME} PUBLIC "${Eigen3_INCLUDE_DIRS}") | ||
target_link_libraries(${PROJECT_NAME} ${GDAL_LIBRARY}) | ||
|
||
target_include_directories(${PROJECT_NAME} | ||
PUBLIC | ||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>" | ||
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>" | ||
) | ||
|
||
target_link_libraries(${PROJECT_NAME} Eigen3::Eigen GDAL::GDAL) | ||
|
||
ament_target_dependencies(${PROJECT_NAME} SYSTEM | ||
grid_map_core | ||
grid_map_ros | ||
) | ||
|
||
add_executable(test_tif_loader | ||
src/test_tif_loader.cpp | ||
) | ||
ament_target_dependencies(test_tif_loader rclcpp std_msgs) | ||
target_include_directories(test_tif_loader PUBLIC "${Eigen3_INCLUDE_DIRS}") | ||
target_link_libraries(test_tif_loader ${PROJECT_NAME} ${GDAL_LIBRARY}) | ||
|
||
install(TARGETS | ||
target_link_libraries(test_tif_loader | ||
${PROJECT_NAME} | ||
) | ||
|
||
# Install | ||
install( | ||
DIRECTORY include/ | ||
DESTINATION include/${PROJECT_NAME} | ||
) | ||
|
||
install( | ||
TARGETS | ||
${PROJECT_NAME} | ||
EXPORT export_${PROJECT_NAME} | ||
ARCHIVE DESTINATION lib/${PROJECT_NAME} | ||
LIBRARY DESTINATION lib/${PROJECT_NAME} | ||
RUNTIME DESTINATION bin/${PROJECT_NAME} | ||
) | ||
|
||
ament_export_targets(export_${PROJECT_NAME} HAS_LIBRARY_TARGET) | ||
ament_export_dependencies(GDAL) | ||
|
||
# NOTE: if RUNTIME DESTINATION is set to bin/${PROJECT_NAME} the executable | ||
# is not found by ros2 launch: | ||
# | ||
# Caught exception in launch (see debug for traceback): executable | ||
# 'test_tif_loader' not found on the libexec directory | ||
# '<ws_path>/ros2-aerial/install/grid_map_geo/lib/grid_map_geo' | ||
install( | ||
TARGETS | ||
test_tif_loader | ||
DESTINATION lib/${PROJECT_NAME}) | ||
ARCHIVE DESTINATION lib/${PROJECT_NAME} | ||
LIBRARY DESTINATION lib/${PROJECT_NAME} | ||
RUNTIME DESTINATION lib/${PROJECT_NAME} | ||
) | ||
|
||
install(DIRECTORY | ||
launch | ||
DESTINATION share/${PROJECT_NAME}/ | ||
) | ||
|
||
# Test | ||
include(CTest) | ||
if(BUILD_TESTING) | ||
find_package(ament_lint_auto REQUIRED) | ||
# the following line skips the linter which checks for copyrights | ||
# comment the line when a copyright and license is added to all source files | ||
set(ament_cmake_copyright_FOUND TRUE) | ||
# the following line skips cpplint (only works in a git repo) | ||
# comment the line when this package is in a git repo and when | ||
# a copyright and license is added to all source files | ||
set(ament_cmake_cpplint_FOUND TRUE) | ||
ament_lint_auto_find_test_dependencies() | ||
add_subdirectory(test) | ||
endif() | ||
|
||
ament_package() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
import os | ||
|
||
from ament_index_python.packages import get_package_share_directory | ||
|
||
from launch import LaunchDescription | ||
from launch.actions import DeclareLaunchArgument | ||
from launch.conditions import IfCondition | ||
from launch.substitutions import LaunchConfiguration | ||
|
||
from launch_ros.actions import Node | ||
|
||
|
||
def generate_launch_description(): | ||
"""Generate a launch description.""" | ||
|
||
pkg_grid_map_geo = get_package_share_directory("grid_map_geo") | ||
|
||
# static transform node | ||
static_transform_publisher = Node( | ||
package="tf2_ros", | ||
executable="static_transform_publisher", | ||
name="world_map", | ||
arguments=[ | ||
"--frame-id", | ||
"world", | ||
"--child-frame-id", | ||
"map", | ||
], | ||
) | ||
|
||
# tif loader node | ||
tif_loader = Node( | ||
package="grid_map_geo", | ||
namespace="grid_map_geo", | ||
executable="test_tif_loader", | ||
name="tif_loader", | ||
parameters=[ | ||
{"tif_path": LaunchConfiguration("tif_path")}, | ||
{"tif_color_path": LaunchConfiguration("tif_color_path")}, | ||
], | ||
output="screen", | ||
emulate_tty=True, | ||
) | ||
|
||
# rviz node | ||
rviz = Node( | ||
package="rviz2", | ||
executable="rviz2", | ||
arguments=["-d", os.path.join(pkg_grid_map_geo, "launch", "config.rviz")], | ||
condition=IfCondition(LaunchConfiguration("rviz")), | ||
) | ||
|
||
default_location = "sargans" | ||
default_tif_file = "sargans.tif" | ||
default_tif_color_file = "sargans_color.tif" | ||
return LaunchDescription( | ||
[ | ||
DeclareLaunchArgument( | ||
"rviz", default_value="true", description="Open RViz." | ||
), | ||
DeclareLaunchArgument( | ||
"location", | ||
default_value=default_location, | ||
description="Location.", | ||
), | ||
DeclareLaunchArgument( | ||
"tif_path", | ||
default_value=os.path.join( | ||
pkg_grid_map_geo, "resources", default_tif_file | ||
), | ||
description="Full path to the elevation map file.", | ||
), | ||
DeclareLaunchArgument( | ||
"tif_color_path", | ||
default_value=os.path.join( | ||
pkg_grid_map_geo, "resources", default_tif_color_file | ||
), | ||
description="Full path to the elevation texture file.", | ||
), | ||
static_transform_publisher, | ||
tif_loader, | ||
rviz, | ||
] | ||
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<launch> | ||
<arg name="rviz" default="true"/> | ||
<arg name="location" default="sargans"/> | ||
<node pkg="tf2_ros" exec="static_transform_publisher" name="world_map" args="--frame-id world --child-frame-id map"/> | ||
|
||
<node pkg="grid_map_geo" exec="test_tif_loader" name="test_tif_loader" output="screen"> | ||
<param name="tif_path" value="$(find-pkg-share grid_map_geo)/resources/sargans.tif"/> | ||
<param name="tif_color_path" value="$(find-pkg-share grid_map_geo)/resources/sargans_color.tif"/> | ||
</node> | ||
|
||
<group if="$(var rviz)"> | ||
<node exec="rviz2" name="rviz2" pkg="rviz2" args="-d $(find-pkg-share grid_map_geo)/launch/config.rviz" /> | ||
</group> | ||
</launch> |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,18 +2,26 @@ | |
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> | ||
<package format="3"> | ||
<name>grid_map_geo</name> | ||
<version>0.0.0</version> | ||
<description>TODO: Package description</description> | ||
<maintainer email="[email protected]">jaeyoung</maintainer> | ||
<license>TODO: License declaration</license> | ||
<version>0.0.1</version> | ||
<description>Georeferenced grid map</description> | ||
<maintainer email="[email protected]">Jaeyoung Lim</maintainer> | ||
<maintainer email="[email protected]">Ryan Friedman</maintainer> | ||
<author>Jaeyoung Lim</author> | ||
<license>BSD-3</license> | ||
|
||
<buildtool_depend>ament_cmake</buildtool_depend> | ||
<url type="website">https://github.com/Jaeyoung-Lim/grid_map_geo</url> | ||
<url type="bugtracker">https://github.com/Jaeyoung-Lim/grid_map_geo/issues</url> | ||
|
||
<test_depend>ament_lint_auto</test_depend> | ||
<test_depend>ament_lint_common</test_depend> | ||
<depend>rclcpp</depend> | ||
<buildtool_depend>ament_cmake</buildtool_depend> | ||
<depend>eigen</depend> | ||
<depend>grid_map_core</depend> | ||
<depend>grid_map_ros</depend> | ||
<depend>libgdal-dev</depend> | ||
<depend>rclcpp</depend> | ||
<depend>yaml_cpp_vendor</depend> | ||
<exec_depend>ros2launch</exec_depend> | ||
|
||
<export> | ||
<build_type>ament_cmake</build_type> | ||
</export> | ||
</package> | ||
</package> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,7 @@ | |
* @author Jaeyoung Lim <[email protected]> | ||
*/ | ||
|
||
#include "grid_map_geo/grid_map_geo.h" | ||
#include "grid_map_geo/grid_map_geo.hpp" | ||
|
||
#include <grid_map_core/GridMapMath.hpp> | ||
#include <grid_map_core/iterators/CircleIterator.hpp> | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
grid_map_core was already linked before through the namespaced target (preferred) compared to
ament_target_dependencies
. In conversations with the ROS maintainers, seems like the only thingament_target_dependencies
exists for these days is message packages because those can't use namespaced export targets yet.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If:
is replaced with:
target_link_libraries(${PROJECT_NAME} Eigen3::Eigen GDAL::GDAL grid_map_core grid_map_ros )
then there is an error:
The target
grid_map_core::grid_map_core
is not available. Something needing fixing upstream?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, try my patch here: ANYbotics/grid_map#404
Since
grid_map
seems largely unmaintained, we may have trouble getting changes in.