Skip to content

Error state kalman filter #564

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

Draft
wants to merge 20 commits into
base: main
Choose a base branch
from
Draft

Conversation

Talhanc
Copy link
Contributor

@Talhanc Talhanc commented Apr 3, 2025

No description provided.

@Talhanc Talhanc linked an issue Apr 3, 2025 that may be closed by this pull request
3 tasks
@Talhanc Talhanc marked this pull request as draft April 3, 2025 17:21
Copy link

codecov bot commented Apr 3, 2025

Codecov Report

Attention: Patch coverage is 0% with 258 lines in your changes missing coverage. Please review.

Project coverage is 5.89%. Comparing base (00b09ea) to head (ea29da3).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
navigation/eskf/src/eskf.cpp 0.00% 134 Missing ⚠️
navigation/eskf/src/eskf_ros.cpp 0.00% 81 Missing ⚠️
navigation/eskf/src/eskf_utils.cpp 0.00% 20 Missing ⚠️
navigation/eskf/include/eskf/typedefs.hpp 0.00% 17 Missing ⚠️
navigation/eskf/src/eskf_node.cpp 0.00% 6 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##            main    #564      +/-   ##
========================================
- Coverage   6.61%   5.89%   -0.72%     
========================================
  Files         37      42       +5     
  Lines       2117    2375     +258     
  Branches      50      52       +2     
========================================
  Hits         140     140              
- Misses      1977    2235     +258     
Flag Coverage Δ
unittests 5.89% <0.00%> (-0.72%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
navigation/eskf/src/eskf_node.cpp 0.00% <0.00%> (ø)
navigation/eskf/include/eskf/typedefs.hpp 0.00% <0.00%> (ø)
navigation/eskf/src/eskf_utils.cpp 0.00% <0.00%> (ø)
navigation/eskf/src/eskf_ros.cpp 0.00% <0.00%> (ø)
navigation/eskf/src/eskf.cpp 0.00% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Andeshog Andeshog requested a review from Copilot April 4, 2025 06:38
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 16 out of 18 changed files in this pull request and generated 2 comments.

Files not reviewed (2)
  • navigation/eskf/CMakeLists.txt: Language not supported
  • navigation/eskf/package.xml: Language not supported

Comment on lines 28 to 29
for i in range(n):
for j in range(n // 2):
Copy link
Preview

Copilot AI Apr 4, 2025

Choose a reason for hiding this comment

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

The indexing in the generate_T_matrix function appears to use negative indices (e.g., 'i - 1' when i is 0), which may lead to unintended behavior. Consider revising the loop indices to start at 1 or adjust the indexing logic accordingly.

Suggested change
for i in range(n):
for j in range(n // 2):
for i in range(1, n + 1):
for j in range(1, (n // 2) + 1):

Copilot uses AI. Check for mistakes.

start_time = time.time()
estimated_state = ukf.unscented_transform(estimated_state)
print(estimated_state.as_vector())
break
Copy link
Preview

Copilot AI Apr 4, 2025

Choose a reason for hiding this comment

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

The break statement in the simulation loop terminates the loop prematurely, preventing the full simulation from executing. It is likely unintended and should be removed or repositioned to allow complete simulation execution.

Suggested change
break

Copilot uses AI. Check for mistakes.

Copy link
Contributor

@jorgenfj jorgenfj left a comment

Choose a reason for hiding this comment

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

Would be nice if odom is pubilshed in body(base_link) fame accompanied by a dynamic tf2 transform from odom to base_link.


void correct() {
Eigen::Matrix3d R_nb;
R_nb << 0, 0, -1, 0, -1, 0, -1, 0, 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe expose this rotation as ros params for when the dvl mount is altered

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is still some issue here, but yes that is the goal

Copy link
Contributor Author

Choose a reason for hiding this comment

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

*s

Copy link
Member

Choose a reason for hiding this comment

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

Im still fighting for "Set the frame assumptions internally and correct on the outside" - I.e. use TF2 on the ros side.

The TLDR is: You will fuck up transforms when rolling it yourself, so better let TF handle it and just make sure to use it properly

@kluge7 kluge7 changed the title Feeterror state kalman filter Error state kalman filter Apr 5, 2025
Comment on lines +20 to +25

// @brief Update the nominal state and error state
// @param dvl_meas: DVL measurement
// @return Updated nominal state and error state
std::pair<state_quat, state_euler> dvl_update(
const dvl_measurement& dvl_meas);
Copy link
Member

Choose a reason for hiding this comment

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

We talked about generalizing away specific sensors for any update methods - is that still a go?

I think it would be really nice to write the eskf as a library, and have the user provide the spec for whatever sensor they bring.

You could call it PO, but having seen how many kalman filters have been written over the years, it would be really clean to have this be the go-to solution for years to come 🙏

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, its the end goal, just making it work properly for the thesis now, but will be the next step before merge :)

@chrstrom
Copy link
Member

chrstrom commented May 8, 2025

image

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.

[TASK] Implement ESKF for sensor fusion of DVL and IMU
4 participants