장거리로 사용되는데 적합한 측정용 스캐너입니다. 안전한 클래스1의 레이저 제품입니다만, 흑색으로30m까지의 측정이 가능합니다. 안개의 보정 기능을 내장하고 있으므로, 시야가 나쁜 상태에서도 안개에 의한 오작동이 없고, 안정된 측정을 할 수 있습니다.
Carnegie Mellon Vehicle 사용예
The SICK Laser Measurement Sensor LMS 200
is an extremely accurate distance measurement sensor that is quickly becoming a staple of the robotics community. The LMS 200 can easily be interfaced through RS-232 or RS-422, providing distance measurements over a 180 degree area up to 80 meters away. As this sensor grows in popularity, the ability to program code to interact with this sensor becomes an essential skill for all roboticists.
The purpose of this tutorial is to teach you how to operate the SICK LMS-200 and construct a basic Visual Basic program to acquire data. This tutorial will tell you how the SICK works, how to set up the SICK hardware, how to operate the provided software and how to make a VB6 program to acquire data. This tutorial assumes you have basic hardware skills such as soldering and basic programming skills with Visual Basic 6.0.
From this point forward, I identify this sensor as "Sick Laser". Since this device communicates with a computer by a serial port (RS232 and RS422), I decided to develop a simple interface in Matlab to configure the Sick Laser and to make some acquisitions. The code was tested in Matlab R13 (6.5.1).
First of all it is necessary to open a serial port to establish the communication with the Sick Laser. The serial port object returned by the function
sick_port = openPort(PORT,BAUDRATE)
must be configured according to the baudrate and other specifications (mainly the TimeOut, OutputBufferSize, OutputBufferSize for optimization purposes). For simplicity, If the user has the certainty that the serial port PORT is free and available, the previous function may be replaced by
sick_port = serial(PORT,'BaudRate',BAUDRATE)
The PORT corresponds to the serial port device (ex: 'COM1') and the BAUDRATE, the required baudrate (the possible values supported by the Sick Laser are 9600, 19200, 38400 and 500000 bps).
The next step consists on the first trial to communicate with the Laser:
This function tries to establish a communications with the Sick Laser at the current baudrate. If the communication fails, it tries again with a different baudrate. If the communication fails at all possible baudrates, the communication can not be established (the current serial port may be reserved/used by other software, or it must be a different serial port, or even a hardware problem, cables or the Sick Laser).
At this point, it is necessary to notice that the Sick Laser has two modes of operation: the Installation Mode and Operation Mode. The Installation Mode is defined for configurations and the Operation Mode for acquisitions. The current mode is switched by functions
For instance to change the current baudrate, the Sick Laser must be working in Installation Mode. By default, when the Sick Laser is switched on, it is configured to communicate at 9600 bps. The function
switches to the required NEW_BAUDRATE.
At Installation Mode it is possible to adopt several configurations. A wrong configuration could be solved by a hardware reset. The function
performs a hardware reset, similar to a power off - power on.
At this moment, the Sick Laser must be switched to Operation Mode and it is ready to make acquisitions. The function
out = getScan(sick_port)
returns a vector with 361 measured values, corresponding to a scan of 180º with an increment of 0.5º.
To explain the previous functions, it is necessary to introduce the telegrams. The information or data exchanged with the Sick Laser is carried by telegrams. There are two types of telegrams,
telegrams to the Sick Laser:
and telegrams from the Sick Laser:
where each cell contains two bytes (ex: STX = 02h = 0x02h = 0x02). The data is transferred in binary format and INTEL data format (word transfer takes place with lower address and the least significant byte first and then bytes of higher significance and higher address).
The telegrams finish with the CRC. For example, the following telegram requests an acquisition (CMD = 0x30 and MODE = 0x01):
The response starts with ACK if received correctly within 60ms or NAK if an error occurred,
If ACK is received, the next telegram is the response to the last request.
The response to the previous example (an acquisition request) is
where the body includes the 361 sampling (722 bytes):
Resuming, a telegram to the Sick Laser is compiled as follows:
Some examples of telegrams are presented. In each telegram, the message body (msg_body) is set by the command and options (if required).
For initialization, which is equivalent to a hardware reset (a power off - power on):
CMD = 0x10; msg_body = CMD;
To testing the device:
CMD = 0x31; msg_body = CMD;
For changing to a new BaudRate (MODE = 0x42, 0x41, 0x40 and 0x48, equivalent to 9600, 19200, 38400 and 500000 kbps)
CMD = 0x20; MODE = 0x40; msg_body = [CMD MODE];
As previously referred, the Sick Laser works at two different modes: Installation Mode and Operation Mode. For switching to Installation Mode it is necessary to introduce the password (in this case, the password is "SICK_LMS", equivalent to 0x53 0x49 0x43 0x4B 0x5F 0x4C 0x4D 0x53 in ASCII)
delay(sick_port,0); if sick_port.BytesAvailable msg = fread(sick_port,len,'uint8'); else msg = ; end
Both functions require a delay (testing the transfer status of the current serial port). This function must include the instruction "drawnow", otherwise the user can not interrupt the acquisitions (even with Ctrl+C).