Estimating Velocity

In this part of the project you will implement and test a method for estimating the velocity of your drone’s camera.

Camera Calibration

In the handin PDF, please describe the orientation of the camera relative to the drone using a 3d rotation matrix.

Velocity Estimation Via Optical Flow

On your drones, the chip on the Raspberry Pi dedicated to video processing from the camera calculates motion vectors (optical flow) automatically for H.264 video encoding. Click here to learn more. You will be analyzing these motion vectors in order to estimate the velocity of your drone.

In student_flow_class.py, implement your velocity estimation using optical flow. Note that there are two methods for you to fill in.

  • Use the setup method to initialize any variables that you would like to use, or run any other operations needed to setup your flow analyzer.
  • Use the analyze method to analyze the flow vectors (note that these are initialized as x and y for you) and calculate the overall velocity of your drone in the x and y directions. The analyze method is called every time that the camera gets an image.
  • Use the flow_angle_comp method to account for the flow that the camera perceives due to the tilting of the drone.

In flow_pub_transform.py, go to the section that is designated for you to fill out. Make sure you fill out all of the TODO blocks.

  • Run the setup for your class and pass in the apropriate arguments
  • In the loop, calculate and extract the overall motion from your drone
  • Also in the loop, publish the velocity message

Using whichever methods you know, calculate the framerate that you are calculating your vectors. Please explain (with screenshots if you feel they are helpful) how you calculated or measured this framerate and what your final results were.

Checkoff

Show the TA a demonstration of moving your drone in X, Y, and Z. If you manually move the drone in X, verify the rosJS moves in X. Similarly for Y and Z.