Esempio n. 1
0
        public void Set_preference(SensorInfo sensor_info, LidarConfig lidar_config)
        {
            //sensor setting
            m_SensorInfo  = sensor_info;
            m_LidarConfig = lidar_config;

            //Lidar emulation variable setting
            m_RayChannelNum     = lidar_config.Channels;
            m_PulseNumPerUpdate = (int)Math.Round(lidar_config.Firing_rate * fixedDeltatime);
            m_HorzStartAngle    = 0f;
            m_VertInterval      = lidar_config.Vertical_fov / (lidar_config.Channels - 1);
            m_VertStartAngle    = -(lidar_config.Vertical_center_angle + (lidar_config.Vertical_fov / 2));
            m_HorzInterval      = lidar_config.Horizontal_fov / (lidar_config.Firing_rate / lidar_config.Refresh_rate);
            m_MaxDistance       = lidar_config.Range;
            m_HorzRotationLimit = lidar_config.Horizontal_fov * (lidar_config.Refresh_rate * fixedDeltatime);

            // Parallel Computing setting
            m_PointCount = m_PulseNumPerUpdate * m_RayChannelNum;

            m_Result         = new NativeArray <RaycastHit>(m_PointCount, Allocator.Persistent);
            m_RaycastCommand = new NativeArray <RaycastCommand>(m_PointCount, Allocator.Persistent);
            m_RayAngles      = new NativeArray <Vector2>(m_PointCount, Allocator.Persistent);

            m_Buffer             = new ComputeBuffer(m_PointCount, 16);
            m_LidarDetectionData = new NativeArray <DetectionData>(m_PointCount, Allocator.Persistent);
            m_WorldDetectionData = new NativeArray <DetectionData>(m_PointCount, Allocator.Persistent);
        }
Esempio n. 2
0
        void Start()
        {
            Time.fixedDeltaTime = fixedDeltatime;

            m_SensorInfo = new SensorInfo
            {
                Sensor_id         = 1,
                Sensor_type       = 1,
                Time_stamp        = DateTime.Now,
                Mounting_position = transform.position,
                Mounting_rotation = transform.rotation
            };

            SelectLidarType();
            if (m_isPreciseGeometricModel)
            {
                m_VertOffset = 0.000925f; // for precise geometric simulation
            }
            stw.Start();
        }
 public LidarSensorData(SensorInfo sensor_info, LidarConfig lidar_config, IEnumerable <DetectionData> detection_data)
 {
     this.Sensor_info    = sensor_info;
     this.Lidar_config   = lidar_config;
     this.Detection_data = detection_data;
 }