# -*- coding: utf-8 -*-
"""
Created on Fri Apr 27 16:24:13 2018

@author: avarfolomeev
"""

LASER_ANGLES = [-15, 1, -13, 3, -11, 5, -9, 7, -7, 9, -5, 11, -3, 13, -1, 15]
NUM_LASERS = 16

EXPECTED_PACKET_TIME = 0.001327  # valid only in "the strongest return mode"
EXPECTED_SCAN_DURATION = 0.1
DISTANCE_RESOLUTION = 0.002
ROTATION_RESOLUTION = 0.01
ROTATION_MAX_UNITS = 36000


SIZE_BLOCK = 100;
RAW_SCAN_SIZE = 3;
SCANS_PER_BLOCK = 32;
BLOCK_DATA_SIZE = (SCANS_PER_BLOCK * RAW_SCAN_SIZE);
TS_OFFSET = 1200

PACKET_SIZE = 1206;
BLOCKS_PER_PACKET = 12;
PACKET_STATUS_SIZE = 4;
SCANS_PER_PACKET = (SCANS_PER_BLOCK * BLOCKS_PER_PACKET);

ROTATION_RESOLUTION = 0.01; #/**< degrees */
ROTATION_MAX_UNITS = 36000; #/**< hundredths of degrees */

DISTANCE_MAX = 130.0;        #/**< meters */
DISTANCE_RESOLUTION = 0.002; #/**< meters */
DISTANCE_MAX_UNITS = (DISTANCE_MAX / DISTANCE_RESOLUTION + 1.0);

UPPER_BANK = 0xeeff;
LOWER_BANK = 0xddff;

VLP16_FIRINGS_PER_BLOCK =   2;
VLP16_SCANS_PER_FIRING  =  16;
VLP16_BLOCK_TDURATION   = 110.592;   #// [µs]
VLP16_DSR_TOFFSET       =   2.304;   #// [µs]
VLP16_FIRING_TOFFSET    =  55.296;   #// [µs]

VLP16_BLOCK_TDURATION_NS   = 110592;   #// [ns]
VLP16_DSR_TOFFSET_NS       =   2304;   #// [ns]
VLP16_FIRING_TOFFSET_NS    =  55296;   #// [ns]
