I made this topic to collect all infos related to WP navigation development to one group.
Regarding to discussions in EZ-GUI topic, I have a suggestion on universal WP data handling, I suggest to use a struct for storing WP datas
Code: Select all
static struct {
int32_t Lat; // Lat for WP
int32_t Lon; // Lon for WP
int32_t Alt; // alt at WP (cm)
int16_t Heading; // heading at WP (deg)
int16_t Vario; // vario for alt changing (cm/s)
int8_t Time; // time to stay in WP (s)
int8_t Uploaded; // can WP be used or not?
// 0 - current WP is not yet uploaded, contains only 0 - can't be used
// 1 - current WP is already updloaded and contains valid datas - can be used
} WP[16];
Here are the nav flags I suggest:
Code: Select all
/*** GPS WP datas***/
// suggested naw flags:
#define HOME 0
#define HOLD 1
// 2-16 - generic WP navigation */
I suggest also to reset all values when setup():
Code: Select all
#if GPS
for(uint8_t i=0;i<=15;i++){
WP[i].Lat = 0;
WP[i].Lon = 0;
WP[i].Alt = 0;
WP[i].Heading = 0;
WP[i].Vario = 0;
WP[i].Time = 0;
WP[i].Uploaded = 0;
}
#endif
On this way, the struct of naw datas is not rigid, can be expanded with further datas in the future without rechecking the complete naw code.
Also, the number of WPs can be increased if neccessary.
_____________________________________
About WP navigation function itself, here is my suggestion:
Three BOX items should be made:
- GPS WP MODE
This mode is for flying through WP-s. Both RTH mode and HOLD mode should ovveride this.
It ALT HOLD is also on, in WP mode it should go to the WP altitude. My primitive alt changing routine could be used for this but with the modification of enable throttle control by stick at the very end of stick travel for emergency situations
- GPS NEXT WP
If checked and aux channel is on this state, copter always go to the next valid WP (the Uploaded item in struct), when reaches the last WP, starts from WP[2] again
- GPS PREV WP
The same as NEXT WP but into the opposite direction
If these would be written once into GUI and Multiwii, that would be much easier to let developers test their ideas in the air bout WP naw!!!
Could anybody write this???
I suggest not to store any values in the EEPROM since than faulty datas could be remain in there (ie from last different place).
For example all WP datas could be uploaded via MSP before take-off, or even in the air via BT or 3DR module. Only a multifunctional MSP_WP part must be written to be able to upload all WP datas step-by-step.
I attached my custom code (NHADRIAN r17 based on official r1349), JUST FOR A SAMPLE OF USING THIS STRUCT!!! DO NOT USE IN THE AIR since just a development sample about my idea!!!!!!
BR
Adrian
PS.: thanks for reading...