Skip to content

Make code useable from C++ #2

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions gps.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
#include <stdio.h>
#include "kalman.h"

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus

/* Create a GPS filter that only tracks two dimensions of position and
velocity.
The inherent assumption is that changes in velocity are randomly
Expand Down Expand Up @@ -56,4 +60,8 @@ double calculate_mph(double lat, double lon,
/* Extract speed in miles per hour from a velocity2d Kalman filter. */
double get_mph(KalmanFilter f);

#ifdef __cplusplus
}
#endif // __cplusplus

#endif
8 changes: 8 additions & 0 deletions kalman.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

#include "matrix.h"

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus

/* Refer to http://en.wikipedia.org/wiki/Kalman_filter for
mathematical details. The naming scheme is that variables get names
that make sense, and are commented with their analog in
Expand Down Expand Up @@ -86,4 +90,8 @@ void predict(KalmanFilter f);
/* Just the estimation phase of update. */
void estimate(KalmanFilter f);

#ifdef __cplusplus
}
#endif // __cplusplus

#endif
8 changes: 8 additions & 0 deletions matrix.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#ifndef __MATRIX_H__
#define __MATRIX_H__

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus

typedef struct {
/* Dimensions */
int rows;
Expand Down Expand Up @@ -73,4 +77,8 @@ void shear_row(Matrix m, int r1, int r2, double scalar);
input is mutated as well by this routine. */
int destructive_invert_matrix(Matrix input, Matrix output);

#ifdef __cplusplus
}
#endif // __cplusplus

#endif