ESPcopter is currently crowdfunding, with differing reward levels available depending on the expansion boards and quantity desired.
ESPcopter Optical Flow Module:The optical flow module measures the movement of the ESPcopter over the ground, allowing the drone to remain stable in the air and to perform autonomous tasks.
Optical flow is a feature that allows the drone to hold its position without a pilot’s input. It is a feature that works by having a downward-facing camera “view” the ground surface while sending a continuous flow of optical feed back to the flight controller which then makes flight adjustments to keep the drone in its position. For instance, if the FC senses that the drone is drifting backwards, it will make appropriate adjustments to counter that movement.
Optical flow positioning, when used in conjunction with altitude hold, is a great feature to have for beginners who still lack the intermediate to advanced skills needed to pilot a drone efficiently.
1-) Open the ESPcopter RemoteXY control code.
2-) Check the standard code
#define REMOTE_XY_OWN
#include "remotexy.h"
#include <espcopter.h> // ESPcopter lib
void setup() {
mainSetup();
}
void loop() {
mainLoop (); // main loop
}
3-) Make a control interface on RemoteXY
4-) Make RemoteXY Settings
4-) Get the RemoteXY Code by click to "Get source code"
5-) Edit the Flying Code by Using SDK
SDK: http://espcopter.com/wp-content/uploads/2016/09/ESPcopter-SDKEnglish.pdf
Main code:
#define REMOTE_XY_OWN
#include "remotexy.h"
#include <espcopter.h>
void setup() {
mainSetup();
}
void loop() {
mainLoop(); // main flying loop
RemoteXY.level_1 = getOtoMeasure()/10;
RemoteXY.level_3= 50+4*deltaY;
RemoteXY.level_2= 50+4*deltaX;
}
remotexy.h//////////////////////////////////////////////
// RemoteXY include library //
//////////////////////////////////////////////
// RemoteXY select connection mode and include library
#define REMOTEXY_MODE__ESP8266WIFI_LIB_POINT
#include <ESP8266WiFi.h>
#include <RemoteXY.h>
// RemoteXY connection settings
#define REMOTEXY_WIFI_SSID "RemoteXY"
#define REMOTEXY_WIFI_PASSWORD "12345678"
#define REMOTEXY_SERVER_PORT 6377
// RemoteXY configurate
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
{ 255,0,0,3,0,106,0,8,86,0,
66,1,44,25,14,36,203,26,66,132,
4,29,35,27,36,31,66,132,62,28,
37,29,36,31,129,0,6,18,89,6,
24,77,111,116,105,111,110,32,88,32,
32,32,32,32,65,108,116,105,116,117,
100,101,32,32,32,77,111,116,105,111,
110,32,89,32,32,0,129,0,5,4,
90,6,31,69,83,80,99,111,112,116,
101,114,32,79,112,116,105,99,97,108,
32,70,108,111,119,32,77,111,100,117,
108,101,0 };
// this structure defines all the variables of your control interface
struct {
// output variable
int8_t level_1; // =0..100 level position
int8_t level_2; // =0..100 level position
int8_t level_3; // =0..100 level position
// other variable
uint8_t connect_flag; // =1 if wire connected, else =0
} RemoteXY;
#pragma pack(pop)
/////////////////////////////////////////////
// END RemoteXY include //
/////////////////////////////////////////////
Result:ESPcopter is currently crowdfunding, with differing reward levels available depending on the expansion boards and quantity desired.
Comments
Please log in or sign up to comment.