The general approach to implementing the drone code into PM is as follows:
#ifdef IS_FIXED_WING //fixed wing code #else //drone code #endif
Things we have done
pathStateClasses.hpp
#include "TelemPathInterface.hpp"
//for drone code class commsWithTelemetry : public pathManagerState { public: //other code static fijo* GetTelemetryIncomingData(void) {return &_incomingData;} private: commsWithTelemetry() {CommWithTelemInit();} commsWithTelemetry(const commsWithTelemetry& other); commsWithTelemetry& operator =(const commsWithTelemetry& other); 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
deleted the unneeded takeoff and landing stages
Currently working on merging the initialization and continuous waypoint setting into one stage
CommsWithTelemetry.hpp
#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
struct gpsCoordinatesFIJO{ double longitide; double lattiude; }; struct fijo{ // uint8_t start; ? struct gpsCoordinatesFIJO gpsCoord; bool qrScanFlag; bool takeoffCommand; bool detectFlag; } fijo;
struct CommandsForAM{ float rotation; //orientation? in radians? float desiredX, desiredY, desiredZ; }
Things to do
Finish the different stages
current calculations for the AM struct is in autosteer
there is no AM struct back to PM → will have to see where that affects the code
redefine waypoint datatype using info from cv (PathData in WM → requires lat, long, alt, is it takeoff?landing?pathfollow?home?)
altitude → macro
Determine next directions with the getNextDirectionsCommand
Noticed that fijo may not be recognized
WaypointManager:
review the math for gps coordinates
Link the current position (given from sensor fusion) and target(future) waypoint (needing for path following math)
calculating desired track between target and waypoint after target (need to also link these)
Pathfollow requires track and position → calculate this
Is there a situation where we would need to edit flight path (on the way from a→b, change to a → d → b)
Vector???
Add Comment