E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 2813 (apt-get) N: Be aware that removing the lock file is not a solution and may break your system. E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
1
sudo killall apt apt-get
2
sudo rm /var/lib/apt/lists/lock
3
sudo rm /var/cache/apt/archives/lock
4
sudo rm /var/lib/dpkg/lock*
실행후 다시 5번 실행
설치 완료후 우부툰 files 실행 (각 버전마다 12, 13, 14 이렇게 중간 폴더 이름이 틀림)
아무리 계산해도... 거리랑 값이 틀리게 나옴. 그래서 본사에 메일 보내보니 G2 메뉴얼상 프로토콜이 틀림 ; (
메인 회신 내용
=======================
The response content is the point cloud data scanned by the system. According to the following data format, the data is sent to the external device in hexadecimal to the serial port. Intensity Byte Offset:
Scan data format output by LiDAR:
Content Name Description PH(2B) Packet header 2 Byte in length, Fixed at 0x55AA, low is front, high in back. CT(1B) Package type Indicates the current packet type. (0x00 = CT & 0x01): Normal Point cloud packet. (0x01 = CT & 0x01): Zero packet. LSN(1B) Sample Data Number Indicates the number of sampling points contained in the current packet. There is only once zero point of data in thre zero packet. the value is 1. FSA(2B) Starting angle The angle data corresponding to the first sample point in the smapled data. LSA(2B) End angle The angle data corresponding to the last sample point in the sampled data. CS(2B) Check code The check code of the current data packet uses a two-byte exclusive OR to check the current data packet. Si(3B)Sampling data The system test sampling data is the distance data of the sampling point. Zero resolution Start data packet: (CT & 0x01) = 0x01, LSN = 1, Si = 1. For the analysis of the specific values of distance and angle, see the analysis of distance and angle.
Distance and Intensity analysis: Si(3B) split into three bytes : S(0) S(1) S(2)
Inensity solution formula: Triangle LiDAR: Intensity(i) = uint16_t((S(1) & 0x03)<< 8 | S(0)); Distance solution formula: Triangle LiDAR: Distance(i) = uint16_t(S(2) << 8 | S(1)) >> 2; Si is sampling data. Sampling data is set to 1F E5 6F. Since the system is in the little-endian mode, the sampling point S(0) = 0x1F, S(1) = 0xE5, S(2) = 0x6F, and it is substituted into the distance solution formula, which yields
Rshiftbit(data,1) means shifting the data to the right by one bit.diff Angle means the clockwise angle difference from the starting angle (uncorrected value) to the ending angle (uncorrected value),and LSN represents the number of packet samples in this frame.
diff(Angle): (Angle(LSA) - Angle(FSA)) If less than zero, diff(Angle) = (Angle(LSA)- Angle(FSA)) + 360, otherwise diff(Angle) = (Angle(LSA)- Angle(FSA))
Second-level analysis: TOF LiDAR has no Second-level analysis. Angle correction formula: $Angle_{i} = Angle_{i} + AngCorrect_{i}$; ($1,2,\ldots,LSN$) AngCorrect is the angle correction value, and its calculation formula is as follows, $tand^{-1}$ is an inverse trigonometric function. and the return angle value is:
$AngCorrect_{i}$ need to convert to degree. In the data packet, the 4th to 8th bytes are 28 E5 6F BD 79, so LSN = 0x28 = 40(dec), FSA = 0x6FE5, LSA = 0x79BD, and bring in the first-level solution formula, and get: $Angle_{FSA} = 223.78^{°}$ $Angle_{LSA} = 243.47^{°}$ $diff(Angle) = Angle_{LSA} - Angle_{FSA} = 243.47^{°} - 223.78^{°} = 19.69^{°}$ $Angle_{i} = \frac{19.69^{°}}{39}*(i -1) + 223.78^{°}$ ($1,2,\ldots,LSN$) Assume that in the frame data: $Distance_{1} = 1000$ $Distance_{LSN} = 8000$ bring in the second-level solution formula, you get: $AngCorrect_{1} = -6.7622^{°}$ $AngCorrect_{LSN} = -7.8374^{°}$ $Angle_{FSA} = Angle_{1} + AngCorrect_{1} = 217.0178^{°}$ $Angle_{LSA} = Angle_{LSA} + AngCorrect_{LSA} = 235.6326^{°}$ Similarly, $Angle_{i}(2,3, \ldots,LSN-1)$, can be obtained sequentially.
for(int i = 0; i < LSN; i++) { if(Distance[i] > 0) { double AngCorrect = atan(21.8 * (155.3 - Distance[i]) / (155.3 * Distance[i])); Angle[i] += AngCorrect * 180 / M_PI; // M_PI 3.1415926 } if(Angle[i] >= 360) { Angle[i] -= 360; } } Check code parsing: The check code uses a two-byte exclusive OR to verify the current data packet. The check code itself does not participate in XOR operations, and the XOR order is not strictly in byte order. The XOR sequence is as shown in the figure. Therefore, the check code solution formula is:
$$ CS = XOR \sum_{i=1}^{n}(C^i)$$
CS Sequence
PH C(1) FSA C(2) S1 C(3) S2 C(4) ... .. Sn C(n-2) [CT | LSN] C(n-1) LSA C(n) Note: XOR(end) indicates the XOR of the element from subscript 1 to end. However, XOR satisfies the exchange law, and the actual solution may not need to follow the XOR sequence. Code Intensity Si(3B):