Skip to content
This repository was archived by the owner on Apr 23, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
c6fdbd6
Remove dynamic reconfigure
dhood Mar 9, 2017
9f8e41f
Remove rosbag functionality
dhood Mar 9, 2017
87b56b0
Remove message filter use
dhood Mar 10, 2017
9eae0a6
tf -> tf2
dhood Mar 13, 2017
8bafff6
Strip leading / from frame IDs
dhood Mar 13, 2017
c4160c2
Re-enable message filter
dhood Mar 13, 2017
c214c15
Don't use deperecated quaternion constructor
dhood Mar 13, 2017
daef585
Revert "Re-enable message filter"
dhood Mar 13, 2017
69ac524
Fix test failures by increasing transform timeouts
dhood Mar 14, 2017
8beb18f
WIP ros1->ros2
dhood Mar 14, 2017
187b81f
Namespace of ::msg or ::srv
dhood Mar 20, 2017
988d130
ConstPtr -> ::ConstPtr
dhood Mar 20, 2017
2945a1a
ros::Time -> tf2::TimePoint
dhood Mar 20, 2017
f0ca929
ros::Duration -> tf2::Duration
dhood Mar 20, 2017
6646c9c
ros -> rclcpp
dhood Mar 21, 2017
8dd7c0e
ros2 timer
dhood Mar 22, 2017
9791767
Disable sigint handler
dhood Mar 22, 2017
ec77ffe
Not using boost::shared_ptr
dhood Mar 22, 2017
67f23b7
Appropriate boost header for recursive_mutex
dhood Mar 23, 2017
09a9ad0
Shared ptrs everywhere
dhood Mar 23, 2017
13464e5
Use new durationFromSec tf2 function
dhood Mar 23, 2017
8c53751
Subscribers using qos settings
dhood Mar 23, 2017
a50c25f
Leftover missing ::msg
dhood Mar 23, 2017
95bdced
Use new tf2_ros::fromMsg
dhood Mar 23, 2017
7338c47
Reinstate node ptr
dhood Mar 23, 2017
8488a04
Disable most logging
dhood Mar 23, 2017
7565b95
chrono fix
dhood Mar 24, 2017
dc24ace
'msg.' -> 'msg->'
dhood Mar 24, 2017
fa0c848
Store node
dhood Mar 24, 2017
ea5fb1d
Create services properly
dhood Mar 24, 2017
67dd366
Set parameters
dhood Mar 24, 2017
97cfb2a
Comment more logging
dhood Mar 24, 2017
28c111b
tf2 fixes
dhood Mar 24, 2017
f736aa8
fix service callback signatures
dhood Mar 31, 2017
be56a00
tf2 changes
dhood Mar 31, 2017
882b26b
misc
dhood Mar 31, 2017
b170431
only callbacks use shared_ptr
dhood Mar 31, 2017
7cb699d
map request service
dhood Mar 31, 2017
cf88427
Fix boost link error
dhood Apr 4, 2017
dcf6f44
Comment these for now just to move forward
dhood Apr 4, 2017
4e161e2
Use ament_auto_package
dhood Apr 20, 2017
083e5c0
tf2::Duration -> tf2::durationFromSec
dhood Apr 20, 2017
06d17a0
Re-enable "logging"
dhood Apr 20, 2017
cfd3aeb
Prevent node already added to executor crash
dhood May 12, 2017
2f108ff
(hack) use 'latest' TF info
dhood Jun 6, 2017
10e336e
Debug
dhood Jun 9, 2017
e68a5d8
Fixup (whitespace etc)
dhood Jun 13, 2017
1cf5522
Use rate for map request
dhood Jun 13, 2017
a22cce4
Don't use tf2 time for checkLaserReceived timer
dhood Jun 13, 2017
7bde846
Clarify which TODOs are for before merge
dhood Jun 13, 2017
d7fdd86
Add wait_for_service
dhood Jun 13, 2017
d90451c
Restore initial qos choices
dhood Jun 13, 2017
3b75291
Restore tolerance
dhood Jun 13, 2017
76d6efb
Demo ROS 1 launch file to be used with bridge
dhood Jun 14, 2017
46865f8
[hack] Use map from topic instead of service
dhood Jun 14, 2017
4727e38
Remove debug prints
dhood Jun 14, 2017
27405c1
It probably won't be the map server publishing the map topic in that …
dhood Jun 14, 2017
d45a213
Expose use_map_topic as command line option
dhood Jun 15, 2017
56d07cd
Put initial pose back to 0 (can be set on 'initialpose' topic)
dhood Jun 15, 2017
4de64c6
Use tf2 time because ROS times can't be subtracted a.t.m.
dhood Jun 15, 2017
ba59f17
Revert test tolerance increase (needed for use without message filters)
dhood Jun 15, 2017
e5e0c0b
Remove commented delete that will never be re-enabled
dhood Jun 15, 2017
c77cf14
Tidy up workaround for 'latest' TF data
dhood Jun 15, 2017
bb226e8
Remove most workarounds for 'latest' TF data
dhood Jun 15, 2017
e624b1f
Prevent unused variable warnings
dhood Jun 15, 2017
dfca917
Remove boost dependency
dhood Jun 15, 2017
bcada23
Use CMAKE_CXX_STANDARD
dhood Jun 15, 2017
c7d72f8
Alphabetical ordering
dhood Jun 15, 2017
76f722d
Whitespace fixup
dhood Jun 15, 2017
7167176
Leftover debug prints
dhood Jun 15, 2017
ff2e4d7
Restore original default d_thresh
dhood Jun 15, 2017
0371290
Revert "Prevent unused variable warnings"
dhood Jun 15, 2017
be5d890
Prevent unused variable warnings
dhood Jun 15, 2017
dd5a552
Let ament_cmake_ros have control over the BUILD_SHARED_LIBS cmake flag
dhood Jun 15, 2017
2abf7f2
Pedantic is a bit much
dhood Jun 15, 2017
105fcb3
simplify ament_target_dependencies call
dhood Jun 15, 2017
e34e097
Correct usage of ament_target_dependencies
dhood Jun 15, 2017
3b804a3
Remove custom leading forward slash removal
dhood Jun 15, 2017
a63b203
Remove ROS 1 testing launch file
dhood Jun 16, 2017
033ac06
Avoid race condition with map_server topic usage
dhood Jun 16, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file removed amcl/AMENT_IGNORE
Empty file.
207 changes: 104 additions & 103 deletions amcl/CMakeLists.txt
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()
42 changes: 33 additions & 9 deletions amcl/package.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<package>
<package format="2">
Copy link
Member

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?

<name>amcl</name>
<version>1.14.0</version>
<description>
Expand All @@ -20,22 +20,46 @@
<maintainer email="mferguson@fetchrobotics.com">Michael Ferguson</maintainer>
<license>LGPL</license>

<buildtool_depend>catkin</buildtool_depend>
<buildtool_depend>ament_cmake_auto</buildtool_depend>
<buildtool_depend>ament_cmake_ros</buildtool_depend>

<!--
<build_depend>rosbag</build_depend>
<build_depend>dynamic_reconfigure</build_depend>
<build_depend>message_filters</build_depend>
<build_depend>rostest</build_depend>
-->
<build_depend>geometry_msgs</build_depend>
<build_depend>nav_msgs</build_depend>
<build_depend>roscpp</build_depend>
<build_depend>rclcpp</build_depend>
<build_depend>rcutils</build_depend>
<build_depend>rostest</build_depend>
<build_depend>sensor_msgs</build_depend>
<build_depend>std_srvs</build_depend>
<build_depend>tf</build_depend>
<build_depend>tf2</build_depend>
<build_depend>tf2_geometry_msgs</build_depend>
<build_depend>tf2_msgs</build_depend>
<build_depend>tf2_ros</build_depend>

<run_depend>rosbag</run_depend>
<run_depend>roscpp</run_depend>
<run_depend>dynamic_reconfigure</run_depend>
<run_depend>tf</run_depend>
<run_depend>nav_msgs</run_depend>
<!--
<exec_depend>rosbag</exec_depend>
<exec_depend>dynamic_reconfigure</exec_depend>
-->
<exec_depend>geometry_msgs</exec_depend>
<exec_depend>nav_msgs</exec_depend>
<exec_depend>nav_msgs</exec_depend>
<exec_depend>rclcpp</exec_depend>
<exec_depend>rcutils</exec_depend>
<exec_depend>sensor_msgs</exec_depend>
<exec_depend>std_srvs</exec_depend>
<exec_depend>tf2</exec_depend>
<exec_depend>tf2_geometry_msgs</exec_depend>
<exec_depend>tf2_msgs</exec_depend>
<exec_depend>tf2_ros</exec_depend>

<test_depend>map_server</test_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>
1 change: 1 addition & 0 deletions amcl/src/amcl/map/map.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ void map_free(map_t *map)
// Get the cell at the given point
map_cell_t *map_get_cell(map_t *map, double ox, double oy, double oa)
{
(void)oa;
int i, j;
map_cell_t *cell;

Expand Down
4 changes: 2 additions & 2 deletions amcl/src/amcl/pf/pf.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ int pf_update_converged(pf_t *pf)
int i;
pf_sample_set_t *set;
pf_sample_t *sample;
double total;

set = pf->sets + pf->current_set;
double mean_x = 0, mean_y = 0;
Expand Down Expand Up @@ -472,8 +471,9 @@ int pf_resample_limit(pf_t *pf, int k)


// Re-compute the cluster statistics for a sample set
void pf_cluster_stats(pf_t *pf, pf_sample_set_t *set)
void pf_cluster_stats(pf_t * pf, pf_sample_set_t *set)
{
(void)pf;
int i, j, k, cidx;
pf_sample_t *sample;
pf_cluster_t *cluster;
Expand Down
1 change: 1 addition & 0 deletions amcl/src/amcl/pf/pf_kdtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ int pf_kdtree_get_cluster(pf_kdtree_t *self, pf_vector_t pose)
// Compare keys to see if they are equal
int pf_kdtree_equal(pf_kdtree_t *self, int key_a[], int key_b[])
{
(void)self;
//double a, b;

if (key_a[0] != key_b[0])
Expand Down
6 changes: 6 additions & 0 deletions amcl/src/amcl/sensors/amcl_sensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ AMCLSensor::~AMCLSensor()
// Apply the action model
bool AMCLSensor::UpdateAction(pf_t *pf, AMCLSensorData *data)
{
(void)pf;
(void)data;
return false;
}

Expand All @@ -55,6 +57,8 @@ bool AMCLSensor::UpdateAction(pf_t *pf, AMCLSensorData *data)
// Initialize the filter
bool AMCLSensor::InitSensor(pf_t *pf, AMCLSensorData *data)
{
(void)pf;
(void)data;
return false;
}

Expand All @@ -63,6 +67,8 @@ bool AMCLSensor::InitSensor(pf_t *pf, AMCLSensorData *data)
// Apply the sensor model
bool AMCLSensor::UpdateSensor(pf_t *pf, AMCLSensorData *data)
{
(void)pf;
(void)data;
return false;
}

Expand Down
Loading