#ifndef _JFX_CNSENLD_ROS_INTERFACE_H_
#define _JFX_CNSENLD_ROS_INTERFACE_H_

#include <ros/ros.h>

#include "InterfaceDefine.hpp"
#include "MapInterface.hpp"
#include "hd_map_msgs/PathAheadMsg.h"
#include "hd_map_msgs/PathPlanMsg.h"
#include "ins_interface_msgs/GpsData.h"
#include "ins_interface_msgs/SetPathMsg.h"

namespace jf {
class RosInterface {
   public:
    RosInterface(const std::string& prj_dir, const std::string& cfg_dir, const double sc_dLMReportDis);
    ~RosInterface();

   private:
    ros::NodeHandle nodeHandle;
    ros::Subscriber m_subGpsData;
    ros::Subscriber m_subSetPath;
    ros::Publisher m_pubPathAhead;
    ros::Publisher m_pubPathPlan;
    MapInterface m_mapInterface;

    void HandleGpsData(const ins_interface_msgs::GpsData::ConstPtr& msg);
    void HandleSetPathMsg(const ins_interface_msgs::SetPathMsg::ConstPtr& msg);

    void CoverToPathAheadMsg(const jf::PathAheadMsg_& pathAheadMsg);
    void CoverToPathPlanMsg(const jf::PathPlanMsg_& pathPlanMsg);

    /****ROS消息转换******/
    void TransformToRosMsg_point(const jf::point_& point, hd_map_msgs::point& ros_point);
    void TransformToRosMsg_block(const jf::block_& block, hd_map_msgs::block& ros_block);
    void TransformToRosMsg_edge(const jf::edge_& edge, hd_map_msgs::edge& ros_edge);
    void TransformToRosMsg_landmark(const jf::landmark_& landmark, hd_map_msgs::landmark& ros_landmark);
    void TransformToRosMsg_lane(const jf::lane_& lane, hd_map_msgs::lane& ros_lane);
    void TransformToRosMsg_link(const jf::link_& link, hd_map_msgs::link& ros_link);
};
}  // namespace jf
#endif  // _JFX_ROS_INTERFACE_H_