3D Robotics

Good news: you can now use the standard ArduPilot GCS with ArduPilot Mega!


Just select option 2 ("ArduPilot Legacy") in your GCS protocol in the config file of the latest code, and APM will drive the GCS just like ArduPilot. Try tilting the APM board and watch the artificial horizon move along. Very cool


//0-4 Ground Control Station:
#define GCS_PROTOCOL 2

// 0 = Ardupilot Mega Standard Binary
// 1 = special test,
// 2 = Ardupilot Legacy
// 3 = Xplane
// 4 = Ardupilot IMU out
// 5 = Jason's GCS,
// -1 = no GCS (no telemetry output)



Automatik is hard at work updating the GCS to support APM natively, with all the additional functionality it brings, but for now you've got a great GCS with all the cool stuff like moving maps and voice synthesis, all ready to go.

E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones

Comments

  • Is using the ArduPilot Legacy protocol still the official way of getting an APM to show up on a groundstation? Did I miss something? THANK YOU!
  • I quit being lazy, and cut my airborne XBee open to flash it to 115200.

    Got it all hooked back up, and check this out.

  • All they are doing is now calling a paramater called SendSer and Sendserln which sets the serial port to use for Telemetry. it is set via changing // Telemetry in APM_Config.h
    Look at current code for the diffrences in GCS files. Legacy hardcoding of the serial port or calling of a paramater that becomes cross platform.
  • I found the code but I think you need a library to go with it.


    /***************************************
    // Telemetry - Uncomment the pair for the port you want to use

    #define SendSer Serial.print // This pair to use the usb port
    #define SendSerln Serial.println

    //#define SendSer Serial3.print // this pair for the xbee port
    //#define SendSerln Serial3.println // Internal defines, don't edit and expect things to work

    /***************************************/
  • Where is the code for the sendser function ?
    I have seen it but can't remember where.
    Earl
  • All the serial prints are Serial.print in the mega repo
    Earl
  • make sure you guys start using sendser instead of serial.print... that way we can keep a good thing going...
  • more changes.
    Earl

    void print_position(void)
    {
    Serial.print("!!!");
    Serial.print("LAT:");
    Serial.print(current_loc.lat/10,DEC);
    Serial.print(",LON:");
    Serial.print(current_loc.lng/10,DEC); //wp_current_lat
    Serial.print(",SPD:");
    Serial.print(ground_speed/100,DEC);
    Serial.print(",CRT:");
    Serial.print(climb_rate,DEC);
    Serial.print(",ALT:");
    Serial.print(current_loc.alt/50,DEC);
    Serial.print(",ALH:");
    Serial.print(next_WP.alt/10,DEC); <<<<<<<<<<<<<<<<<<<< /10 not /100 Earl >>>>>>>>>>>>>>>>>>>
    Serial.print(",CRS:");
    Serial.print(ground_course/1000000,DEC); <<<<<<<<<<<<<<<<<<<< added 4 zeros to divide Earl >>>>>>>>>>>>>>>>>>>
    Serial.print(",BER:");
    Serial.print(target_bearing/100,DEC);
    Serial.print(",WPN:");
    Serial.print(wp_index,DEC);//Actually is the waypoint.
    Serial.print(",DST:");
    Serial.print(wp_distance,DEC);
    Serial.print(",BTV:");
    Serial.print(battery_voltage,DEC);
    Serial.print(",RSP:");
    Serial.print(servo_out[CH_ROLL]/100,DEC);
    Serial.print(",TOW:");
    Serial.print(iTOW);
    Serial.println(",***");
  • OK I fixed lat and long. now for alt. It is off by 2x too little.
    Earl
    here is code in ArdiPilot_0_1_0 I changed

    iTOW = GPS.Time;
    current_loc.lng = GPS.Longitude *10; // Lon * 10**7 <<<<<<<<<<<<<<<<<< *10 by Earl >>>>>>>>>>>>>>>>
    current_loc.lat = GPS.Lattitude *10; // Lat * 10**7 <<<<<<<<<<<<<<<<<< *10 by Earl >>>>>>>>>>>>>>>>
    #if GCS_PROTOCOL != 3
    current_loc.alt = ((1 - ALTITUDE_MIX) * GPS.Altitude) + (ALTITUDE_MIX * press_alt); // alt_MSL centimeters (meters * 100)
    #else
    current_loc.alt = GPS.Altitude *10; <<<<<<<<<<<<<<<<<< *10 by Earl >>>>>>>>>>>>>>>>
    #endif

    ground_course = GPS.Ground_Course; //degrees * 100

    COGX = cos(ToRad(GPS.Ground_Course/100.0));
    COGY = sin(ToRad(GPS.Ground_Course/100.0));
  • Dr. Mike
    Yup, that fixed it.
    Now to fix lat, lon and alt scale
    Earl
This reply was deleted.