#ifndef _JFX_INTERFACE_DEFINE_H_
#define _JFX_INTERFACE_DEFINE_H_

#include <cstdint>
#include <vector>

namespace jf {

/**
 * 接受到的gps数据
 */
struct GpsData_ {
    GpsData_() : time_stamp(0.0), latitude(0.0), longitude(0.0), altitude(0.0), heading_angle(0.0), vehicle_speed(0.0), solution_mode() {}
    double time_stamp;
    double latitude;
    double longitude;
    double altitude;
    double heading_angle;
    double vehicle_speed;
    std::string solution_mode;
};

struct point_ {
    point_() : dLon(0.0), dLat(0.0), dAlt(0.0) {}
    point_(double dLon,double dLat, double dAlt) : dLon(dLon), dLat(dLat), dAlt(dAlt) {}
    double dLon;
    double dLat;
    double dAlt;
};

struct SetPathMsg_ {
    SetPathMsg_() : arrptWayPoints() {}

    std::vector<point_> arrptWayPoints;
};

struct lane_ {
    lane_() : lId(0), nLanesCnt(0), nLaneSeqNum(0), ptLaneStart(),nSpeedLimit(0), ptLaneEnd(), nLaneWidth(0), lLeftEdgeId(0), lRightEdgeId(0), turnWaiting(0), arrlNxtLanes(),nLaneType(0)  {}
    int64_t lId;
    int32_t nLanesCnt;
    int32_t nLaneSeqNum;
    point_ ptLaneStart;
    point_ ptLaneEnd;
    int nLaneWidth;
    int64_t lLeftEdgeId;
    int64_t lRightEdgeId;
    int32_t turnWaiting;
    std::vector<int64_t> arrlNxtLanes;
    int32_t nLaneType;
    int32_t nSpeedLimit;
};

struct block_ {
    block_() : lId(0), nLaneSeqNum(0), arrptTrack(), dDriveLen(0.0), nDriveDirect(0) {}
    int64_t lId;
    int32_t nLaneSeqNum;
    std::vector<point_> arrptTrack;
    double dDriveLen;
    int32_t nDriveDirect;
};

struct edge_ {
    edge_() : lId(0), arrptGeo(), edgeType(0), nAttrib(0) {}
    int64_t lId;
    std::vector<point_> arrptGeo;
    int32_t edgeType;
    int32_t nAttrib;
};

struct landmark_ {
    landmark_() : ptPos(), nType(0), shape(0), type1(0), type2(0), dDistance(0.0),Id(0) {}

    std::vector<point_> ptPos;
    int32_t nType;
    int32_t shape;
    int32_t type1;
    int32_t type2;
    double dDistance;
    int64_t Id;
};  // struct landmark_

struct link_ {
    link_() : arrlnLanes(), arregEdges(), nHighLimit(0), nWeightLimit(0), nRoadLevel(0), fStartAngle(0.0), fEndChangedAngle(0.0) {}
    std::vector<lane_> arrlnLanes;
    std::vector<edge_> arregEdges;
    int32_t nHighLimit;
    int32_t nWeightLimit;
    int32_t nRoadLevel;
    float fStartAngle;
    float fEndChangedAngle;

};  // struct link_

struct ros_time_ {
    ros_time_() : secs(0), nsecs(0) {}
    uint32_t secs;
    uint32_t nsecs;
};

struct ros_header_ {
    uint32_t seq;
    ros_time_ stamp;
    std::string frame_id;
};

struct PathAheadMsg_ {
    PathAheadMsg_() : Header(), bIsSuccess(false), ptCurLoc(), nCurBlockIndex(0), arrlkAheadPath(), arrlmAheadLandmark() {}

    ros_header_ Header;
    uint8_t bIsSuccess;
    point_ ptCurLoc;
    int32_t nCurBlockIndex;
    std::vector<link_> arrlkAheadPath;
    std::vector<landmark_> arrlmAheadLandmark;
};

struct PathPlanMsg_ {
    PathPlanMsg_() : Header(), bIsSuccess(false), bIsChanged(false), ptCurLoc(), arrblPath() {}
    ros_header_ Header;
    uint8_t bIsSuccess;
    uint8_t bIsChanged;
    point_ ptCurLoc;
    std::vector<block_> arrblPath;
};

}  // namespace jf

#endif  // _JFX_INTERFACE_DEFINE_H_