-
Notifications
You must be signed in to change notification settings - Fork 18
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
Port terrain planner benchmark to ros2 #73
Open
Ryanf55
wants to merge
3
commits into
ethz-asl:ros2
Choose a base branch
from
Ryanf55:port-bencmark-planner-to-ros2
base: ros2
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.
+179
−126
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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 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 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 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,88 +1,65 @@ | ||
cmake_minimum_required(VERSION 2.8.12) | ||
cmake_minimum_required(VERSION 3.14.4) | ||
project(terrain_planner_benchmark) | ||
|
||
add_definitions(-std=c++17 -Wall) | ||
if(NOT CMAKE_C_STANDARD) | ||
set(CMAKE_C_STANDARD 99) | ||
endif() | ||
if(NOT CMAKE_CXX_STANDARD) | ||
set(CMAKE_CXX_STANDARD 17) | ||
endif() | ||
|
||
find_package(GDAL) | ||
find_package(OpenCV REQUIRED) | ||
find_package(ompl REQUIRED) | ||
|
||
find_package(catkin REQUIRED COMPONENTS | ||
eigen_catkin | ||
grid_map_core | ||
grid_map_cv | ||
grid_map_msgs | ||
grid_map_ros | ||
grid_map_pcl | ||
grid_map_geo | ||
terrain_navigation | ||
terrain_planner | ||
) | ||
|
||
catkin_package( | ||
INCLUDE_DIRS include | ||
LIBRARIES terrain_planner_benchmark | ||
) | ||
|
||
include_directories( | ||
${catkin_INCLUDE_DIRS} | ||
include | ||
${Boost_INCLUDE_DIR} | ||
${Eigen_INCLUDE_DIRS} | ||
${GeographicLib_INCLUDE_DIRS} | ||
${OMPL_INCLUDE_DIR} | ||
) | ||
# Set policy for 3.16 for CMP0076 defaulting to ON | ||
cmake_policy(VERSION 3.16) | ||
|
||
add_library(${PROJECT_NAME} | ||
src/terrain_planner_benchmark.cpp | ||
) | ||
add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) | ||
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} ${OpenCV_LIBRARIES} ${GeographicLib_LIBRARIES} ${OMPL_LIBRARIES}) | ||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||
add_compile_options(-Wall -Wextra -Wpedantic) | ||
endif() | ||
|
||
add_executable(terrain_planner_benchmark_node | ||
src/terrain_planner_benchmark_node.cpp | ||
) | ||
add_dependencies(terrain_planner_benchmark_node ${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS} ${GDAL_LIBRARY}) | ||
target_link_libraries(terrain_planner_benchmark_node ${PROJECT_NAME} ${catkin_LIBRARIES} ${GDAL_LIBRARY} ${OpenCV_LIBRARIES} pthread) | ||
find_package(ament_cmake REQUIRED) | ||
find_package(GDAL 3.5) | ||
find_package(OpenCV REQUIRED) | ||
find_package(ompl REQUIRED) | ||
|
||
add_executable(ompl_benchmark_node | ||
src/ompl_benchmark_node.cpp | ||
) | ||
add_dependencies(ompl_benchmark_node ${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS} ${GDAL_LIBRARY}) | ||
target_link_libraries(ompl_benchmark_node ${PROJECT_NAME} ${catkin_LIBRARIES} ${GDAL_LIBRARY} ${OpenCV_LIBRARIES} pthread) | ||
find_package(grid_map_core REQUIRED) | ||
find_package(grid_map_cv REQUIRED) | ||
find_package(grid_map_msgs REQUIRED) | ||
find_package(grid_map_ros REQUIRED) | ||
find_package(grid_map_pcl REQUIRED) | ||
find_package(grid_map_geo REQUIRED) | ||
find_package(terrain_navigation REQUIRED) | ||
find_package(Boost REQUIRED) # Workaround for terrain_planner not exporting this correctly | ||
find_package(terrain_planner REQUIRED) | ||
|
||
add_executable(test_ics | ||
src/test_ics.cpp | ||
) | ||
add_dependencies(test_ics ${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS} ${GDAL_LIBRARY}) | ||
target_link_libraries(test_ics ${PROJECT_NAME} ${catkin_LIBRARIES} ${GDAL_LIBRARY} ${OpenCV_LIBRARIES} ${OMPL_LIBRARIES}) | ||
add_library(${PROJECT_NAME}) | ||
add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) | ||
|
||
add_executable(test_rrt_replanning_node | ||
src/test_rrt_replanning_node.cpp | ||
target_include_directories(${PROJECT_NAME} | ||
PUBLIC | ||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>" | ||
) | ||
add_dependencies(test_rrt_replanning_node ${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS} ${GDAL_LIBRARY}) | ||
target_link_libraries(test_rrt_replanning_node ${PROJECT_NAME} ${catkin_LIBRARIES} ${GDAL_LIBRARY} ${OpenCV_LIBRARIES} ${OMPL_LIBRARIES}) | ||
|
||
add_executable(surface_visualization | ||
src/surface_visualization.cpp | ||
) | ||
add_dependencies(surface_visualization ${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS} ${GDAL_LIBRARY}) | ||
target_link_libraries(surface_visualization ${PROJECT_NAME} ${catkin_LIBRARIES} ${GDAL_LIBRARY} ${OpenCV_LIBRARIES} ${OMPL_LIBRARIES}) | ||
add_executable(terrain_planner_benchmark_node) | ||
add_executable(ompl_benchmark_node EXCLUDE_FROM_ALL) | ||
add_executable(test_ics EXCLUDE_FROM_ALL) | ||
add_executable(test_rrt_replanning_node EXCLUDE_FROM_ALL) | ||
add_executable(surface_visualization EXCLUDE_FROM_ALL) | ||
add_executable(test_dubins_classification EXCLUDE_FROM_ALL) | ||
add_executable(run_replay EXCLUDE_FROM_ALL) | ||
add_executable(test_rrt_circle_goal EXCLUDE_FROM_ALL) | ||
add_subdirectory(src) | ||
|
||
add_executable(test_dubins_classification | ||
src/test_dubins_classification.cpp | ||
include(GNUInstallDirs) | ||
install( | ||
TARGETS | ||
terrain_planner_benchmark_node | ||
EXPORT export_${PROJECT_NAME} | ||
DESTINATION lib/${PROJECT_NAME} | ||
) | ||
add_dependencies(test_dubins_classification ${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS} ${GDAL_LIBRARY}) | ||
target_link_libraries(test_dubins_classification ${PROJECT_NAME} ${catkin_LIBRARIES} ${GDAL_LIBRARY} ${OpenCV_LIBRARIES} ${OMPL_LIBRARIES}) | ||
|
||
add_executable(run_replay | ||
src/rviz_replay.cpp | ||
install(DIRECTORY | ||
launch | ||
resource | ||
DESTINATION share/${PROJECT_NAME}/ | ||
) | ||
add_dependencies(run_replay ${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS} ${GDAL_LIBRARY}) | ||
target_link_libraries(run_replay ${PROJECT_NAME} ${catkin_LIBRARIES} ${GDAL_LIBRARY} ${OpenCV_LIBRARIES} ${OMPL_LIBRARIES}) | ||
|
||
add_executable(test_rrt_circle_goal | ||
src/test_rrt_circle_goal.cpp | ||
) | ||
add_dependencies(test_rrt_circle_goal terrain_planner ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS} ${GDAL_LIBRARY}) | ||
target_link_libraries(test_rrt_circle_goal ${PROJECT_NAME} ${catkin_LIBRARIES} ${GDAL_LIBRARY} ${OpenCV_LIBRARIES} ${OMPL_LIBRARIES}) | ||
ament_package() |
Empty file.
This file contains 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,7 @@ | ||
# Terrain Planner Benchmark | ||
|
||
## Terrain Planner Benchmark Node | ||
|
||
```bash | ||
ros2 launch terrain_planner_benchmark goaltype_benchmark.launch | ||
``` |
This file contains 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 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,14 +2,14 @@ | |
<arg name="location" default="dischma"/> | ||
Ryanf55 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<arg name="runs" default="50"/> | ||
|
||
<node pkg="tf" type="static_transform_publisher" name="world_map" args="0 0 0 0 0 0 world map 10"/> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This would publish TF at 100Hz. In ROS 2, the static tf publisher is using transient local durability, so it's not necessary to republish. |
||
<node pkg="tf2_ros" exec="static_transform_publisher" name="world_map" args="--frame-id world --child-frame-id map"/> | ||
|
||
<node pkg="terrain_planner_benchmark" type="terrain_planner_benchmark_node" name="benchmark_planner" output="screen" required="true"> | ||
<param name="location" value="$(arg location)"/> | ||
<param name="map_path" value="$(find terrain_models)/models/$(arg location).tif"/> | ||
<param name="color_file_path" value="$(find terrain_models)/models/$(arg location)_color.tif"/> | ||
<param name="output_directory" value="$(find terrain_planner)/../output"/> | ||
<param name="number_of_runs" value="$(arg runs)"/> | ||
<node pkg="terrain_planner_benchmark" exec="terrain_planner_benchmark_node" name="benchmark_planner" output="screen"> | ||
<param name="location" value="$(var location)"/> | ||
<param name="map_path" value="$(find-pkg-share terrain_models)/models/$(var location).tif"/> | ||
<param name="color_file_path" value="$(find-pkg-share terrain_models)/models/$(var location)_color.tif"/> | ||
<param name="output_directory" value="$(find-pkg-share terrain_planner)/../output"/> | ||
<param name="number_of_runs" value="$(var runs)"/> | ||
<param name="random" value="true"/> | ||
</node> | ||
</launch> |
This file contains 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 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,54 @@ | ||
target_sources(${PROJECT_NAME} | ||
PRIVATE | ||
terrain_planner_benchmark.cpp | ||
) | ||
target_link_libraries(${PROJECT_NAME} | ||
PUBLIC | ||
terrain_navigation::terrain_navigation | ||
terrain_planner::terrain_planner | ||
${OpenCV_LIBRARIES} ${GeographicLib_LIBRARIES} ${OMPL_LIBRARIES} | ||
) | ||
|
||
target_sources(${PROJECT_NAME}_node | ||
PRIVATE | ||
terrain_planner_benchmark_node.cpp | ||
) | ||
target_link_libraries(${PROJECT_NAME}_node | ||
PRIVATE | ||
${PROJECT_NAME}::${PROJECT_NAME} rclcpp::rclcpp ${geometry_msgs_TARGETS} | ||
) | ||
|
||
target_sources(ompl_benchmark_node | ||
PRIVATE | ||
ompl_benchmark_node.cpp | ||
) | ||
|
||
target_sources(test_ics | ||
PRIVATE | ||
test_ics.cpp | ||
) | ||
|
||
target_sources(test_rrt_replanning_node | ||
PRIVATE | ||
test_rrt_replanning_node.cpp | ||
) | ||
|
||
target_sources(surface_visualization | ||
PRIVATE | ||
surface_visualization.cpp | ||
) | ||
|
||
target_sources(test_dubins_classification | ||
PRIVATE | ||
test_dubins_classification.cpp | ||
) | ||
|
||
target_sources(run_replay | ||
PRIVATE | ||
rviz_replay.cpp | ||
) | ||
|
||
target_sources(test_rrt_circle_goal | ||
PRIVATE | ||
test_rrt_circle_goal.cpp | ||
) |
Oops, something went wrong.
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.
EXCLUDE_FROM_ALL makes it not compiled by default. They won't compile yet, each one needs ported. I was hoping to do a PR for each executable.