SMALL - espritmodel.com SMALL - Telemetry SMALL - Radio
Reply
Thread Tools
Old Aug 18, 2011, 03:21 AM
CL-OSD developer
Sverige, Östergötlands Län, Linköping
Joined Apr 2011
279 Posts
And if you have any other feature requests (or bugs) you can add them to the google code page so I don't forget them.
callelj is offline Find More Posts by callelj
Reply With Quote
Sign up now
to remove ads between posts
Old Aug 18, 2011, 03:32 AM
Registered User
schumixmd's Avatar
Moldova
Joined Jun 2010
1,293 Posts
Quote:
Originally Posted by callelj View Post
Slaphappysamy: I will put that on my todo list.

schumixmd: I think it would work, some changes in the code might be needed. I could make a E-OSD+ target. I dont know if it's google earth compliant. How do they look?

actionplus: There is code uploaded under Source->Browse. I have also pre-compiled for both targets. I have not changed my fuses so unless you accidentally change them it will work. But I will look at what they are.

foot8sativa: A compass would be great to make a home arrow better. But right now I will focus on the basics.

BTW: Don't try to use the G-OSD hex on E-OSD or the other way around since pins are different and you might (not likely) break your board.
for now, to use original supplied G-OSD coordinates in google you should do some math like this:
If we assume coordinates from your screen are exactly as they would be displayed by an Orginal G-OSD then they are 5824.8422, 1536.0478 and
becomes 58.248422, 15.360478
The degree part remains intact, and the calculation are for mins part:
(248422*100)/60 = 414036
(360478*100)/60 = 600796
so the result is 58.414036, 15.600796 and google says you are in Linkoping, Sweden.
schumixmd is online now Find More Posts by schumixmd
RCG Plus Member
Old Aug 18, 2011, 03:43 AM
Registered User
schumixmd's Avatar
Moldova
Joined Jun 2010
1,293 Posts
another question that comes from me
How we set the HOME before flight?
schumixmd is online now Find More Posts by schumixmd
RCG Plus Member
Old Aug 18, 2011, 03:47 AM
CL-OSD developer
Sverige, Östergötlands Län, Linköping
Joined Apr 2011
279 Posts
schumixmd: Aaa, ok. I will add that to my todo list. And yes I'm in linköping.

I think that when you start the first fix should be home unless you long press the button. What do you think?
callelj is offline Find More Posts by callelj
Reply With Quote
Old Aug 18, 2011, 04:02 AM
Registered User
schumixmd's Avatar
Moldova
Joined Jun 2010
1,293 Posts
Quote:
Originally Posted by callelj View Post
schumixmd: Aaa, ok. I will add that to my todo list. And yes I'm in linköping.

I think that when you start the first fix should be home unless you long press the button. What do you think?
I do think LONG PRESS is more suitable because first fix can be way too wrong if you acquired only few satellites, and also are doing other magics over the plane.
schumixmd is online now Find More Posts by schumixmd
RCG Plus Member
Old Aug 18, 2011, 04:33 AM
RC pilot by soul
Israel
Joined Apr 2005
2,529 Posts
Quote:
Originally Posted by callelj View Post
I think that when you start the first fix should be home unless you long press the button. What do you think?
+1. i think this is a good idea.

do you have an ETA about the home arrow thing ?
BTW - once you do set home, in flight a LOS distance from home would be extremely helpful.
i3dm is offline Find More Posts by i3dm
Reply With Quote
Old Aug 18, 2011, 05:00 AM
CL-OSD developer
Sverige, Östergötlands Län, Linköping
Joined Apr 2011
279 Posts
The home arrow will probably take at least a week. Might be more. I will soon have less time to work on this.

The LOS should be quite simple. Just have to find a way to calculate it.
callelj is offline Find More Posts by callelj
Reply With Quote
Old Aug 18, 2011, 05:15 AM
Registered User
schumixmd's Avatar
Moldova
Joined Jun 2010
1,293 Posts
Quote:
Originally Posted by callelj View Post
The home arrow will probably take at least a week. Might be more. I will soon have less time to work on this.

The LOS should be quite simple. Just have to find a way to calculate it.
Here's my way I calculate bearing in Arduino. between to GPS coordinates HOME(flat1,flon1) and Current(flat2,flon2);
Code:
int bearing(float flat1, float flon1, float flat2, float flon2)
{
  float heading;
  
  flon1 = radians(flon1);  //also must be done in radians
  flon2 = radians(flon2);  //also must be done in radians
  flat1 = radians(flat1);  //also must be done in radians
  flat2 = radians(flat2);  //also must be done in radians

heading = atan2(sin(flon2-flon1)*cos(flat2),cos(flat1)*sin(flat2)-sin(flat1)*cos(flat2)*cos(flon2-flon1)),2*3.1415926535;
heading = heading*180/3.1415926535;  // convert from radians to degrees

int head =heading; //make it a integer now

if(head<0){
  heading+=360;   //if the heading is negative then add 360 to make it positive
}
return heading;  
}
Here's the way I moved a servo to show me direction to HOME. The trick part is that a servo has only 180 degree rotation.
Code:
void servo_move(int desthead, int myhead)
{
  float angle;
  int serv;

  angle=(((((desthead - myhead) % 360) + 540) % 360) - 180);
  angle=-angle;
  
  if (angle>90)
  {
   angle=90;
  } 
  else 
  if (angle<-90)
  {
   angle=-90;
  };
  
  myServo.write(90+(int)angle);
  
}
schumixmd is online now Find More Posts by schumixmd
RCG Plus Member
Old Aug 18, 2011, 05:34 AM
CL-OSD developer
Sverige, Östergötlands Län, Linköping
Joined Apr 2011
279 Posts
schumixmd: Thanks for the code! But i think I need to do the calculations without float since I'm already using 80% of the program space and float takes a lot of space. But with this I should get started at least.

Q: Do you use the GPS angle data to calculate the home arrow?

I think I will use my arduino to feed GPS data to the G-OSD for testing so I don't have to run around outside.
callelj is offline Find More Posts by callelj
Reply With Quote
Old Aug 18, 2011, 05:39 AM
Registered User
schumixmd's Avatar
Moldova
Joined Jun 2010
1,293 Posts
and here is code for calculate distance between 2 points(source from TinyGPS library for Arduino)

Code:
/* static */
float TinyGPS::distance_between (float lat1, float long1, float lat2, float long2) 
{
  // returns distance in meters between two positions, both specified 
  // as signed decimal-degrees latitude and longitude. Uses great-circle 
  // distance computation for hypothetical sphere of radius 6372795 meters.
  // Because Earth is no exact sphere, rounding errors may be up to 0.5%.
  // Courtesy of Maarten Lamers
  float delta = radians(long1-long2);
  float sdlong = sin(delta);
  float cdlong = cos(delta);
  lat1 = radians(lat1);
  lat2 = radians(lat2);
  float slat1 = sin(lat1);
  float clat1 = cos(lat1);
  float slat2 = sin(lat2);
  float clat2 = cos(lat2);
  delta = (clat1 * slat2) - (slat1 * clat2 * cdlong); 
  delta = sq(delta); 
  delta += sq(clat2 * sdlong); 
  delta = sqrt(delta); 
  float denom = (slat1 * slat2) + (clat1 * clat2 * cdlong); 
  delta = atan2(delta, denom); 
  return delta * 6372795; 
}
schumixmd is online now Find More Posts by schumixmd
RCG Plus Member
Old Aug 18, 2011, 05:40 AM
Registered User
schumixmd's Avatar
Moldova
Joined Jun 2010
1,293 Posts
Quote:
Originally Posted by callelj View Post
schumixmd: Thanks for the code! But i think I need to do the calculations without float since I'm already using 80% of the program space and float takes a lot of space. But with this I should get started at least.

Q: Do you use the GPS angle data to calculate the home arrow?

I think I will use my arduino to feed GPS data to the G-OSD for testing so I don't have to run around outside.
Yes, I'm using course provided by GPS, it is the easies method.

No, adn Yes. The code I wrote above.
Home arrow is calculated by function bearing. It takes 4 parametes LAT,LON for HOME and LAT,LON for current location.
Then Yes, using course provided by GPS and Course I must follow I move the servo to the left or right 90degree, but if you omit IF statement then you have 180 degree right and 180 left.
The formula for angle I borrowed from a games programming forum, and is the shortest and easiest one. there were another versions with more computation.
schumixmd is online now Find More Posts by schumixmd
RCG Plus Member
Last edited by schumixmd; Aug 18, 2011 at 05:54 AM.
Reply With Quote
Old Aug 18, 2011, 05:50 AM
Registered User
schumixmd's Avatar
Moldova
Joined Jun 2010
1,293 Posts
Quote:
Originally Posted by callelj View Post
schumixmd: Thanks for the code! But i think I need to do the calculations without float since I'm already using 80% of the program space and float takes a lot of space. But with this I should get started at least.

Q: Do you use the GPS angle data to calculate the home arrow?

I think I will use my arduino to feed GPS data to the G-OSD for testing so I don't have to run around outside.
I'm not so good with atmega chips. This small memory devices makes me crazy...
However .. that code I provided with a lot of other not very well tuned code worked in my arduino with atmega328.. way bigger than E-OSD
schumixmd is online now Find More Posts by schumixmd
RCG Plus Member
Old Aug 18, 2011, 05:58 AM
Registered User
schumixmd's Avatar
Moldova
Joined Jun 2010
1,293 Posts
BTW: by removing the timer which I do consider not so useful since I have voltages on screen and 2 timers on transmitter, some space will free up.
schumixmd is online now Find More Posts by schumixmd
RCG Plus Member
Last edited by schumixmd; Aug 18, 2011 at 06:04 AM.
Reply With Quote
Old Aug 18, 2011, 06:28 AM
CL-OSD developer
Sverige, Östergötlands Län, Linköping
Joined Apr 2011
279 Posts
An arduino has a lot more space yes. :-)

I might need to add float unless I can make my own integer algorithm... Hmm...

The timer could be removed but it won't save that much space I think.
callelj is offline Find More Posts by callelj
Reply With Quote
Old Aug 18, 2011, 06:35 AM
RC pilot by soul
Israel
Joined Apr 2005
2,529 Posts
Actually, removing the timer is a good idea. there is really no need for it. displaying local time might be cool, but also not required by any means.
i3dm is offline Find More Posts by i3dm
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Build Log Super OSD ($90): Open Source Graphic OSD: Vario, 6xADC, Games, Datalog, Dual Video tom66 FPV Equipment 1928 May 24, 2014 12:07 PM
Discussion Open Source Remote Control System (OSRC) Gizmoman31 Radios 152 Apr 24, 2012 07:01 PM
Discussion Open source OSD for FPV UFO_MAN FPV Talk 75 Sep 07, 2011 03:03 PM
Question Open Source Octo Design Available...Looking for someonw who can cut a copy for me... Schatham421 Multirotor Talk 14 Apr 12, 2011 06:22 PM