Ignore:
Timestamp:
Sep 23, 2016, 11:13:25 AM (5 years ago)
Author:
Thomas Fuhrmann
Message:

Update MavlinkUDP files and add pause function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/mavlink/tools/Controller/Mavlink/src/GuiGcs.cpp

    r83 r84  
    4242  //outputSocket = new Socket((Thread *)this, "output socket", outputAddress + ":" + to_string(outputPort));
    4343
     44  missionPauseEnabled = false;
     45
    4446  mavCom = new MavlinkUDP(outputAddress, outputPort);
    4547}
     
    7880}
    7981
    80 void GuiGcs::MissionResume() {
    81   cout << "MavPlanner GuiGcs MissionResume" << endl;
     82void GuiGcs::MissionPause() {
     83  cout << "MavPlanner GuiGcs MissionPause" << endl;
     84  // send pause/continue depending on the state of the button
     85  if(missionPauseEnabled) {
     86      missionPauseEnabled = false;
     87      cout << "Sent pause command.\n";
     88      mavCom->cmdDoPauseContinue(mavCom->target.getSysID(), mavCom->target.getCompID(), 0);
     89  } else {
     90      missionPauseEnabled = true;
     91      cout << "Sent continue command.\n";
     92      mavCom->cmdDoPauseContinue(mavCom->target.getSysID(), mavCom->target.getCompID(), 1);
     93  }
     94  mavCom->waitCommandAck(ACK_TIMEOUT);
    8295}
    8396
Note: See TracChangeset for help on using the changeset viewer.