123456789101112131415161718192021222324252627282930313233343536373839404142 |
- #include <stdint.h>
- #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;
- RemoNet::CCRadarMessage Req;
- Req.ParseFromArray(data, length);
- _radar->OnRadarData(Req.radar0(), Req.radar1(), Req.radar2(), Req.radar3(), Req.radar4(), Req.radar5(), Req.radar6(), Req.radar7());
- /*
- 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],range[7]);
- _radar->OnEncodeData(Req.left_encode(), Req.right_encode());
- */
-
- }
|