Skip to content
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

Speed-up global localization #248

Merged
merged 7 commits into from
Aug 2, 2019
Merged

Speed-up global localization #248

merged 7 commits into from
Aug 2, 2019

Conversation

at-wat
Copy link
Owner

@at-wat at-wat commented Aug 1, 2019

for #247
Roughly 15% of time in the example #247 (comment) is reduced.

@at-wat at-wat self-assigned this Aug 1, 2019
@at-wat
Copy link
Owner Author

at-wat commented Aug 1, 2019

[#646] FAILED on kinetic

catkin_make failed


[#646] PASSED on melodic

All tests passed
build/test_results/mcl_3dl/gtest-test_chunked_kdtree.xml: 1 tests
build/test_results/mcl_3dl/gtest-test_filter.xml: 3 tests
build/test_results/mcl_3dl/gtest-test_imu_measurement_model_gravity.xml: 1 tests
build/test_results/mcl_3dl/gtest-test_motion_prediction_model_differential_drive.xml: 4 tests
build/test_results/mcl_3dl/gtest-test_nd.xml: 2 tests
build/test_results/mcl_3dl/gtest-test_pf.xml: 6 tests
build/test_results/mcl_3dl/gtest-test_point_cloud_random_sampler.xml: 1 tests
build/test_results/mcl_3dl/gtest-test_point_types.xml: 1 tests
build/test_results/mcl_3dl/gtest-test_quat.xml: 4 tests
build/test_results/mcl_3dl/gtest-test_raycast.xml: 3 tests
build/test_results/mcl_3dl/gtest-test_state_6dof.xml: 3 tests
build/test_results/mcl_3dl/gtest-test_vec3.xml: 5 tests
build/test_results/mcl_3dl/roslint-mcl_3dl.xml: 1 tests
build/test_results/mcl_3dl/rostest-localization_rostest__without_imu_true.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_debug_output_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_expansion_resetting_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_global_localization_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_landmark_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_localization_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_mcl_3dl_compat_incompatible_rostest.xml: 2 tests
build/test_results/mcl_3dl/rostest-test_tests_mcl_3dl_compat_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_tf_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_transform_rostest.xml: 1 tests
build/test_results/mcl_3dl/rosunit-compare_pose.xml: 1 tests
build/test_results/mcl_3dl/rosunit-compare_tf.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_debug_output.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_expansion_resetting.xml: 2 tests
build/test_results/mcl_3dl/rosunit-test_global_localization.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_landmark.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_mcl_3dl_compat.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_mcl_3dl_compat_incompatible.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_mcl_3dl_compat_incompatible2.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_transform_failure.xml: 1 tests
Summary: 57 tests, 0 errors, 0 failures, 0 skipped

CMakeLists.txt Outdated
@@ -34,7 +34,7 @@ catkin_package(
)


add_compile_options(-std=c++11)
add_compile_options(-std=c++17)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

c++17 is not ready on kinetic environment

@codecov-io
Copy link

codecov-io commented Aug 1, 2019

Codecov Report

Merging #248 into master will increase coverage by 0.13%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #248      +/-   ##
==========================================
+ Coverage   94.22%   94.36%   +0.13%     
==========================================
  Files          25       21       -4     
  Lines        1559     1491      -68     
==========================================
- Hits         1469     1407      -62     
+ Misses         90       84       -6
Impacted Files Coverage Δ
include/mcl_3dl/chunked_kdtree.h 94.93% <100%> (ø) ⬆️
include/mcl_3dl/pf.h 97.67% <100%> (+0.11%) ⬆️
src/mcl_3dl.cpp 92.46% <100%> (+0.04%) ⬆️
include/mcl_3dl/raycast.h 100% <0%> (ø) ⬆️
include/mcl_3dl/lidar_measurement_model_base.h
include/mcl_3dl/motion_prediction_model_base.h
include/mcl_3dl/imu_measurement_model_base.h
include/pcl18_backports/voxel_grid.h

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 18a8828...007ad29. Read the comment docs.

@at-wat
Copy link
Owner Author

at-wat commented Aug 1, 2019

[#647] FAILED on kinetic

catkin_make failed


[#647] PASSED on melodic

All tests passed
build/test_results/mcl_3dl/gtest-test_chunked_kdtree.xml: 1 tests
build/test_results/mcl_3dl/gtest-test_filter.xml: 3 tests
build/test_results/mcl_3dl/gtest-test_imu_measurement_model_gravity.xml: 1 tests
build/test_results/mcl_3dl/gtest-test_motion_prediction_model_differential_drive.xml: 4 tests
build/test_results/mcl_3dl/gtest-test_nd.xml: 2 tests
build/test_results/mcl_3dl/gtest-test_pf.xml: 6 tests
build/test_results/mcl_3dl/gtest-test_point_cloud_random_sampler.xml: 1 tests
build/test_results/mcl_3dl/gtest-test_point_types.xml: 1 tests
build/test_results/mcl_3dl/gtest-test_quat.xml: 4 tests
build/test_results/mcl_3dl/gtest-test_raycast.xml: 3 tests
build/test_results/mcl_3dl/gtest-test_state_6dof.xml: 3 tests
build/test_results/mcl_3dl/gtest-test_vec3.xml: 5 tests
build/test_results/mcl_3dl/roslint-mcl_3dl.xml: 1 tests
build/test_results/mcl_3dl/rostest-localization_rostest__without_imu_true.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_debug_output_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_expansion_resetting_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_global_localization_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_landmark_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_localization_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_mcl_3dl_compat_incompatible_rostest.xml: 2 tests
build/test_results/mcl_3dl/rostest-test_tests_mcl_3dl_compat_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_tf_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_transform_rostest.xml: 1 tests
build/test_results/mcl_3dl/rosunit-compare_pose.xml: 1 tests
build/test_results/mcl_3dl/rosunit-compare_tf.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_debug_output.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_expansion_resetting.xml: 2 tests
build/test_results/mcl_3dl/rosunit-test_global_localization.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_landmark.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_mcl_3dl_compat.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_mcl_3dl_compat_incompatible.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_mcl_3dl_compat_incompatible2.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_transform_failure.xml: 1 tests
Summary: 57 tests, 0 errors, 0 failures, 0 skipped

@at-wat
Copy link
Owner Author

at-wat commented Aug 1, 2019

[#648] PASSED on kinetic

All tests passed
build/test_results/mcl_3dl/gtest-test_chunked_kdtree.xml: 1 tests
build/test_results/mcl_3dl/gtest-test_filter.xml: 3 tests
build/test_results/mcl_3dl/gtest-test_imu_measurement_model_gravity.xml: 1 tests
build/test_results/mcl_3dl/gtest-test_motion_prediction_model_differential_drive.xml: 4 tests
build/test_results/mcl_3dl/gtest-test_nd.xml: 2 tests
build/test_results/mcl_3dl/gtest-test_pf.xml: 6 tests
build/test_results/mcl_3dl/gtest-test_point_cloud_random_sampler.xml: 1 tests
build/test_results/mcl_3dl/gtest-test_point_types.xml: 1 tests
build/test_results/mcl_3dl/gtest-test_quat.xml: 4 tests
build/test_results/mcl_3dl/gtest-test_raycast.xml: 3 tests
build/test_results/mcl_3dl/gtest-test_state_6dof.xml: 3 tests
build/test_results/mcl_3dl/gtest-test_vec3.xml: 5 tests
build/test_results/mcl_3dl/roslint-mcl_3dl.xml: 1 tests
build/test_results/mcl_3dl/rostest-localization_rostest__without_imu_true.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_debug_output_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_expansion_resetting_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_global_localization_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_landmark_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_localization_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_mcl_3dl_compat_incompatible_rostest.xml: 2 tests
build/test_results/mcl_3dl/rostest-test_tests_mcl_3dl_compat_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_tf_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_transform_rostest.xml: 1 tests
build/test_results/mcl_3dl/rosunit-compare_pose.xml: 1 tests
build/test_results/mcl_3dl/rosunit-compare_tf.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_debug_output.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_expansion_resetting.xml: 2 tests
build/test_results/mcl_3dl/rosunit-test_global_localization.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_landmark.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_mcl_3dl_compat.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_mcl_3dl_compat_incompatible.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_mcl_3dl_compat_incompatible2.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_transform_failure.xml: 1 tests
Summary: 57 tests, 0 errors, 0 failures, 0 skipped

[#648] PASSED on melodic

All tests passed
build/test_results/mcl_3dl/gtest-test_chunked_kdtree.xml: 1 tests
build/test_results/mcl_3dl/gtest-test_filter.xml: 3 tests
build/test_results/mcl_3dl/gtest-test_imu_measurement_model_gravity.xml: 1 tests
build/test_results/mcl_3dl/gtest-test_motion_prediction_model_differential_drive.xml: 4 tests
build/test_results/mcl_3dl/gtest-test_nd.xml: 2 tests
build/test_results/mcl_3dl/gtest-test_pf.xml: 6 tests
build/test_results/mcl_3dl/gtest-test_point_cloud_random_sampler.xml: 1 tests
build/test_results/mcl_3dl/gtest-test_point_types.xml: 1 tests
build/test_results/mcl_3dl/gtest-test_quat.xml: 4 tests
build/test_results/mcl_3dl/gtest-test_raycast.xml: 3 tests
build/test_results/mcl_3dl/gtest-test_state_6dof.xml: 3 tests
build/test_results/mcl_3dl/gtest-test_vec3.xml: 5 tests
build/test_results/mcl_3dl/roslint-mcl_3dl.xml: 1 tests
build/test_results/mcl_3dl/rostest-localization_rostest__without_imu_true.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_debug_output_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_expansion_resetting_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_global_localization_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_landmark_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_localization_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_mcl_3dl_compat_incompatible_rostest.xml: 2 tests
build/test_results/mcl_3dl/rostest-test_tests_mcl_3dl_compat_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_tf_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_transform_rostest.xml: 1 tests
build/test_results/mcl_3dl/rosunit-compare_pose.xml: 1 tests
build/test_results/mcl_3dl/rosunit-compare_tf.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_debug_output.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_expansion_resetting.xml: 2 tests
build/test_results/mcl_3dl/rosunit-test_global_localization.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_landmark.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_mcl_3dl_compat.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_mcl_3dl_compat_incompatible.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_mcl_3dl_compat_incompatible2.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_transform_failure.xml: 1 tests
Summary: 57 tests, 0 errors, 0 failures, 0 skipped

@at-wat at-wat requested a review from nhatao August 2, 2019 01:48
@at-wat
Copy link
Owner Author

at-wat commented Aug 2, 2019

@nhatao please take a look

Copy link
Collaborator

@nhatao nhatao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Only a minor comment was added.

p_sum = 0;
for (auto& p : particles_)

const size_t num =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable name "num" is too vague.
In addition, because it is used only in if-block in L304, It is better to move this within that if-block.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed 👍

@at-wat
Copy link
Owner Author

at-wat commented Aug 2, 2019

[#649] PASSED on melodic

All tests passed
build/test_results/mcl_3dl/gtest-test_chunked_kdtree.xml: 1 tests
build/test_results/mcl_3dl/gtest-test_filter.xml: 3 tests
build/test_results/mcl_3dl/gtest-test_imu_measurement_model_gravity.xml: 1 tests
build/test_results/mcl_3dl/gtest-test_motion_prediction_model_differential_drive.xml: 4 tests
build/test_results/mcl_3dl/gtest-test_nd.xml: 2 tests
build/test_results/mcl_3dl/gtest-test_pf.xml: 6 tests
build/test_results/mcl_3dl/gtest-test_point_cloud_random_sampler.xml: 1 tests
build/test_results/mcl_3dl/gtest-test_point_types.xml: 1 tests
build/test_results/mcl_3dl/gtest-test_quat.xml: 4 tests
build/test_results/mcl_3dl/gtest-test_raycast.xml: 3 tests
build/test_results/mcl_3dl/gtest-test_state_6dof.xml: 3 tests
build/test_results/mcl_3dl/gtest-test_vec3.xml: 5 tests
build/test_results/mcl_3dl/roslint-mcl_3dl.xml: 1 tests
build/test_results/mcl_3dl/rostest-localization_rostest__without_imu_true.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_debug_output_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_expansion_resetting_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_global_localization_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_landmark_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_localization_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_mcl_3dl_compat_incompatible_rostest.xml: 2 tests
build/test_results/mcl_3dl/rostest-test_tests_mcl_3dl_compat_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_tf_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_transform_rostest.xml: 1 tests
build/test_results/mcl_3dl/rosunit-compare_pose.xml: 1 tests
build/test_results/mcl_3dl/rosunit-compare_tf.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_debug_output.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_expansion_resetting.xml: 2 tests
build/test_results/mcl_3dl/rosunit-test_global_localization.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_landmark.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_mcl_3dl_compat.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_mcl_3dl_compat_incompatible.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_mcl_3dl_compat_incompatible2.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_transform_failure.xml: 1 tests
Summary: 57 tests, 0 errors, 0 failures, 0 skipped

[#649] PASSED on kinetic

All tests passed
build/test_results/mcl_3dl/gtest-test_chunked_kdtree.xml: 1 tests
build/test_results/mcl_3dl/gtest-test_filter.xml: 3 tests
build/test_results/mcl_3dl/gtest-test_imu_measurement_model_gravity.xml: 1 tests
build/test_results/mcl_3dl/gtest-test_motion_prediction_model_differential_drive.xml: 4 tests
build/test_results/mcl_3dl/gtest-test_nd.xml: 2 tests
build/test_results/mcl_3dl/gtest-test_pf.xml: 6 tests
build/test_results/mcl_3dl/gtest-test_point_cloud_random_sampler.xml: 1 tests
build/test_results/mcl_3dl/gtest-test_point_types.xml: 1 tests
build/test_results/mcl_3dl/gtest-test_quat.xml: 4 tests
build/test_results/mcl_3dl/gtest-test_raycast.xml: 3 tests
build/test_results/mcl_3dl/gtest-test_state_6dof.xml: 3 tests
build/test_results/mcl_3dl/gtest-test_vec3.xml: 5 tests
build/test_results/mcl_3dl/roslint-mcl_3dl.xml: 1 tests
build/test_results/mcl_3dl/rostest-localization_rostest__without_imu_true.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_debug_output_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_expansion_resetting_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_global_localization_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_landmark_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_localization_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_mcl_3dl_compat_incompatible_rostest.xml: 2 tests
build/test_results/mcl_3dl/rostest-test_tests_mcl_3dl_compat_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_tf_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_transform_rostest.xml: 1 tests
build/test_results/mcl_3dl/rosunit-compare_pose.xml: 1 tests
build/test_results/mcl_3dl/rosunit-compare_tf.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_debug_output.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_expansion_resetting.xml: 2 tests
build/test_results/mcl_3dl/rosunit-test_global_localization.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_landmark.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_mcl_3dl_compat.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_mcl_3dl_compat_incompatible.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_mcl_3dl_compat_incompatible2.xml: 1 tests
build/test_results/mcl_3dl/rosunit-test_transform_failure.xml: 1 tests
Summary: 57 tests, 0 errors, 0 failures, 0 skipped

@at-wat at-wat merged commit b435209 into master Aug 2, 2019
@at-wat at-wat deleted the speedup-global-localization branch August 2, 2019 03:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants