Changeset 81 in flair-src for branches/mavlink


Ignore:
Timestamp:
Sep 21, 2016, 3:07:48 PM (8 years ago)
Author:
Thomas Fuhrmann
Message:

Add lat, lon and alt fields + adapt processing of MissionSend

Location:
branches/mavlink/tools/Controller/Mavlink/src
Files:
3 edited

Legend:

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

    r79 r81  
    106106    // Parse param3
    107107    float param3 = std::stof(missionCommand.substr(0, missionCommand.find(delimiter)));
     108    missionCommand.erase(0, missionCommand.find(delimiter) + delimiter.length());
     109    // Parse latitude
     110    float latitude = std::stof(missionCommand.substr(0, missionCommand.find(delimiter)));
     111    missionCommand.erase(0, missionCommand.find(delimiter) + delimiter.length());
     112    // Parse longitude
     113    float longitude = std::stof(missionCommand.substr(0, missionCommand.find(delimiter)));
     114    missionCommand.erase(0, missionCommand.find(delimiter) + delimiter.length());
     115    // Parse altitude
     116    float altitude = std::stof(missionCommand.substr(0, missionCommand.find(delimiter)));
     117    missionCommand.erase(0, missionCommand.find(delimiter) + delimiter.length());
    108118    // cout << "[INFO] Mission item commands : " << command << ", " << param1 << ", " << param2 << ", " << param3 << std::endl;
    109     mavCom->sendMissionItem(mavCom->target.getSysID(), mavCom->target.getCompID(), 0, MAV_FRAME_GLOBAL_RELATIVE_ALT, MavCommandGet(command), 0, 1, 0, 0, 0, 0, param1, param2, param3);
     119    mavCom->sendMissionItem(mavCom->target.getSysID(), mavCom->target.getCompID(), 0, MAV_FRAME_GLOBAL_RELATIVE_ALT, MavCommandGet(command), 0, 1, param1, param2, param3, 0, latitude, longitude, altitude);
    110120    mavCom->waitMissionAck(ACK_TIMEOUT);
    111121  }
  • branches/mavlink/tools/Controller/Mavlink/src/GuiInterface.cpp

    r79 r81  
    7474  // comboCmd->AddItem("RETURN");
    7575  // comboCmd->AddItem("JUMP");
    76   param1Field = new DoubleSpinBox(addCmdGroupBox->NewRow(), "Param1",
    77                                 -90, 90, 0.5, 1, 3);
    78   param2Field = new DoubleSpinBox(addCmdGroupBox->NewRow(), "Param2",
    79                                 -90, 90, 0.5, 1, 3);
    80   param3Field = new DoubleSpinBox(addCmdGroupBox->NewRow(), "Param3",
    81                                 -90, 90, 0.5, 1, 3);
     76  param1Field = new DoubleSpinBox(addCmdGroupBox->NewRow(), "Param1", -90, 90, 0.5, 1, 0);
     77  latitudeField = new DoubleSpinBox(addCmdGroupBox->LastRowLastCol(), "Longitude", -90, 90, 0.5, 1, 1.5);
     78  param2Field = new DoubleSpinBox(addCmdGroupBox->NewRow(), "Param2", -90, 90, 0.5, 1, 0);
     79  longitudeField = new DoubleSpinBox(addCmdGroupBox->LastRowLastCol(), "Latitude", -90, 90, 0.5, 1, -1.5);
     80  param3Field = new DoubleSpinBox(addCmdGroupBox->NewRow(), "Param3", -90, 90, 0.5, 1, 0);
     81  altitudeField = new DoubleSpinBox(addCmdGroupBox->LastRowLastCol(), "Altitude", -90, 90, 0.5, 1, 2);
    8282  btnAddMissionCmd = new PushButton(addCmdGroupBox->NewRow(), "Add mission cmd");
    8383  btnDelMissionCmd = new PushButton(addCmdGroupBox->LastRowLastCol(), "Del mission cmd");
     
    145145  stringStream.precision(1);
    146146  stringStream << fixed;
    147   stringStream << commandsAvailable[comboCmd->CurrentIndex()] << "|" << param1Field->Value() << "|" << param2Field->Value() << "|" << param3Field->Value();
     147  stringStream << commandsAvailable[comboCmd->CurrentIndex()] << "|" << param1Field->Value() << "|" << param2Field->Value() \
     148               << "|" << param3Field->Value() << "|" << latitudeField->Value() << "|" << longitudeField->Value() << "|" << altitudeField->Value();
    148149  return stringStream.str();
    149150}
  • branches/mavlink/tools/Controller/Mavlink/src/GuiInterface.h

    r77 r81  
    7777  flair::gui::DoubleSpinBox* param1Field;
    7878  flair::gui::DoubleSpinBox* param2Field;
    79   flair::gui::DoubleSpinBox* param3Field; 
     79  flair::gui::DoubleSpinBox* param3Field;
     80  flair::gui::DoubleSpinBox* latitudeField;
     81  flair::gui::DoubleSpinBox* longitudeField;
     82  flair::gui::DoubleSpinBox* altitudeField;
    8083  flair::gui::PushButton* btnAddMissionCmd;
    8184  flair::gui::PushButton* btnDelMissionCmd;
Note: See TracChangeset for help on using the changeset viewer.