Skip to content

Commit

Permalink
Improve matrix library usage
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilritz authored and bresch committed Apr 25, 2020
1 parent 5749273 commit 050298f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
include(ExternalProject)
ExternalProject_Add(matrix
GIT_REPOSITORY "https://github.com/PX4/Matrix.git"
GIT_TAG d18be0d0fa17d9a0b60ab34bad3e33160f907b09
GIT_TAG d613055462bcbeacfd188cbd53de56c1dbc7b94d
UPDATE_COMMAND ""
PATCH_COMMAND ""
CONFIGURE_COMMAND ""
Expand Down
12 changes: 4 additions & 8 deletions EKF/ekf_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,9 @@ void Ekf::resetHorizontalVelocityTo(const Vector2f &new_horz_vel) {
_state.vel.xy() = new_horz_vel;

for (uint8_t index = 0; index < _output_buffer.get_length(); index++) {
_output_buffer[index].vel(0) += delta_horz_vel(0);
_output_buffer[index].vel(1) += delta_horz_vel(1);
_output_buffer[index].vel.xy() += delta_horz_vel;
}
_output_new.vel(0) += delta_horz_vel(0);
_output_new.vel(1) += delta_horz_vel(1);
_output_new.vel.xy() += delta_horz_vel;

_state_reset_status.velNE_change = delta_horz_vel;
_state_reset_status.velNE_counter++;
Expand Down Expand Up @@ -193,11 +191,9 @@ void Ekf::resetHorizontalPositionTo(const Vector2f &new_horz_pos) {
_state.pos.xy() = new_horz_pos;

for (uint8_t index = 0; index < _output_buffer.get_length(); index++) {
_output_buffer[index].pos(0) += delta_horz_pos(0);
_output_buffer[index].pos(1) += delta_horz_pos(1);
_output_buffer[index].pos.xy() += delta_horz_pos;
}
_output_new.pos(0) += delta_horz_pos(0);
_output_new.pos(1) += delta_horz_pos(1);
_output_new.pos.xy() += delta_horz_pos;

_state_reset_status.posNE_change = delta_horz_pos;
_state_reset_status.posNE_counter++;
Expand Down

0 comments on commit 050298f

Please sign in to comment.