In this part of the project you will implement and test a method for estimating the velocity of your drone’s camera.
In the handin PDF, please describe the orientation of the camera relative to the drone using a 3d rotation matrix.
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.
setup
method to initialize any variables that you would like to use, or run any other operations needed to setup your flow analyzer.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.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.
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.
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.