123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- #include "LivoxMid100Laser.h"
- #include "../common.h"
- RegisterLaser(LivoxMid100)
- CLivoxMid100Laser::CLivoxMid100Laser(int id, Automatic::stLaserCalibParam laser_param)
- :CLivoxLaser(id, laser_param)
- {
- m_frame_maxnum = laser_param.frame_num();
- if (laser_param.type() == "LivoxMid100")
- {
- std::string sn = laser_param.sn();
- std::string sn1 = sn, sn2 = sn, sn3 = sn;
- sn1 += "1";
- sn2 += "2";
- sn3 += "3";
- g_sn_laser.insert(std::make_pair(sn1, this));
- g_sn_laser.insert(std::make_pair(sn2, this));
- g_sn_laser.insert(std::make_pair(sn3, this));
- }
- }
- void CLivoxMid100Laser::UpdataHandle()
- {
- std::string sn = m_laser_param.sn();
- std::string sn1 = sn, sn2 = sn, sn3 = sn;
- sn1 += "1";
- sn2 += "2";
- sn3 += "3";
- if (g_sn_handle.find(sn1) != g_sn_handle.end())
- {
- m_handle1 = g_sn_handle[sn1];
- }
- if (g_sn_handle.find(sn2) != g_sn_handle.end())
- {
- m_handle2 = g_sn_handle[sn2];
- }
- if (g_sn_handle.find(sn3) != g_sn_handle.end())
- {
- m_handle3 = g_sn_handle[sn3];
- }
- }
- bool CLivoxMid100Laser::IsScanComplete()
- {
- return g_count[m_handle1] >= m_frame_maxnum && g_count[m_handle2] >= m_frame_maxnum
- && g_count[m_handle2] >= m_frame_maxnum;
- }
- eLaserStatu CLivoxMid100Laser::GetStatu()
- {
- bool cond1=g_devices[m_handle1].device_state == kDeviceStateConnect ||
- g_devices[m_handle1].device_state == kDeviceStateSampling;
- bool cond2=g_devices[m_handle2].device_state == kDeviceStateConnect ||
- g_devices[m_handle2].device_state == kDeviceStateSampling;
- bool cond3=g_devices[m_handle3].device_state == kDeviceStateConnect ||
- g_devices[m_handle3].device_state == kDeviceStateSampling;
- if (cond1 && cond2 && cond3) {
- if(m_queue_laser_data.size()==0 && m_bscan_start==false)
- m_statu = eLaser_ready;
- else
- m_statu = eLaser_busy;
- }
- else {
- m_statu = eLaser_disconnect;
- }
- return m_statu;
- }
- bool CLivoxMid100Laser::Connect()
- {
- return CLivoxLaser::Connect();
- }
- void CLivoxMid100Laser::Disconnect()
- {
- CLivoxLaser::Disconnect();
- }
- bool CLivoxMid100Laser::Stop()
- {
- return CLivoxLaser::Stop();
- }
- bool CLivoxMid100Laser::Start()
- {
- LOG(INFO) << " livoxMid100 start :" << this;
- //������ݣ���ʼ
- m_queue_livox_data.clear();
- g_count[m_handle1] = 0;
- g_count[m_handle2] = 0;
- g_count[m_handle3] = 0;
- return CLaser::Start();
- }
- CLivoxMid100Laser::~CLivoxMid100Laser()
- {
- }
|