Kheirouben / happykillmore-gcs

Automatically exported from code.google.com/p/happykillmore-gcs
Other
0 stars 0 forks source link

Enhancement request - APM support tracker #2

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Load APM modified code as below for Ardutracker.pde
2. launch GCS and connect on tracker tab 
3. move sliders

What is the expected output? What do you see instead?
pan and tilt servos should move when slider is moved

pan servo doesnt move with pan slider
pan servo moves with tilt slider

What version of the product are you using? On what operating system?
1.2.21

Please provide any additional information below.
Here is the code changes for ardutracker.pde... no changes in decode.pde

#include <APM_RC.h>
//#include <Servo.h>

// ArduTracker v1.1 - 01/10/2010 maybe v1.2
// By HappyKillmore (Paul Mather) and Diego Colonnello
// Most of this source comes from ArduPilot 2.3.1 by Chris Anderson & Jordi 
Munoz
// Current Implementation designed to work with "PanTilt" Output Mode on 
HappyKillmore's GCS
// http://code.google.com/p/happykillmore-gcs/

// Designed for use with all the arduino chips. arduino enviroment version 0018 
or +
// Connected via FTDI cable or usb or serial rs232
// Pan servo connected to out 1 or pin 10
// Tilt servo connected to Out 2 or pin 9

//Servo servotilt;
//Servo servopan;
int pan=1500;
int tilt=1500; 
byte data_update_event=1;//New data flag 

void setup()
{
    Serial.begin(38400); //Serial  
    APM_RC.Init();   // APM Radio initialization
//    servopan.attach(9); // creates a servo object to control the pan servo
//    servotilt.attach(10); // creates a servo object to control the tilt servo
    demo_servos();
    demo_servos();
}

void loop()
{
    decode(); //Decoding data comming from GCS

    if((data_update_event&0x01)==0x01)
    {
        APM_RC.OutputCh(0,pan); // Copy input to Servos
//        servopan.write(pan);  //writes the pan servo with the pan variable 
from the decoding command on the serial reading
        APM_RC.OutputCh(1,tilt); // Copy input to Servos
//        servotilt.write(tilt); //writes the tilt servo with the tilt variable 
from the decoding command on the serial reading
        data_update_event=0;
    }
}

void demo_servos()
{
    delay(30);
    APM_RC.OutputCh(0,1400);
    APM_RC.OutputCh(1,1400);
    delay(300);
    APM_RC.OutputCh(0,1600);
    APM_RC.OutputCh(1,1600);
    delay(300);
    APM_RC.OutputCh(0,1500);
    APM_RC.OutputCh(1,1500);
    delay(30);
        Serial.println("demo servos");
}

Original issue reported on code.google.com by Draconis...@gmail.com on 22 Jan 2011 at 3:56

GoogleCodeExporter commented 8 years ago
HK, If I change the code to use pan for both ch0 and ch1 the tilt slider moves 
both servos at once, and vise versa setting them to both tilt, does nothing for 
either slider. so I know the channel numbers are right... 
       APM_RC.OutputCh(0,pan); // Copy input to Servos
       APM_RC.OutputCh(1,pan); // Copy input to Servos

Original comment by Draconis...@gmail.com on 22 Jan 2011 at 5:46

GoogleCodeExporter commented 8 years ago
Can you make a branch for ArduTrackerMega?

Original comment by Draconis...@gmail.com on 22 Jan 2011 at 9:40

GoogleCodeExporter commented 8 years ago
I think I've got it figured out. I had a missing comma. 1.2.22 should have this 
issue fixed.

Original comment by paulbmather@gmail.com on 24 Jan 2011 at 2:51

GoogleCodeExporter commented 8 years ago
I can confirm it works on 1.2.22 and 1.2.23 thank you!
can this be made into a trunk or a seperate download like ardutrackermega.pde?

Original comment by Draconis...@gmail.com on 25 Jan 2011 at 5:59

GoogleCodeExporter commented 8 years ago

Original comment by paulbmather@gmail.com on 16 Apr 2011 at 5:33

GoogleCodeExporter commented 8 years ago
example changes for mega platform

Original comment by Draconis...@gmail.com on 16 May 2011 at 10:42

Attachments: