AME 3623: Project 9

For this project, you will be reading "image slip" data from a set of cameras and estimating the distance traveled by the hovercraft in a given period of time. A key part of this project will be the construction of a mathematical model that captures this relationship. This model will allow us, in the long run, to estimate the position and velocity of the hovercraft in a coordinate frame centered on the craft.

At the end of this project, you should be able to:

Component 0: Library Installation

Create a new project in your Arduino environment; copy over the code that you have developed so far.

You will not need to repeat this step in the future.

Component 1: Microcontroller Circuit

Your hovercraft is equipped with power circuit and three downward-looking cameras. When turned on, the power circuit delivers +5V to the red LEDs that are part of the camera system.

Cameras

The CJMCU-110 Optical Flow Camera pin-outs are shown below:

The common lines that are shared across all cameras (and should be connected together) are:

In addition, each camera has its own Yellow line that is used to select the camera for communication. Each camera must have a unique digital output pin assigned to it.

Component 2: Regular Execution of Tasks

Add the following declarations to loop():

// Create a task that will be executed once per 5 ms
PeriodicAction camera_task(5, camera_step);

camera_task.step();

Component 3: Camera Interface Software for Data Collection

Write a data collection program:

Component 4: Data Collection

Component 5: Sensor Model

The result of your data collection process is a matrix of 30 rows and 6 columns, representing the accumulated slip measured by each camera for 30 different cases. This matrix is associated with another matrix of 30 rows and 3 columns, representing the known movement of the chassis along X, Y and theta for each of the 30 cases. We will use multi-regression to derive a linear function from the accumulated slip values to the chassis movement values.

Specifically, we wish to solve for functions of the following form:

X = a1 * adx1 + a2 * ady1 + a3 * adx2 + a4 * ady2 + a5 * adx3 + a6 * ady3

where a1 ... a6 are the coefficients of our function, adx?/ady? are the accumulated slip values for the x and y directions for each camera, and X is the motion along the chassis' X direction. Note that we will have corresponding functions (and coefficients) for Y and theta.

See the instructions for performing multi-regression in Excel. See the instructions for configuring Excel for regression if you have not yet used Excel to perform regression tasks.

In the Summary Output from the regression process, you will find a column labeled Coefficients. These are the parameters of the linear model that result from the regression process (a1 ... a6) from above.

Notes:

Component 6: Implement the Model

Add one more global variable:
float cartesian_pos[3] = {0.0, 0.0, 0.0};
Implement a function of the form:
void compute_chassis_motion(int32_t adx[3], int32_t ady[3], float[3] cartesian_pos);

where adx and ady are arrays representing the accumulated slip values from each of the cameras, and cartesian_pos is an array representing the motion along X, Y and theta, respectively. This function will take as input adx and ady, and fill in the values for the motion array. The motion values are in units of meters, meters, and degrees, respectively. Hence, any change to motion by this function will be visible to the calling function.

At the end of camera_step(), call this new function.

Update report_step() to also print out the three cartesian_pos values (on the same line as adx/ady).

Component 7: Testing


What to Hand In

All components of the project are due by Tuesday, April 27th at 5:00 pm

Grading

Project lead credit:

For a successful project, we expect:


andrewhfagg -- gmail.com

Last modified: Mon Apr 19 00:42:47 2021