Skip to content

vinayakkankanwadi/FCND-Estimation-CPP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Estimation Project

The Goal of this Project

In this project, we will be developing an estimator to be used by your controller to successfully fly a desired flight path using realistic sensors.

Writeup

Implement Estimator


Step 1: Sensor Noise

Determine the standard deviation of the measurement noise of both GPS X data and Accelerometer X data.

The calculated standard deviation should correctly capture ~68% of the sensor measurements. Your writeup should describe the method used for determining the standard deviation given the simulated sensor measurements.

- Run simulator using 06_NoisySensors.txt
- Collect Config logs
- Process standard deviation using collected files 
- Updated config/6_Sensornoise.txt with computed MeasuredStdDev_GPSPosXY and MeasuredStdDev_AccelXY
- Run the simulator using update 06_NoisySensors.txt, sensor mesurements should correctly capture ~68%

Values

Before After
Before After

Step 2: Attitude Estimation

Implement a better rate gyro attitude integration scheme in the UpdateFromIMU() function.

The improved integration scheme should result in an attitude estimator of < 0.1 rad for each of the Euler angles for a duration of at least 3 seconds during the simulation. The integration scheme should use quaternions to improve performance over the current simple integration scheme.

- Comment out predictedPitch ,predictedRoll and ekfState(6) to avoid integrating yaw twice
- Use quaternions as integration scheme to improve performance over current simple integration scheme
- Though not Euler angles, Quaternion has IntegrateBodyRate to use.
- Compute predictedPitch, predictedRoll and ekfState(6) using Quaternion Roll, Pitch and Yaw

Before


Step 3: Prediction Step

Implement all of the elements of the prediction step for the estimator.

The prediction step should include the state update element (PredictState() function), a correct calculation of the Rgb prime matrix, and a proper update of the state covariance. The acceleration should be accounted for as a command in the calculation of gPrime. The covariance update should follow the classic EKF update equation.

Predict consist of the following
- PredictState(7 states):
  -- predict x, y, z (3 states)
  -- attitude.Rotate_BtoI(<V3F>) to rotate a vector from body frame to inertial frame
  -- predict x_dot, y_dot, z_dot (3 states)
  -- yaw get updated in IMU code (1 state)
- GetRbgPrime(as indicated by RBGPrime):
  -- This is just a matter of putting the right sin() and cos() functions in the right place.
- Compute GPrime using Transition and Jacobian reference
- Finally compute state covariance
PredictState PredictCovariance
Before After

Step 4: Magnetometer Update

Implement the magnetometer update.

The update should properly include the magnetometer data into the state. Note that the solution should make sure to correctly measure the angle error between the current state and the magnetometer value (error should be the short way around, not the long way).

- Get yaw estimates
- Normalize the difference between your measured and estimated yaw to -pi .. pi
- Update Partial Derivative of Mesurement model hPrime

Before


Step 5: Closed Loop + GPS Update

Implement the GPS update.

The estimator should correctly incorporate the GPS information to update the current state estimate.

GPS

- Get yaw estimates
- Update Partial Derivative hPrime which is identity matrix here

Before


Flight Evaluation

Meet the performance criteria of each step.

For each step of the project, the final estimator should be able to successfully meet the performance criteria with the controller provided. The estimator's parameters should be properly adjusted to satisfy each of the performance criteria elements.

- All scenarios meet the performance criteria, as shown in the previous sections.

Task 6: Adding Own Controller

De-tune your controller to successfully fly the final desired box trajectory with your estimator and realistic sensors.

The controller developed in the previous project should be de-tuned to successfully meet the performance criteria of the final scenario (<1m error for entire box flight).

- QuadController.cpp is updated from last project
- QuadControlParams.txt is updated from last project
- The controller added from previous project successfully meet the performance criteria of the final scenario (<1m error for entire box flight).
- Position and velocity gains have gone down from the initial value. This is enough to make the drone fly with an error of <1m for the entire box flight as shown in Task 5.
Before Detuning of Controller

Before

Magnetometer After Detuning of Controller

Before

GPS After Detuning of Controller

Before

MonteCarloTest TestManyQuads
Before Tests

Note: More information from Udacity Readme.md


About

FCND-Estimation-CPP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published