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

Fix reported entropy #408

Merged
merged 5 commits into from
Nov 14, 2023
Merged

Fix reported entropy #408

merged 5 commits into from
Nov 14, 2023

Conversation

f-fl0
Copy link
Collaborator

@f-fl0 f-fl0 commented Nov 14, 2023

With the current implementation on the master branch, the entropy of the particle filter seems to be always calculated after resampling or resizing the number of particles which reset each particle probability to 1 / num_particles. Thus the reported entropy is always the same. In this PR, this quantity is calculated in the measure function to represent the entropy of the particle filter right after the particles probabilities are updated based on the measurement likelihood.

@f-fl0 f-fl0 requested a review from at-wat November 14, 2023 07:30
@at-wat
Copy link
Owner

at-wat commented Nov 14, 2023

[147] PASSED on noetic

All tests passed
build/test_results/mcl_3dl/gtest-test_chunked_kdtree.xml: 2 tests
build/test_results/mcl_3dl/gtest-test_cloud_accum.xml: 4 tests
build/test_results/mcl_3dl/gtest-test_filter.xml: 6 tests
build/test_results/mcl_3dl/gtest-test_imu_measurement_model_gravity.xml: 2 tests
build/test_results/mcl_3dl/gtest-test_motion_prediction_model_differential_drive.xml: 8 tests
build/test_results/mcl_3dl/gtest-test_nd.xml: 4 tests
build/test_results/mcl_3dl/gtest-test_noise_generator.xml: 6 tests
build/test_results/mcl_3dl/gtest-test_pf.xml: 12 tests
build/test_results/mcl_3dl/gtest-test_point_cloud_random_sampler.xml: 2 tests
build/test_results/mcl_3dl/gtest-test_point_cloud_random_sampler_with_normal.xml: 2 tests
build/test_results/mcl_3dl/gtest-test_point_types.xml: 2 tests
build/test_results/mcl_3dl/gtest-test_quat.xml: 8 tests
build/test_results/mcl_3dl/gtest-test_raycast.xml: 6 tests
build/test_results/mcl_3dl/gtest-test_raycast_dda.xml: 8 tests
build/test_results/mcl_3dl/gtest-test_state_6dof.xml: 6 tests
build/test_results/mcl_3dl/gtest-test_vec3.xml: 10 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_beam_label_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_beam_likelihood_rostest.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_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: 2 tests
build/test_results/mcl_3dl/rosunit-compare_tf.xml: 2 tests
build/test_results/mcl_3dl/rosunit-test_beam_label.xml: 2 tests
build/test_results/mcl_3dl/rosunit-test_beam_likelihood.xml: 2 tests
build/test_results/mcl_3dl/rosunit-test_debug_output.xml: 2 tests
build/test_results/mcl_3dl/rosunit-test_expansion_resetting.xml: 4 tests
build/test_results/mcl_3dl/rosunit-test_global_localization.xml: 4 tests
build/test_results/mcl_3dl/rosunit-test_landmark.xml: 2 tests
build/test_results/mcl_3dl/rosunit-test_mcl_3dl_compat.xml: 8 tests
build/test_results/mcl_3dl/rosunit-test_transform_failure.xml: 2 tests
Summary: 130 tests, 0 errors, 0 failures, 0 skipped

@codecov-commenter
Copy link

codecov-commenter commented Nov 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (8d8835f) 91.72% compared to head (14acbab) 91.71%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #408      +/-   ##
==========================================
- Coverage   91.72%   91.71%   -0.02%     
==========================================
  Files          30       30              
  Lines        1886     1883       -3     
==========================================
- Hits         1730     1727       -3     
  Misses        156      156              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Owner

@at-wat at-wat left a comment

Choose a reason for hiding this comment

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

It would be nice to have a simple test if it's not too complicated

@f-fl0
Copy link
Collaborator Author

f-fl0 commented Nov 14, 2023

@at-wat I added some simple tests in 14acbab but let me know if you have better suggestions.

@at-wat
Copy link
Owner

at-wat commented Nov 14, 2023

[148] PASSED on noetic

All tests passed
build/test_results/mcl_3dl/gtest-test_chunked_kdtree.xml: 2 tests
build/test_results/mcl_3dl/gtest-test_cloud_accum.xml: 4 tests
build/test_results/mcl_3dl/gtest-test_filter.xml: 6 tests
build/test_results/mcl_3dl/gtest-test_imu_measurement_model_gravity.xml: 2 tests
build/test_results/mcl_3dl/gtest-test_motion_prediction_model_differential_drive.xml: 8 tests
build/test_results/mcl_3dl/gtest-test_nd.xml: 4 tests
build/test_results/mcl_3dl/gtest-test_noise_generator.xml: 6 tests
build/test_results/mcl_3dl/gtest-test_pf.xml: 14 tests
build/test_results/mcl_3dl/gtest-test_point_cloud_random_sampler.xml: 2 tests
build/test_results/mcl_3dl/gtest-test_point_cloud_random_sampler_with_normal.xml: 2 tests
build/test_results/mcl_3dl/gtest-test_point_types.xml: 2 tests
build/test_results/mcl_3dl/gtest-test_quat.xml: 8 tests
build/test_results/mcl_3dl/gtest-test_raycast.xml: 6 tests
build/test_results/mcl_3dl/gtest-test_raycast_dda.xml: 8 tests
build/test_results/mcl_3dl/gtest-test_state_6dof.xml: 6 tests
build/test_results/mcl_3dl/gtest-test_vec3.xml: 10 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_beam_label_rostest.xml: 1 tests
build/test_results/mcl_3dl/rostest-test_tests_beam_likelihood_rostest.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_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: 2 tests
build/test_results/mcl_3dl/rosunit-compare_tf.xml: 2 tests
build/test_results/mcl_3dl/rosunit-test_beam_label.xml: 2 tests
build/test_results/mcl_3dl/rosunit-test_beam_likelihood.xml: 2 tests
build/test_results/mcl_3dl/rosunit-test_debug_output.xml: 2 tests
build/test_results/mcl_3dl/rosunit-test_expansion_resetting.xml: 4 tests
build/test_results/mcl_3dl/rosunit-test_global_localization.xml: 4 tests
build/test_results/mcl_3dl/rosunit-test_landmark.xml: 2 tests
build/test_results/mcl_3dl/rosunit-test_mcl_3dl_compat.xml: 8 tests
build/test_results/mcl_3dl/rosunit-test_transform_failure.xml: 2 tests
Summary: 132 tests, 0 errors, 0 failures, 0 skipped

Copy link
Owner

@at-wat at-wat left a comment

Choose a reason for hiding this comment

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

LGTM

@at-wat at-wat merged commit bbf2e52 into at-wat:master Nov 14, 2023
3 checks passed
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