...
pathStateClasses.hpp
Code Block #include "TelemPathInterface.hpp"
Code Block //for drone code class commsWithTelemetry : public pathManagerState { public: // other code is here static fijo* GetTelemetryIncomingData(void) {return &_incomingData;} private: //commsWithTelemetry() setup code is here static fijo _incomingData; // Stores the commands sent by telemetry for easy access by other states in the pathmanager' };
pathStateClasses.cpp
changed all instances of PIGO struct to fijo for drone code
fijo commsWithTelemetry::_incomingData;
pathStateClasses.cpp and hpp
declared incoming telem data as fijo…may not recognize it…look at “Things to do“ for more info
deleted the unneeded takeoff and landing stages
Currently working on merging the initialization and continuous waypoint setting into one stage
takeoffRollStage is now
preflightStage
and takeoffClimbStage is now
takeoffStage
WaypointManager.hpp
updated
_PathData
,_WaypointOutputType
, and_WaypointManager_data_out
Code Block enum _WaypointOutputType {PATH_FOLLOW = 0, TAKEOFF_WAYPOINT, LANDING_WAYPOINT, HOME_WAYPOINT}; /** * Structure stores information about the waypoints along our path to the destination and back. Got rid of turn radius */ struct _PathData { int waypointId; // Id of the waypoint _PathData * next; // Next waypoint _PathData * previous; // Previous waypoint long double latitude; // Latitude of waypoint long double longitude; // Longitude of waypoint int altitude; // Altitude of waypoint _WaypointOutputType waypointType; }; struct _WaypointManager_Data_Out{ uint16_t desiredTrack; // Desired track to stay on path int desiredAltitude; // Desired altitude at next waypoint long double distanceToNextWaypoint; // Distance to the next waypoint (helps with airspeed PID) _WaypointStatus errorCode; // Contains error codes bool isDataNew; // Notifies PID modules if the data in this structure is new int desiredAirspeed; uint32_t timeOfData; // The time that the data in this structure was collected _WaypointOutputType out_type; // Output type (determines which parameters are defined) };
CruisingState.hpp
replaced telemetry input data struct, removed inHold boolean, unsure what to do about goingHome boolean
Code Block _ModifyFlightPathErrorCode editFlightPath(fijo * telemetryData, WaypointManager& cruisingStateManager, int * idArray); // Removed the inHold boolean flag as hovering/holding feature was removed for code _GetNextDirectionsErrorCode pathFollow(fijo * telemetryData, WaypointManager& cruisingStateManager, _WaypointManager_Data_In input, _WaypointManager_Data_Out * output, bool& goingHome);
CommsWithTelemetry.hpp
Code Block #ifdef IS_FIXED_WING bool GetTelemetryCommands(Telemetry_PIGO_t *commands); #else bool GetTelemetryCommands(fijo *commands); #endif
redefined PM-TM (TelemPathInterface.h) and PM-AM structs (AttitudePathInterface.h) as shown below
Code Block struct gpsCoordinatesFIJO{ double longitide; double lattiude; }; struct fijo{ // uint8_t start; ? struct gpsCoordinatesFIJO gpsCoord; bool qrScanFlag; bool takeoffCommand; bool detectFlag; } fijo;
Code Block struct CommandsForAM{ float rotation; //orientation? in radians? float desiredX, desiredY, desiredZ; }
...