Question: C++ Alpha Beta Filter Class Two other classes - GPS and Satellite are already done, found here: http://www.codesend.com/view/179480fd293f7da3a314e80c20cadde6/ Stuck on the alpha beta filter class,
C++ Alpha Beta Filter Class
Two other classes - GPS and Satellite are already done, found here: http://www.codesend.com/view/179480fd293f7da3a314e80c20cadde6/ Stuck on the alpha beta filter class, pasted below. Only use the given functions and parameters. Comments include what each must do. No consutructors are used (only default). Thanks
#include
class AlphaBetaFilter
{
public:
void setAlphaBeta(double a, double b);
void inializeState(double x, double y, double vx, double vy);
void update(double dt, double x, double y)
std::pair
};
void AlphaBetaFilter::setAlphaBeta(double a, double b);
{
//sets the alpha and beta members of the class to a and b respectively
}
void AlphaBetaFilter::inializeState(double x, double y, double vx, double vy);
{
//sets the x and and y position and velocity to the input values
}
void AlphaBetaFilter::update(double dt, double x, double y)
{
/* uses the input time differential dt and input signals x and y to
*update the state of the filter.
*this is done by doing the following:
*i. update the xpos and ypos by adding in their respective
* velocities multiplied by the time differential.
*ii. compute a new double named r, and set it equal to x -
* xpos.
*iii. update xpos by adding into it alpha multiplied by r.
*iv. update xvel by adding into it beta multiplied by r divided by
* dt.
*v. recompute r, set it equal to y - ypos
*vi. update ypos by adding into it alpha multiplied by r.
*vii. update yvel by adding into it beta multiplied by r divided by
* dt.
*/
}
std::pair
{
/* uses the input time differential dt and input signals x and y to
update the state of the filter.
we will simply: return {xpos, ypos}; to construct a new std::pair
object with the necessary parameters */
return {xpos, ypos};
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
