
FOV
Copyright © Nooploop LTd 2023. All Rights Reserved.
6FOV
The field of view (FOV) parameter represents the angle covered by the module's emitted
ranging light. The module's FOV parameter is 45 °horizontally and vertically, and 63 °
diagonally.
7Cascade Ranging
Multiple sensors can be configured with different IDs and connected in series, and the ranging
information of all sensors can be read through a single communication interface. The connection
schematic is shown in Figure 8. TOFSense MS only has one communication interface, so a converter is
required for cascading.
Figure 8: Cascade ranging diagram
Under cascade ranging, three methods are suitable: UART query, CAN query, and CAN active
output.
8Protocol Unpack
8.1 Introduction
This chapter's protocol analysis examples are based on the NLink protocol, and you can also
download the NlinkUnpack sample analysis code developed in C language from the official website,
which can effectively reduce the user's development cycle.
Based on the data situation of TOFSense-F series products, in order to represent more data with
fewer bytes, we use integers to represent floating-point numbers and transmit them through protocol
frames. Therefore, when unpacking, the actual data with the multiplier is actually a floating-point
number and needs to be divided by the multiplier indicated in the protocol.
In particular, for int24 type, we need to first convert it to int32 type. To maintain the sign, we use
the method of left shift and then divide by 256. For example, for position data, we use int24 to
represent it, and the multiplier is 1000. The parsing code is as follows:
uint8_t byte[] = {0xe6,0x0e,0x00};//Decimal value: 3.814
//uint8_t byte[] = {0xec,0xfb,0xff};//Decimal value: -1.044
int32_t temp = (int32_t)(byte[0] << 8 | byte[1] << 16 | byte[2] << 24) / 256;
float result = temp/1000.0f;
Currently, the protocol verification is mainly based on the single-byte checksum at the end of the
protocol frame. Example code:
uint8_t verifyCheckSum(uint8_t *data, int32_t length){
uint8_t sum = 0;
for(int32_t i=0;i<length-1;++i){
sum += data[i];
}
return sum == data[length-1];