This repository was archived by the owner on Apr 23, 2020. It is now read-only.
forked from ros-planning/navigation
-
Notifications
You must be signed in to change notification settings - Fork 5
Port AMCL to ROS 2 (and tf2) #9
+609
−427
Merged
Changes from all commits
Commits
Show all changes
80 commits
Select commit
Hold shift + click to select a range
c6fdbd6
Remove dynamic reconfigure
dhood 9f8e41f
Remove rosbag functionality
dhood 87b56b0
Remove message filter use
dhood 9eae0a6
tf -> tf2
dhood 8bafff6
Strip leading / from frame IDs
dhood c4160c2
Re-enable message filter
dhood c214c15
Don't use deperecated quaternion constructor
dhood daef585
Revert "Re-enable message filter"
dhood 69ac524
Fix test failures by increasing transform timeouts
dhood 8beb18f
WIP ros1->ros2
dhood 187b81f
Namespace of ::msg or ::srv
dhood 988d130
ConstPtr -> ::ConstPtr
dhood 2945a1a
ros::Time -> tf2::TimePoint
dhood f0ca929
ros::Duration -> tf2::Duration
dhood 6646c9c
ros -> rclcpp
dhood 8dd7c0e
ros2 timer
dhood 9791767
Disable sigint handler
dhood ec77ffe
Not using boost::shared_ptr
dhood 67f23b7
Appropriate boost header for recursive_mutex
dhood 09a9ad0
Shared ptrs everywhere
dhood 13464e5
Use new durationFromSec tf2 function
dhood 8c53751
Subscribers using qos settings
dhood a50c25f
Leftover missing ::msg
dhood 95bdced
Use new tf2_ros::fromMsg
dhood 7338c47
Reinstate node ptr
dhood 8488a04
Disable most logging
dhood 7565b95
chrono fix
dhood dc24ace
'msg.' -> 'msg->'
dhood fa0c848
Store node
dhood ea5fb1d
Create services properly
dhood 67dd366
Set parameters
dhood 97cfb2a
Comment more logging
dhood 28c111b
tf2 fixes
dhood f736aa8
fix service callback signatures
dhood be56a00
tf2 changes
dhood 882b26b
misc
dhood b170431
only callbacks use shared_ptr
dhood 7cb699d
map request service
dhood cf88427
Fix boost link error
dhood dcf6f44
Comment these for now just to move forward
dhood 4e161e2
Use ament_auto_package
dhood 083e5c0
tf2::Duration -> tf2::durationFromSec
dhood 06d17a0
Re-enable "logging"
dhood cfd3aeb
Prevent node already added to executor crash
dhood 2f108ff
(hack) use 'latest' TF info
dhood 10e336e
Debug
dhood e68a5d8
Fixup (whitespace etc)
dhood 1cf5522
Use rate for map request
dhood a22cce4
Don't use tf2 time for checkLaserReceived timer
dhood 7bde846
Clarify which TODOs are for before merge
dhood d7fdd86
Add wait_for_service
dhood d90451c
Restore initial qos choices
dhood 3b75291
Restore tolerance
dhood 76d6efb
Demo ROS 1 launch file to be used with bridge
dhood 46865f8
[hack] Use map from topic instead of service
dhood 4727e38
Remove debug prints
dhood 27405c1
It probably won't be the map server publishing the map topic in that …
dhood d45a213
Expose use_map_topic as command line option
dhood 56d07cd
Put initial pose back to 0 (can be set on 'initialpose' topic)
dhood 4de64c6
Use tf2 time because ROS times can't be subtracted a.t.m.
dhood ba59f17
Revert test tolerance increase (needed for use without message filters)
dhood e5e0c0b
Remove commented delete that will never be re-enabled
dhood c77cf14
Tidy up workaround for 'latest' TF data
dhood bb226e8
Remove most workarounds for 'latest' TF data
dhood e624b1f
Prevent unused variable warnings
dhood dfca917
Remove boost dependency
dhood bcada23
Use CMAKE_CXX_STANDARD
dhood c7d72f8
Alphabetical ordering
dhood 76f722d
Whitespace fixup
dhood 7167176
Leftover debug prints
dhood ff2e4d7
Restore original default d_thresh
dhood 0371290
Revert "Prevent unused variable warnings"
dhood be5d890
Prevent unused variable warnings
dhood dd5a552
Let ament_cmake_ros have control over the BUILD_SHARED_LIBS cmake flag
dhood 2abf7f2
Pedantic is a bit much
dhood 105fcb3
simplify ament_target_dependencies call
dhood e34e097
Correct usage of ament_target_dependencies
dhood 3b804a3
Remove custom leading forward slash removal
dhood a63b203
Remove ROS 1 testing launch file
dhood 033ac06
Avoid race condition with map_server topic usage
dhood 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
Empty file.
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,141 +1,142 @@ | ||
| cmake_minimum_required(VERSION 2.8.3) | ||
| cmake_minimum_required(VERSION 3.5) | ||
| project(amcl) | ||
|
|
||
| find_package(catkin REQUIRED | ||
| COMPONENTS | ||
| rosbag | ||
| roscpp | ||
| tf | ||
| dynamic_reconfigure | ||
| nav_msgs | ||
| ) | ||
|
|
||
| find_package(Boost REQUIRED) | ||
| # Default to C++14 | ||
| if(NOT CMAKE_CXX_STANDARD) | ||
| set(CMAKE_CXX_STANDARD 14) | ||
| endif() | ||
| if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||
| add_compile_options(-Wall -Wextra) | ||
| endif() | ||
|
|
||
| # dynamic reconfigure | ||
| generate_dynamic_reconfigure_options( | ||
| cfg/AMCL.cfg | ||
| find_package(ament_cmake_auto REQUIRED) | ||
| find_package(ament_cmake_ros REQUIRED) | ||
| set(required_dependencies | ||
| "geometry_msgs" | ||
| "nav_msgs" | ||
| "rclcpp" | ||
| "rcutils" | ||
| "sensor_msgs" | ||
| "std_srvs" | ||
| "tf2" | ||
| "tf2_geometry_msgs" | ||
| "tf2_msgs" | ||
| "tf2_ros" | ||
| ) | ||
| ament_auto_find_build_dependencies(REQUIRED ${required_dependencies}) | ||
|
|
||
| catkin_package( | ||
| CATKIN_DEPENDS | ||
| rosbag | ||
| roscpp | ||
| dynamic_reconfigure | ||
| tf | ||
| INCLUDE_DIRS include | ||
| LIBRARIES amcl_sensors amcl_map amcl_pf | ||
| ) | ||
| # dynamic reconfigure | ||
| # generate_dynamic_reconfigure_options( | ||
| # cfg/AMCL.cfg | ||
| # ) | ||
|
|
||
| include_directories(include/amcl include/amcl/map include/amcl/sensors include/amcl/pf) | ||
| include_directories(${catkin_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}) | ||
|
|
||
| add_library(amcl_pf | ||
| ament_auto_add_library(amcl_pf | ||
| src/amcl/pf/pf.c | ||
| src/amcl/pf/pf_kdtree.c | ||
| src/amcl/pf/pf_pdf.c | ||
| src/amcl/pf/pf_vector.c | ||
| src/amcl/pf/eig3.c | ||
| src/amcl/pf/pf_draw.c) | ||
|
|
||
| add_library(amcl_map | ||
| ament_auto_add_library(amcl_map | ||
| src/amcl/map/map.c | ||
| src/amcl/map/map_cspace.cpp | ||
| src/amcl/map/map_range.c | ||
| src/amcl/map/map_store.c | ||
| src/amcl/map/map_draw.c) | ||
|
|
||
| add_library(amcl_sensors | ||
| ament_target_dependencies(amcl_map) | ||
| ament_auto_add_library(amcl_sensors | ||
| src/amcl/sensors/amcl_sensor.cpp | ||
| src/amcl/sensors/amcl_odom.cpp | ||
| src/amcl/sensors/amcl_laser.cpp) | ||
| target_link_libraries(amcl_sensors amcl_map amcl_pf) | ||
|
|
||
|
|
||
| add_executable(amcl | ||
| ament_auto_add_executable(amcl | ||
| src/amcl_node.cpp) | ||
| add_dependencies(amcl amcl_gencfg) | ||
| # add_dependencies(amcl amcl_gencfg) | ||
|
|
||
| ament_target_dependencies(amcl | ||
| "geometry_msgs" | ||
| "nav_msgs" | ||
| "rclcpp" | ||
| "sensor_msgs" | ||
| "std_srvs" | ||
| "tf2" | ||
| "tf2_geometry_msgs" | ||
| "tf2_msgs" | ||
| "tf2_ros") | ||
|
|
||
| target_link_libraries(amcl | ||
| amcl_sensors amcl_map amcl_pf | ||
| ${Boost_LIBRARIES} | ||
| ${catkin_LIBRARIES} | ||
| ) | ||
|
|
||
| install( TARGETS | ||
| amcl amcl_sensors amcl_map amcl_pf | ||
| ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} | ||
| LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} | ||
| RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} | ||
| ) | ||
|
|
||
| install(DIRECTORY include/amcl/ | ||
| DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} | ||
| ) | ||
|
|
||
| install(DIRECTORY examples/ | ||
| DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/examples | ||
| DESTINATION share/${PROJECT_NAME}/examples | ||
| ) | ||
|
|
||
| ## Configure Tests | ||
| if(CATKIN_ENABLE_TESTING) | ||
| find_package(rostest REQUIRED) | ||
|
|
||
| # Bags | ||
| catkin_download_test_data(${PROJECT_NAME}_basic_localization_stage_indexed.bag | ||
| http://download.ros.org/data/amcl/basic_localization_stage_indexed.bag | ||
| DESTINATION ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/test | ||
| MD5 41fe43af189ec71e5e48eb9ed661a655) | ||
| catkin_download_test_data(${PROJECT_NAME}_global_localization_stage_indexed.bag | ||
| http://download.ros.org/data/amcl/global_localization_stage_indexed.bag | ||
| DESTINATION ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/test | ||
| MD5 752f711cf4f6e8d1d660675e2da096b0) | ||
| catkin_download_test_data(${PROJECT_NAME}_small_loop_prf_indexed.bag | ||
| http://download.ros.org/data/amcl/small_loop_prf_indexed.bag | ||
| DESTINATION ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/test | ||
| MD5 e4ef0fc006872b43f12ed8a7ce7dcd81) | ||
| catkin_download_test_data(${PROJECT_NAME}_small_loop_crazy_driving_prg_indexed.bag | ||
| http://download.ros.org/data/amcl/small_loop_crazy_driving_prg_indexed.bag | ||
| DESTINATION ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/test | ||
| MD5 4a58d1a7962914009d99000d06e5939c) | ||
| catkin_download_test_data(${PROJECT_NAME}_texas_greenroom_loop_indexed.bag | ||
| http://download.ros.org/data/amcl/texas_greenroom_loop_indexed.bag | ||
| DESTINATION ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/test | ||
| MD5 6e3432115cccdca1247f6c807038e13d) | ||
| catkin_download_test_data(${PROJECT_NAME}_texas_willow_hallway_loop_indexed.bag | ||
| http://download.ros.org/data/amcl/texas_willow_hallway_loop_indexed.bag | ||
| DESTINATION ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/test | ||
| MD5 27deb742fdcd3af44cf446f39f2688a8) | ||
| catkin_download_test_data(${PROJECT_NAME}_rosie_localization_stage.bag | ||
| http://download.ros.org/data/amcl/rosie_localization_stage.bag | ||
| DESTINATION ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/test | ||
| MD5 3347bf3835724cfa45e958c5c1846066) | ||
|
|
||
| # Maps | ||
| catkin_download_test_data(${PROJECT_NAME}_willow-full.pgm | ||
| http://download.ros.org/data/amcl/willow-full.pgm | ||
| DESTINATION ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/test | ||
| MD5 b84465cdbbfe3e2fb9eb4579e0bcaf0e) | ||
| catkin_download_test_data(${PROJECT_NAME}_willow-full-0.05.pgm | ||
| http://download.ros.org/data/amcl/willow-full-0.05.pgm | ||
| DESTINATION ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/test | ||
| MD5 b61694296e08965096c5e78611fd9765) | ||
|
|
||
| # Tests | ||
| add_rostest(test/set_initial_pose.xml) | ||
| add_rostest(test/set_initial_pose_delayed.xml) | ||
| add_rostest(test/basic_localization_stage.xml) | ||
| add_rostest(test/small_loop_prf.xml) | ||
| add_rostest(test/small_loop_crazy_driving_prg.xml) | ||
| add_rostest(test/texas_greenroom_loop.xml) | ||
| add_rostest(test/rosie_multilaser.xml) | ||
| add_rostest(test/texas_willow_hallway_loop.xml) | ||
|
|
||
| # Not sure when or if this actually passed. | ||
| #if(CATKIN_ENABLE_TESTING) | ||
| # find_package(rostest REQUIRED) | ||
| # | ||
| # The point of this is that you start with an even probability | ||
| # distribution over the whole map and the robot localizes itself after | ||
| # some number of iterations of sensing and motion. | ||
| # # Bags | ||
| # catkin_download_test_data(${PROJECT_NAME}_basic_localization_stage_indexed.bag | ||
| # http://download.ros.org/data/amcl/basic_localization_stage_indexed.bag | ||
| # DESTINATION ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/test | ||
| # MD5 41fe43af189ec71e5e48eb9ed661a655) | ||
| # catkin_download_test_data(${PROJECT_NAME}_global_localization_stage_indexed.bag | ||
| # http://download.ros.org/data/amcl/global_localization_stage_indexed.bag | ||
| # DESTINATION ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/test | ||
| # MD5 752f711cf4f6e8d1d660675e2da096b0) | ||
| # catkin_download_test_data(${PROJECT_NAME}_small_loop_prf_indexed.bag | ||
| # http://download.ros.org/data/amcl/small_loop_prf_indexed.bag | ||
| # DESTINATION ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/test | ||
| # MD5 e4ef0fc006872b43f12ed8a7ce7dcd81) | ||
| # catkin_download_test_data(${PROJECT_NAME}_small_loop_crazy_driving_prg_indexed.bag | ||
| # http://download.ros.org/data/amcl/small_loop_crazy_driving_prg_indexed.bag | ||
| # DESTINATION ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/test | ||
| # MD5 4a58d1a7962914009d99000d06e5939c) | ||
| # catkin_download_test_data(${PROJECT_NAME}_texas_greenroom_loop_indexed.bag | ||
| # http://download.ros.org/data/amcl/texas_greenroom_loop_indexed.bag | ||
| # DESTINATION ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/test | ||
| # MD5 6e3432115cccdca1247f6c807038e13d) | ||
| # catkin_download_test_data(${PROJECT_NAME}_texas_willow_hallway_loop_indexed.bag | ||
| # http://download.ros.org/data/amcl/texas_willow_hallway_loop_indexed.bag | ||
| # DESTINATION ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/test | ||
| # MD5 27deb742fdcd3af44cf446f39f2688a8) | ||
| # catkin_download_test_data(${PROJECT_NAME}_rosie_localization_stage.bag | ||
| # http://download.ros.org/data/amcl/rosie_localization_stage.bag | ||
| # DESTINATION ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/test | ||
| # MD5 3347bf3835724cfa45e958c5c1846066) | ||
| # | ||
| # add_rostest(test/global_localization_stage.xml) | ||
| endif() | ||
| # # Maps | ||
| # catkin_download_test_data(${PROJECT_NAME}_willow-full.pgm | ||
| # http://download.ros.org/data/amcl/willow-full.pgm | ||
| # DESTINATION ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/test | ||
| # MD5 b84465cdbbfe3e2fb9eb4579e0bcaf0e) | ||
| # catkin_download_test_data(${PROJECT_NAME}_willow-full-0.05.pgm | ||
| # http://download.ros.org/data/amcl/willow-full-0.05.pgm | ||
| # DESTINATION ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/test | ||
| # MD5 b61694296e08965096c5e78611fd9765) | ||
| # | ||
| # # Tests | ||
| # add_rostest(test/set_initial_pose.xml) | ||
| # add_rostest(test/set_initial_pose_delayed.xml) | ||
| # add_rostest(test/basic_localization_stage.xml) | ||
| # add_rostest(test/small_loop_prf.xml) | ||
| # add_rostest(test/small_loop_crazy_driving_prg.xml) | ||
| # add_rostest(test/texas_greenroom_loop.xml) | ||
| # add_rostest(test/rosie_multilaser.xml) | ||
| # add_rostest(test/texas_willow_hallway_loop.xml) | ||
| # | ||
| ## Not sure when or if this actually passed. | ||
| ## | ||
| ## The point of this is that you start with an even probability | ||
| ## distribution over the whole map and the robot localizes itself after | ||
| ## some number of iterations of sensing and motion. | ||
| ## | ||
| ## add_rostest(test/global_localization_stage.xml) | ||
| #endif() | ||
| ament_auto_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
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
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.
Should this be PR'd upstream?