76 lines
2.9 KiB
C++
76 lines
2.9 KiB
C++
/**
|
|
* AutomaticService.h
|
|
*
|
|
* @brief: 自动驾驶服务接口
|
|
* @author: zhanke
|
|
* @history: 2024-08-01, move from java project
|
|
*/
|
|
|
|
#ifndef AUTOMATIC_SERVICE_H_
|
|
#define AUTOMATIC_SERVICE_H_
|
|
|
|
#include "AutomaticServiceDefines.h"
|
|
#include "FieldModelCftc.h"
|
|
#include "FieldModelDcrk.h"
|
|
#include "FieldModelPdqb.h"
|
|
#include "FieldModelQxxs.h"
|
|
#include "FieldModelZjzw.h"
|
|
#include "IAutomaticService.h"
|
|
#include "TrackInfo.h"
|
|
#include "TrackModeManager.h"
|
|
|
|
using graphic::AutoRect;
|
|
|
|
class AutomaticService : public IAutomaticService
|
|
{
|
|
public:
|
|
explicit AutomaticService();
|
|
virtual ~AutomaticService() = default;
|
|
|
|
virtual int autoServiceInit() override;
|
|
virtual int autoServiceSetBasePoint(const char *data, int length) override;
|
|
virtual int autoServiceSetFieldModel(const char *data, int length) override;
|
|
virtual int autoServiceSetTeachPointInfo(const char *data, int length) override;
|
|
virtual int autoServiceSetTeachPointParam(const char *data, int length) override;
|
|
virtual int autoServiceSetCarModel(const char *data, int length) override;
|
|
virtual int autoServiceSetLineInfo(const char *data, int length) override;
|
|
virtual int autoServiceSetLibInfo(const char *data, int length) override;
|
|
virtual int autoServiceSelectLineAndLib(int lineIndex, int libIndex) override;
|
|
virtual int autoServiceTrack(double x, double y, double yaw, double v) override;
|
|
virtual int autoServiceSetImageSize(int width, int height) override;
|
|
virtual int registerMapImageCallback(examJudgeCallbackMapImage callback) override;
|
|
virtual int registerAutoServiceControlCallback(autoServerControlCallback callback) override;
|
|
virtual int registerAutoServiceSoundCallback(autoServerSoundCallback callback) override;
|
|
virtual int registerAutoServiceLogCallback(autoServerLogCallback callback) override;
|
|
|
|
TrackInfo getTrack();
|
|
|
|
private:
|
|
void drawFieldModel(int x, int y);
|
|
void drawCarModel(double yaw);
|
|
void drawSelectedLine(int x, int y);
|
|
void drawSelectedLib(int x, int y);
|
|
void drawCarHistoryPos(int x, int y);
|
|
|
|
TrackInfo *pTrackInfo_ = nullptr; // 外部跟踪输入信息
|
|
TrackModeManager *pTrackModeManager_ = nullptr; // 跟踪循迹模块
|
|
IGraphicAbstract *pGraphicTool_ = nullptr; // 绘图工具
|
|
|
|
AutoRect mapRect_; // 绘图范围(单位:米)
|
|
double unit_ = 0.0; // 绘图单位长度(单位:像素/米)
|
|
int imageWidth_ = 0; // 绘图宽度(单位:像素)
|
|
int imageHeight_ = 0; // 绘图高度(单位:像素)
|
|
|
|
int selectedLineIndex_ = 0;
|
|
int selectedLibIndex_ = 0;
|
|
|
|
examJudgeCallbackMapImage mapImageCallback_ = nullptr;
|
|
autoServerControlCallback controlCallback_ = nullptr;
|
|
autoServerSoundCallback soundCallback_ = nullptr;
|
|
|
|
std::vector<FieldModelAbstractClass *> fieldModelPtrList_; // 场地模型指针列表
|
|
std::vector<std::vector<double>> historyPosList_; // 车辆历史位置
|
|
};
|
|
|
|
#endif // !AUTOMATIC_SERVICE_H_
|