I am trying to set up optical flow to my Aero RTF Drone.
I have set up my drone according to these information.
* https://github.com/intel-aero/aero-optical-flow/blob/master/README.md aero-optical-flow/README.md at master · intel-aero/aero-optical-flow · GitHub
BIOS_VERSION = Aero-01.00.13
OS_VERSION = Poky Aero (Intel Aero Linux Distro) 1.6.1 (pyro)"
AIRMAP_VERSION = 1.8
FPGA_VERSION = 0xc2
AeroFC firmware version = 1.6.5
I have connected Lidar Lite v3.
After an optical-flow process is executed, quality value is getting lower.
After 10 or 20 seconds, the quality is about 0 ~ 10.
At first, I suppose that the texture of the floor is not enough.
So, I modified optical-flow source codes and added these functions.
- Get actual images before inserting to an optical-flow function
- Logging additional parameters, for examples, gain and exposure.
Then, I realized that gain and exposure values are changing drastically.
According to these parameters, actual image gradually turns to white within 10 seconds.
logs[Fri Apr 13 17:27:57.330 2018] [Debug] =TEST= gain 0 exposure 850
[Fri Apr 13 17:27:57.400 2018] [Debug] =TEST= msg.quality: 176
After a few seconds
[Fri Apr 13 17:28:09.204 2018] [Debug] =TEST= gain 127 exposure 1727
[Fri Apr 13 17:28:09.328 2018] [Debug] =TEST= msg.quality: 176
After a few more seconds
[Fri Apr 13 17:29:20.566 2018] [Debug] =TEST= gain 1 exposure 1
[Fri Apr 13 17:29:20.595 2018] [Debug] =TEST= msg.quality: 0
What should I do to run optical-flow properly?
Thank you very much for your attention.
Thank you for your interest in the Intel Aero drone.
Can you please clarify as to what program(s) are you using to test?
Is it one of the test functions in the instructions, your own code, or code from somewhere else? That can help bring some understanding.Regards,
I have modified mainloop.cpp in this repository.
https://github.com/intel-aero/aero-optical-flow/blob/master/src/mainloop.cpp aero-optical-flow/mainloop.cpp at master · intel-aero/aero-optical-flow · GitHub
To save image data, I have added a block between l.320 and l.322.
Please check below.
// Copy the data into new matrix -> cropped_image.data can not be used in calcFlow()...
// ========== Added this block to save images.
// Save image data just before executing calcFlow()
static int cnt_cropped = 0;
static int cnt_sec = 0;
oss << std::setfill('0') << std::setw(3) << cnt_cropped++;
imwrite(oss.str() + "_cropped.jpg", cropped);
// ========== END
int flow_quality = _optical_flow->calcFlow(cropped.data, (uint32_t)img_time_us, dt_us, flow_x_ang, flow_y_ang);
Besides, I have added these lines to check exposure, gain and quality.
DEBUG("=TEST= gain %u exposure %u", (uint16_t)gain, (uint16_t)exposure);
After L. 271
DEBUG("=TEST= msg.quality: %i", msg.quality);
Make new source on the Aero Compute Board.
# Update mainloop.cpp file
git submodule update --init --recursive
./aero-optical-flow -c /dev/video2
Thank you for your support.
Originally, we got the same result when I have executed your original code.
Quality value decreased drastically.
To check the cause, I have added these lines I have copied.
Then, I have noticed that optical flow process cannot obtain proper quality image.
I have provided this code according to your request.
I have never requested you to debug it.
I would like to just know why your original code does not work properly in my drone.
I would like to discriminate the cause of the issue.
Could you give me any suggestion?
Can you please tell me if you have made any modifications/changes when seeing the initial issue or trying the guide?
It would also be very helpful if you could turn on debug mode and provide us the log information if you still see it with the guide.
Thank you in advance,