forked from generalized-intelligence/GAAS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feature] added JSONSerializable abstract class; added url for json r…
…equest lib; added FCSurveillance framework.
- Loading branch information
1 parent
bd67829
commit b56e7c7
Showing
10 changed files
with
107 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
algorithms/src/SystemManagement/json_request_response_lib/src/JSONSerializableAbstract.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#ifndef JSON_SERIALIZABLE_ABSTRACT_H | ||
#define JSON_SERIALIZABLE_ABSTRACT_H | ||
#include <string> | ||
#include <memory> | ||
#include "third_party/nlohmann_json/single_include/nlohmann/json.hpp" | ||
using json = nlohmann::json; | ||
|
||
class JSONSerializableAbstract{ | ||
|
||
public: | ||
virtual json getJSONObject() = 0; | ||
}; | ||
|
||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
algorithms/src/SystemManagement/state_surveillance/src/FlightControllerSurveillance.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#ifndef FLIGHT_CONTROLLER_SURVEILLANCE_H | ||
#define FLIGHT_CONTROLLER_SURVEILLANCE_H | ||
|
||
#include "SurveillanceModuleAbstract.h" | ||
#include "gaas_msgs/GAASSystemManagementFlightControllerState.h" | ||
#include <geometry_msgs/PoseStamped.h> | ||
|
||
class FlightControllerModule:SurveillanceModuleAbstract | ||
{ | ||
int runPipelineAndGetState(const gaas_msgs::GAASSystemManagementFlightControllerStateConstPtr& pFCState) | ||
//int runPipelineAndGetState(const geometry_msgs::PoseStampedConstPtr& pFCPose) | ||
{ | ||
if(!this->ever_init) | ||
{ | ||
this->lastFCState = *pFCPose; | ||
this->current_status = this->STATUS_NOT_SURE; | ||
this->ever_init = true; | ||
return this->current_status; | ||
} | ||
//已初始化: | ||
//bool speed_and_angular_rate_correct = checkSpeedAndAngularRate(); | ||
//if(!speed_and_angular_rate_correct) | ||
//{ | ||
// this->current_status = this->STATUS_ERROR; | ||
//} | ||
//else | ||
//{ | ||
// this->current_status = this->STATUS_CORRECT; | ||
//} | ||
return this->current_status; | ||
|
||
} | ||
void initSurveillanceModule() | ||
{ | ||
setModuleName("Flight Controller Module"); | ||
} | ||
int checkStateLegal() | ||
{ | ||
return this->current_status; | ||
} | ||
private: | ||
bool ever_init = false; | ||
gaas_msgs::GAASSystemManagementFlightControllerState lastFCState; | ||
geometry_msgs::PoseStamped lastPose;//手动计算.... | ||
bool checkSpeedAndAngularRate(const geometry_msgs::PoseStamped& pose1,const geometry_msgs::PoseStamped& pose2); | ||
|
||
}; | ||
|
||
|
||
|
||
#endif |