att_pos_estimator_ekf: fixes, mathlib: minor changes

This commit is contained in:
Anton Babushkin
2013-12-23 22:34:11 +04:00
parent 5a2da77758
commit a26e46bede
4 changed files with 34 additions and 10 deletions
+12 -3
View File
@@ -241,19 +241,28 @@ public:
}
/**
* setup the identity matrix
* set zero matrix
*/
void zero(void) {
memset(data, 0, sizeof(data));
}
/**
* set identity matrix
*/
void identity(void) {
memset(data, 0, sizeof(data));
for (unsigned int i = 0; i < M; i++)
unsigned int n = (M < N) ? M : N;
for (unsigned int i = 0; i < n; i++)
data[i][i] = 1;
}
void print(void) {
for (unsigned int i = 0; i < M; i++) {
printf("[ ");
for (unsigned int j = 0; j < N; j++)
printf("%.3f\t", data[i][j]);
printf("\n");
printf(" ]\n");
}
}
};
+7
View File
@@ -259,6 +259,13 @@ public:
return *this / length();
}
/**
* set zero vector
*/
void zero(void) {
memset(data, 0, sizeof(data));
}
void print(void) {
printf("[ ");
for (unsigned int i = 0; i < N; i++)