https://sourceforge.net/p/urgnetwork/wiki/scip_capture_en/
Receive distance data
Explains the command used to get distance data from URG.
In SCIP protocol, Distance data is received by sending command to URG. Command includes required data range etc as the command parameter.
Image of Received distance data.
Differences between "GD, GS, MD, MS"
There are four types of command to receive data.They are GD, GS, MD, MS. These are classified based on the data receiving method.
In other words, GD/GS is used when only one scan distance data is required, where as MD/MS is used when distance data is required continuously.
Difference between GD/GS and MD/MS.
In case of GD, MD command represents 1 distance data using 3 byte ,but in case of GS, MS command 1 distance data is represented by 2 byte
In GD, MD command ... Distance data is represented using 3 bytes(Maximum 262,144(mm))
In GS, MS command ... Distance data is represented using 2 bytes(Maximum 4,085(mm))
It is appropriate to use GS, MS command if there is no need to measure distance more than 4095(mm), so that amount of data transfer can be reduced.
Specify parameters to receive distance data
Parameters that can be specified in distance data receive commands are,
Start step to receive distance data
End step to receive distance data
Scan interval, skipping the number of scans when obtaining multiple scan data can be set in Scan Interval.
Cluster Count, the number of adjacent steps that can be merged into single data (only in case of MD, MS commands)
Number of scans(Only in case of MD, MS commands)
Parameters of commands to get distance data
The value of starting step and end step depends on the types of URG used. For setting those values you can refer the values from "PP" command.
If Number of Scan is set to 00 the data is supplied indefinitely unless canceled using "QT" commands.
Decoding of distance data
Explains decoding methods with an actual distance data as an example.
Command to retrieve distance data and corresponding response from the Classic-URG sensor is as shown below.
Send data
GD0044072501
Array of received data
GD0044072501
00P
0DKO>
00i00i00i00i00k00k00n01101101101101101101100o00m00o00o0130130140]
14012012014015017017017016017017016016015015015014014014014015010
501801<01<01?01D01D01D01F01F01L01O01R01T01V01W01X01X01X01Z01Z01Ze
01\01b01j02;02`09H09H09Z09Z09_0:90:90:@0:@0:@0:;0:@0:;0:;0:90:90]
9Z08X08408408408608608608408408408408908908908908808608308008008V
007m07m07j07h07h07h07d06E04D04>04=04=04>04C04H04H04I04J04K04U04Ue
04X04X04X04W04W04W04W04[04]04_04`04`04h04l04l04n05005005305;05>0N
5D05F05J05M05Q05T05W05[05]05^05`05f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0b\0c10cH0ck0d;0dS0dg0eF0ek0fE0f_0g?0g]0h;0iV0j`0jaW
0jc0lY0l]0la0le0m>0mn0n[0oQ10110i11512W0000070000000000000000000L
000000071?d1?d1Af1Af1B800000000000000000000000000000000000000000j
00000000000000000000000000000000000000000000000000000000000000000
00000000000000005@05905905905805304m04N03P03F03@02n03202i02b02Y0U
2:02101h01h01h01d01m01n01o02002002001i01d01d01d01l01l01l01l01l01m
l01o01o01o01o02102102102101k01k01k01k01k01h01_01S01Q01P01P01P01PW
01O01Q01O01N01N01N01N01M01M01G01I01H01G01H01H01G01E01A01>01=01=0J
1=01:0180170170160170180180180190190190190170140140140140140139
First 3 return lines are echoback, status and timestamp respectively.
GD0044072501
00P
0DKO>
1st Line GD0044072501 ... Echo back of sent command
2nd Line 00P ... Status code that represent normal(00) + Checksum(P)
3rd Line 0DKO> ... Time stamp(0DKO) + Check sum(>)
682(725 - 44 + 1) individual distance data are received after first 3 lines.
Distance data and time stamp obtained from the URG are in encoded form composed of ascii characters.Therefore it should be decoded. Below function can be used for decoding.
int decode(const char code[], int byte) {
int value = 0;
int i;
for (i = 0; i < byte; ++i) {
value <<= 6;
value &= ~0x3f;
value |= code[i] - 0x30;
}
return value;
}
For example, to decoding of above time stamp "0DKO" is done as below
int timestamp = decode("0DKO", 4);
As a result, assign 83679 in timestamp (83,679 (msec))
In each line of received distance data consist of 64 bytes of distance data and 65th byte is a check sum of that line.
00i00i00i00i00k00k00n01101101101101101101100o00m00o00o0130130140]
14012012014015017017017016017017016016015015015014014014014015010
Be careful that, distance data may be divided at the end of line, when distance data is represented by 3 bytes.
In addition, if obtained distance is lesser than command's "PP" AMIN value then indicate the measurement error
Measurement error outbreaks when obtained data is out of range or while measuring lustrous metals or reflected signal is very weak for calculation.
Method to minimize the quantity of receive data
While MD/MS is used to receive distance data, data is transmitted for each scan of URG. In case of Top-URG, if entire range of data is measured then for every 25 (msec), 3 kbytes will be transmitted.
To reduce this receive data, -Restrict the receive range to required range -> If required range is reduced to half, then data received is also reduced to half. -If "distance data's cluster count " is equal to 2 then, angular resolution reduced to half -> data received is also reduced to half. -Reduce the data receiving frequency by setting the "Number of scan".
For further details refer SCIP 2.0 communication specification.
"GD", "GS"
Receive distance data only 1 time
For parameter details refer SCIP 2.0 communication specification.
"MD", "MS"
Receive successive distance data.
For parameter details refer SCIP 2.0 communication specification.
'Development > Hokuyo Sensor' 카테고리의 다른 글
Hokuyo Sensor Data Sheet - PDF file (0) | 2022.04.04 |
---|---|
Hokuyo product Overview (0) | 2022.03.30 |
Hokuyo - ROS (to read scanning data, laser rangefinder) (0) | 2022.03.14 |