#include #include "Protocol.pb.h" #include "../common/comm.h" #include "./include/EgoInterface.h" #include "EgoClient.h" #include "radar_sim.h" CRadarSim::CRadarSim(CEgoClient* radar) :_radar(radar) { } void CRadarSim::Start() { } void CRadarSim::Stop() { } void CRadarSim::OnPeerMessage(int16_t cmd, int16_t length, const void* data) { RemoNet::CCSensor Req; Req.ParseFromArray(data, length); int32_t range[7] = { 0 }; int32_t count = Req.node_size(); for (int32_t i = 0; i < count; i++) { //range[i] = Req.range(i); auto& n = Req.node(i); range[n.id()] = n.range(); } _radar->OnRadarData(range[0], range[1], range[2], range[3], range[4], range[5],range[6]); _radar->OnEncodeData(Req.left_encode(), Req.right_encode()); }