Photogrammetry with gluonpilot

General discussions on the Gluon-project that don't fit elsewhere. If required, I will create more subforums.

Moderator: lukasz

Re: Photogrammetry with gluonpilot

Postby fba » Fri Aug 09, 2013 8:58 am

Hello,
I have found this useful video, at 1'34"

http://www.youtube.com/watch?v=tuzh9XCIins
Francisco
User avatar
fba
 
Posts: 47
Joined: Sun Jan 06, 2013 9:13 pm
Location: Spain

Re: Photogrammetry with gluonpilot

Postby Tom » Mon Aug 12, 2013 9:02 pm

Thanks, very useful info in this video :-)
User avatar
Tom
Site Admin
 
Posts: 1016
Joined: Fri Nov 13, 2009 6:27 pm
Location: Belgium

Re: Photogrammetry with gluonpilot

Postby fba » Thu Dec 12, 2013 8:25 pm

Hello, maybe this post can be move to another thread.

My purpose is to get a three axis gimbal and other future features. For this I will try to use Arduino attached to Gluon board. I have written a code to get some data via serial port from Gluonpilot board (Pin Tx on Gluon to Rx on Arduino) to use that to manage the servos into Arduino. I´m a newbie on Arduino so a better code can be provided.

Now the code only read and store some data values from Gluon serial port. Later I will write for a servo gimbal an others features. The useful data for me are: roll, pitch, heading, velocity, altitude and current Gluon´s code line.

I cannot upload INO file here so I put like text below equal signs
======================================================
   /*
 
 
 Francisco Bascón, december 2013
 Using example from  Tom Igoe.
 http://www.arduino.cc/en/Tutorial/SerialEvent
 
  This sketch takes some telemetry data avaible at serial port from 
 "communication_csv.c"  r157 by Tom Pycke on Jan 18, 2013.
 (svn/  trunk/ Firmware/ rtos_pilot/ communication_csv.c)
 Tx pin on Gluonboard is at FTDI connection. The 5th from the FTDI GND pin.
 Because I am newbie on Arduino, better code is grateful. 
 */
 

  boolean stringComplete = false; // whether the line is complete
  boolean LetterTrue,EndLine= false;
  int TAdata[3]; //three data in Attitude array
  int TGdata[3]; //three data in GPS array
  int TCdata[3]; //three data in Gluon control data array

void setup() {
  // initialize serial:
  Serial.begin(57600); //baud Gluon
}

void loop() {
  // print the string when a newline arrives:
  
 //////Below, show data on Arduino Serial Port to check////////////
    if (stringComplete)
    {
      //Attitude, 2 data (roll, pitch at 1000 radians)
     Serial.print("Att : ");
    for (int i=0;i<=1;i++)
    {
    Serial.print(TAdata[i]);
    Serial.print(",");
    }
    Serial.println();
       
    //GPS, 3 data (speed at cm/s, yaw at 100 radians, satellites to chek)
    Serial.print("GPS: ");
    for (int i=0;i<=2;i++)
    {
    Serial.print(TGdata[i]);
    Serial.print(",");
    }
    Serial.println();
    
    //Gluon Control, 2 data (current_codeline ,to enable gimbal only on mission block, and height)
    Serial.print("Ctr : ");
    for (int i=1;i<=2;i++)
    {
    Serial.print(TCdata[i]);
    Serial.print(",");
    }
    Serial.println();
 
      stringComplete = false; //put the variables at initial values
    LetterTrue,EndLine= false; //put the variables at initial values
  }
}

/*
  SerialEvent occurs whenever a new data comes in the
 hardware serial RX.  This routine is run between each
 time loop() runs, so using delay inside loop can delay
 response.  Multiple bytes of data may be available.
 */
    void serialEvent() {
    while (Serial.available()) {
    // get the new byte, from serial Output "communication_csv.c"
    // author Tom Pycke,@date 24-dec-2009, since 0.1

    char inChar = (char)Serial.read();
    if ('A' == inChar ) //Attitude from $TA line
    
    { 
      TAdata[0] =Serial.parseInt(); //roll (1000*rad)
      TAdata[1] =Serial.parseInt(); //pitch (1000*rad)
      TAdata[2] =Serial.parseInt(); // yaw from gyroscope (1000*rad), not good this yaw
                                     // because zero value is for every module power on,
                                     // doesn´t it? maybe needed better info to ensure.
      LetterTrue = true; // if the incoming character is the right header letter
                                // set a flag, boolean variable
    }
    
    if ('G' == inChar ) //GPS from $TG line
    
    { //(Needed float variable to parse data right)
    double TG_Float_data[6]; //six data in GPS array, need float to right parse
                              // due to three CHAR initial incoming data
    
      TG_Float_data[0] =Serial.parseFloat();//gps.status CHAR.
      TG_Float_data[1] =Serial.parseFloat();//gps.lat CHAR
      TG_Float_data[2] =Serial.parseFloat();//gps.lon CHAR
      TG_Float_data[3] =Serial.parseFloat();//speed_10 x m/s or cm/s
      TG_Float_data[4] =Serial.parseFloat();// yaw or heading_rad*100, need moving to be good
      TG_Float_data[5] =Serial.parseFloat();//satellites_in_view (only to check good parse of initial char)
      LetterTrue = true; // if the incoming character is the right header letter
                                            // set a flag, boolean variable
      
    {// convert need data to integer values TGdata
      TGdata[0]  = TG_Float_data[3];
      TGdata[1]  = TG_Float_data[4];
      TGdata[2]  = TG_Float_data[5];
  } 
  }
    
     if ('C' == inChar ) //Control from $TC line
    { 
      TCdata[0] =Serial.parseInt(); //flight_mode
      TCdata[1] =Serial.parseInt(); //current_codeline, to enable servos
      TCdata[2] =Serial.parseInt(); //altitude
      LetterTrue = true; // if the incoming character is the right header letter
                                           // set a flag, boolean variable
  }
      
    // if the incoming character is a newline, set a flag, boolean variable
    if (inChar == '\n')
  {
    EndLine = true;
    if ((EndLine) && (LetterTrue))
    {
      stringComplete = true; // if the header letter and the line has arrived, the loop part can now runs
    }
}}}


========================================================
Francisco
User avatar
fba
 
Posts: 47
Joined: Sun Jan 06, 2013 9:13 pm
Location: Spain

Re: Photogrammetry with gluonpilot

Postby Tom » Fri Dec 13, 2013 8:15 am

Looking good!
Maybe there should become an official Gluonpilot Arduino lib :)
User avatar
Tom
Site Admin
 
Posts: 1016
Joined: Fri Nov 13, 2009 6:27 pm
Location: Belgium

Re: Photogrammetry with gluonpilot

Postby kempo » Sat Dec 28, 2013 9:25 pm

Hi all,

while trying to get used with the ground station i have tried to do a flightplan using relative and absolute waypoint, if for absolute waypoints it is ok, for relative waypoints is not working:

http://www.youtube.com/watch?v=59dUhHQVO6U


Thank you,

Alex
kempo
 
Posts: 113
Joined: Wed Aug 29, 2012 5:16 pm

Re: Photogrammetry with gluonpilot

Postby kempo » Sat Jan 04, 2014 7:31 pm

Today i have made more flights with the X5 wing and Canon SX230.

Here is the setup and layout:

Image

Image

Now the wing has 1250g and the CG is with 2 mm in fromt of the "nipples" marked by the supplier. Adittionally i have the elevons up with 50% of the max trim possible.
Even if i have 2* 2200mAh 3s on the same time on the wing , i'm using only 1. With 1 battery i have around 13 minutes of flight, 11 min in autopilot mode , throttle 47% , average ground speed 65km/h.

After 13 minutes of flight the voltage on the Gluonpilot ground station is showing around 10.5v. At home , the battery is charged with around 1600mAh from max 2200mAh possible.

Today i have made a BIG mistake ( not the first one, for sure , not the last one) , i did not checked the mode used for the camera to take pictures, the camera was in landscape mode and all the pictures were blurry... Tomorrow i will do pictures in Auto mode.

For making pictures i have used CHDK ( script attached). The script is very simple : i am starting the script with lens closed, after 1 minute (this value could be changed from the script)the lens are opened and pictures start to be made at 3s interval. When the number of pictures ( number selected from the script) is achieved the camera is closing.I have discovered that even if i have put 3 seconds between pictures the
real interval is bigger ( the focus time, take the picture is an adittional time).So the CHDK (in this format) isn't such a reliable solution, from my point of view.

Saying this here are the points to be clarified for next flights:

1. a strange thing happened today , i have issues in making the link between the ground station and the glonpilot board ( using xbee). The steps to make the connection is : connect the Xbee to the laptop , open the gluon-ground station , power up the gluonpilot board,select the correct port number for the xbee and connect to the ground station. If in the majority of time is working , there are also a lot of times when it is not working ( and is happening on the field :) ). Also there are times, with the link made between the ground station and Gluonpilot board, when i cannot read the waypoints. What could be the cause of this ? Hardware issue ?

2. Ground control station - Camera helper - camera parameters . I am creating a new camera file, save it, but when i open it the "." symbol is replaced by "," symbol and all the values regarding survey properties are going crazy. Also i have observed that on the camera file it remain saved only the camera data, and not also the survey parameters , speed. It is possible to have them also saved in the camera file ?

http://www.youtube.com/watch?v=0DjR1rl2Ylg

3. When the autopilot has enough satellites, it is saving the Home position , what should i do to change the position of Home ? Right click on the ground station on the place where i want to be the new Home position and after this i must update somehow the board but how ?

4. It is possible to enable CHDK this way:

http://diydrones.com/profiles/blogs/apm ... k-tutorial

?

Or another reliable method to avoid to come on the landing with the lens open ?


5. If there are users that use Canon cameras, can you please share the camera parameter used for photomapping and the platform/layout of the electronics? Skywalker X5 is a nice platform but has it's weaknesses, i am thinking of Multiplex Mentor as the next platform for trials.

6. It could be possible to use relative waypoints to build a survey - flightplan ? Now it is working only with absolute waypoints.

http://www.youtube.com/watch?v=59dUhHQVO6U

I have write a lot, thank you for having patience to read.

Alex
Attachments
sx230 chdk.rar
(607 Bytes) Downloaded 759 times
kempo
 
Posts: 113
Joined: Wed Aug 29, 2012 5:16 pm

Re: Photogrammetry with gluonpilot

Postby kempo » Tue Jan 07, 2014 5:41 pm

Until the weather will allow to do additional flights i have prepared a support for Canon SX230 :

Image

Image

Image

After installation on the X5 wing i will post more pictures.
kempo
 
Posts: 113
Joined: Wed Aug 29, 2012 5:16 pm

Re: Photogrammetry with gluonpilot

Postby Tom » Tue Jan 07, 2014 6:21 pm

Hi Alex,

You are making great progress!!!

1. I have heared some people having this as well. I have no clue where it is coming from as I never experienced it. Maybe a hardware/FTDI driver problem?

2. Maybe an I18N problem. I guess switching "." with "," or vice-versa will help you go around the problem. I will check the code if there is an inconsistency.

3. Sorry it is not possible to change the home position...

4. Yes, you need to create a cable that connects to the USB port of you camera. Put the USB +5V to the signal wire of a servo cable. And of course also connect GND. Use the attached script and the CHDK servo trigger mode (as navigation command) to start and stop triggering.


5. I use an Ixus 215 with CHDK. It is a custom build 1meter wing.

6.I will think about relative waypoints. Strange because it looks better to use absolute waypoints :-)
Attachments
gp1.zip
(1.83 KiB) Downloaded 670 times
User avatar
Tom
Site Admin
 
Posts: 1016
Joined: Fri Nov 13, 2009 6:27 pm
Location: Belgium

Re: Photogrammetry with gluonpilot

Postby kempo » Sat Jan 11, 2014 7:36 pm

Tom wrote:
4. Yes, you need to create a cable that connects to the USB port of you camera. Put the USB +5V to the signal wire of a servo cable. And of course also connect GND. Use the attached script and the CHDK servo trigger mode (as navigation command) to start and stop triggering.



Good evening ,

Due to the unusual good weather for this time of year i have made more flights today.

Observations:

1. during the 3 flights only 1 time i had issues with connection between the XBEEs , each flight had around 14:30 min , around 1600mAh consumed for each flight,throttle at 47% , 100m altitude, almost no wind , the autopilot had done it's job!

2. I have tried CHDK ( not connected to Gluonpilot) in AutoMode and Tv mode. In auto mode all the pictures are blurry, in tv mode with shutter speed of 1/2000 i had very good results, also good results i had with 1/1600. All the rest of the options were left as default ( ISO, Focus...);

3. Using the above instructions i have build a custom Canon cable :

http://www.youtube.com/watch?v=5A2M6ubekDM

- On the camera i have loaded the script provided by Tom above;
- i have done a very simple mission ( the goal was to do a test indoor, to see if the camera will start to do pictures when i will put the switch in autopilot mode):

Image

The problem is that i cannot manage to make it to work. If i turn on the camera, flip the switch to autopilot mode, nothing is happening...
In what status the camera should be , to be able to start the script ? Open from power buton ( lens opened) , playback mode ?

Thank you,
Alex
kempo
 
Posts: 113
Joined: Wed Aug 29, 2012 5:16 pm

Re: Photogrammetry with gluonpilot

Postby Tom » Sun Jan 12, 2014 6:58 pm

Hi Alex,

Indeed you have to use Tv mode to get sharp pictures! I use 1/1000th I think.

For the trigger script:

First line:
SetServo(channel 6, 0ms) [0ms = constant ground level)

Block(Standby)
....

Block(Trigger)
ServoTriggerStart(channel: 6, CHDK mode)
Return

Block(Stop)
ServoTriggerStop()
Return


So you can test this on the ground of course. I set it in continous trigger first.

To
User avatar
Tom
Site Admin
 
Posts: 1016
Joined: Fri Nov 13, 2009 6:27 pm
Location: Belgium

PreviousNext

Return to General

Who is online

Users browsing this forum: No registered users and 16 guests

cron