Exemplo n.º 1
0
        static List <Radar> ProgramRadars;  //启用的雷达集合

        static List <Radar> radarSet(int maxnumber)  //设置可使用的雷达,其中maxnumber为单个雷达单次最大采样点数量
        {
            List <Radar> set = new List <Radar>();

            RadarSetting setting = new RadarSetting();              //雷达设置,area为雷达涵盖的区域坐标,capacity为雷达点的容量,

            setting.area     = new squareArea(1780, 0, 3560, 2000); //position为雷达的xy坐标,type为雷达的链接方式
            setting.capacity = maxnumber;                           //链接方式有TCP链接和串口链接,有默认的函数进行设置,当然也可以根据
            setting.position.set(2670, 2300, -180);                 //需要手动设置
            setting.type.setA2defaultTCP();

            RadarA2 radar1 = new RadarA2(setting);              //设置A2雷达

            radar1.connect();                                   //连接雷达
            if (radar1.isHealthAndConnect())                    //若连接成功,加入可用雷达序列
            {
                set.Add(radar1);
            }


            setting.type.setG4defaultSerial();
            setting.position.set(895, 2300, -180);
            setting.area = new squareArea(0, 0, 1790, 2000);
            RadarG4 radar2 = new RadarG4(setting);

            radar2.connect();
            if (radar2.isHealthAndConnect())
            {
                set.Add(radar2);
            }
            ProgramRadars = set;
            return(set);                                         //返回可用雷达集合
        }
Exemplo n.º 2
0
        private rplidar_response_measurement_node_hq_t[] nodeInformation;           //SDK接口返回的点数据

        public RadarA2(RadarSetting setting)
        {
            capacity        = setting.capacity;
            connectType     = setting.type;
            radarArea       = setting.area;
            radarPosition   = setting.position;
            xyData          = new XYPoint[capacity];
            nodeInformation = new rplidar_response_measurement_node_hq_t[capacity];
            dataNumber      = 0;
            createNewRadar();
        }
Exemplo n.º 3
0
        private string filePath = "setting.ini";     //初始化文件地址

        public RadarG4(RadarSetting setting, string path = "setting.ini", int rate = 15, int freq = 15, bool reversion = false)
        {
            sampleRate    = rate;
            scanFreq      = freq;
            ifReversion   = reversion;
            filePath      = path;
            radarPosition = setting.position;
            radarArea     = setting.area;
            connectType   = setting.type;
            capacity      = setting.capacity;
            createNewRadar();
            xyData     = new XYPoint[capacity];
            dataNumber = 0;
        }