forked from ros-navigation/navigation2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding new MPPI controller to Nav2 (ros-navigation#3350)
* adding new MPPI controller to Nav2 * fixing rename for Nav2 staging * using larger resource class * fix plugin name * wz typo * add mppi gif * Update defaults.yaml * Update makeflags to match core count of resource_class: large * Bump cache version for testing CI changes * fixing tests * remove unused function * Update config.yml * adding a little more detail * adding contextual note * adding contextual exceptions * Fix using different frame for global and local costmap (ros-navigation#3425) * getGlobalPlanConsideringBoundsInCostmapFrame Replace transformPlanPosesToCostmapFrame and getGlobalPlanConsideringBounds by getGlobalPlanConsideringBoundsInCostmapFrame * use stamp from robot pose for transform * style * fix test * lint test --------- Co-authored-by: Guillaume Doisy <[email protected]> --------- Co-authored-by: ruffsl <[email protected]> Co-authored-by: Guillaume Doisy <[email protected]> Co-authored-by: Guillaume Doisy <[email protected]>
- Loading branch information
1 parent
8dea742
commit 8d4f6f4
Showing
72 changed files
with
9,141 additions
and
4 deletions.
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
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,93 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
project(nav2_mppi_controller) | ||
|
||
add_definitions(-DXTENSOR_ENABLE_XSIMD) | ||
add_definitions(-DXTENSOR_USE_XSIMD) | ||
|
||
set(XTENSOR_USE_TBB 0) | ||
set(XTENSOR_USE_OPENMP 0) | ||
|
||
|
||
find_package(ament_cmake REQUIRED) | ||
find_package(xtensor REQUIRED) | ||
|
||
set(dependencies_pkgs | ||
rclcpp | ||
nav2_common | ||
pluginlib | ||
tf2 | ||
geometry_msgs | ||
visualization_msgs | ||
nav_msgs | ||
nav2_core | ||
nav2_costmap_2d | ||
nav2_util | ||
tf2_geometry_msgs | ||
tf2_eigen | ||
tf2_ros | ||
) | ||
|
||
foreach(pkg IN LISTS dependencies_pkgs) | ||
find_package(${pkg} REQUIRED) | ||
endforeach() | ||
|
||
nav2_package() | ||
add_compile_options(-O3 -mavx2 -mfma -finline-limit=1000000 -ffp-contract=fast -ffast-math) | ||
|
||
add_library(mppi_controller SHARED | ||
src/controller.cpp | ||
src/optimizer.cpp | ||
src/critic_manager.cpp | ||
src/trajectory_visualizer.cpp | ||
src/path_handler.cpp | ||
src/parameters_handler.cpp | ||
src/noise_generator.cpp | ||
) | ||
|
||
add_library(mppi_critics SHARED | ||
src/critics/obstacles_critic.cpp | ||
src/critics/goal_critic.cpp | ||
src/critics/goal_angle_critic.cpp | ||
src/critics/path_align_critic.cpp | ||
src/critics/path_follow_critic.cpp | ||
src/critics/path_angle_critic.cpp | ||
src/critics/prefer_forward_critic.cpp | ||
src/critics/twirling_critic.cpp | ||
src/critics/constraint_critic.cpp | ||
) | ||
|
||
set(libraries mppi_controller mppi_critics) | ||
|
||
foreach(lib IN LISTS libraries) | ||
target_compile_options(${lib} PUBLIC -fconcepts) | ||
target_include_directories(${lib} PUBLIC include ${xsimd_INCLUDE_DIRS} ${OpenMP_INCLUDE_DIRS}) | ||
target_link_libraries(${lib} xtensor xtensor::optimize xtensor::use_xsimd) | ||
ament_target_dependencies(${lib} ${dependencies_pkgs}) | ||
endforeach() | ||
|
||
install(TARGETS mppi_controller mppi_critics | ||
ARCHIVE DESTINATION lib | ||
LIBRARY DESTINATION lib | ||
RUNTIME DESTINATION bin | ||
) | ||
|
||
install(DIRECTORY include/ | ||
DESTINATION include/ | ||
) | ||
|
||
if(BUILD_TESTING) | ||
find_package(ament_lint_auto REQUIRED) | ||
find_package(ament_cmake_gtest REQUIRED) | ||
set(ament_cmake_copyright_FOUND TRUE) | ||
ament_lint_auto_find_test_dependencies() | ||
add_subdirectory(test) | ||
# add_subdirectory(benchmark) | ||
endif() | ||
|
||
ament_export_libraries(${libraries}) | ||
ament_export_dependencies(${dependencies_pkgs}) | ||
ament_export_include_directories(include) | ||
pluginlib_export_plugin_description_file(nav2_core mppic.xml) | ||
pluginlib_export_plugin_description_file(nav2_mppi_controller critics.xml) | ||
|
||
ament_package() |
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,22 @@ | ||
MIT License | ||
|
||
Copyright (c) 2021-2022 Fast Sense Studio | ||
Copyright (c) 2022-2023 Samsung Research America | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
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. |
Oops, something went wrong.