Article Directory
Here are some pits I stepped on when using Ouster OS1-128 radar.
1. Hardware connection
I use the OS1-128 line radar here. It looks like this. The actual size is quite small, less than a palm, and smaller than the Sagitar/Hesai/Velodyne products. You can go to their official website for details: Ouster official website
The connection method of the data cable is basically the same as that of other brands of radar. Here is a picture, which is very clear: It
should be noted that because this radar is American, the power plug that comes with it is American standard. You need to buy a national standard and American standard. The standard plug converter is ok.
2. IP configuration
First of all, I want to complain. The software documentation provided by the official website is GEN1, the previous generation product, I used GEN2, so there are some differences, if you need to download the software manual, you can download it from here: OS1 User Guide
Explained in the Networking Guide
section has the configuration of how to teach, write in great detail (in other words, very complicated ...) explains how to configure the connection to the radar and computers. I have also stepped on a lot of pits, and summarized a few simple steps to achieve rapid configuration:
You can connect the radar to your computer and ping
try it. It should be pingable:
ping -c1 os-992030000210.local
Note: This is where os is not os1 . It is a place that is easy to step on. It may be because I am a GEN 2 radar. Then don't forget to add .local
it. In the instructions for GEN 1 generation products, this command does not add the .local suffix... And remember to change the serial number of the radar to your own.
If you can ping through, you should also be able to see the radar information in the browser:
http://os-992030000210.local/
1. Modify the computer ip
sudo gedit /etc/network/interfaces
Change to static ip
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
# The primary network interface - use DHCP to find our address
# auto eth0
# iface eth0 inet dhcp
auto eth0
iface eth0 inet static
address 192.168.100.1
netmask 255.255.255.0
#gateway 192.168.190.2
Note: here eth0
to modify according to their own computer, using ifconfig
the view command
Then restart the network:
sudo /etc/init.d/networking restart
It is recommended that after inputting this command, restart the computer (xuan xue && normal operation)
Extra: How to modify the name of the network card:
sudo gedit /etc/default/grub
找到GRUB_CMDLINE_LINUX=""
改为GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"
然后sudo grub-mkconfig -o /boot/grub/grub.cfg
重启后,网卡名称果然变成了eth0和wlan0
2. Assign radar ip
At this time, you need to assign an ip to the radar. This ip and the ip you just set are under the same subnet. In the software manual, the setting is very complicated, but in fact it is ok with just one sentence:
sudo dnsmasq -C /dev/null -kd -F 192.168.100.50,192.168.100.200 -i eth0 --bind-dynamic
The etho here should be replaced by your own network card name!
This means that in the interval from 192.168.100.50 to 192.168.100.200, an address is randomly assigned. After inputting, it should look like this:
Then try to ping it, it can be pinged, ok, then you're half done.
3. Display point cloud under ROS
I want to complain again. I installed and configured according to the official Ouster-example GitHub instructions at first, and then I didn’t get it all out... Then I asked about it and told me that GitHub, the instructions above have not been updated for a long time... Okay, I successfully stepped on it. pit…
Still download the new firmware on the above website, and then:
1. Steps to install ROS driver
(1) Enter the ouster_example -> ouster_viz
folder, open it README.md
, and follow the Build Dependencies
steps inside to complete dependencies
the installation;
(2) into the ouster_example -> ouster_client
folder, opened README.md
, according to which the steps of build
the good client
;
(3) into the final ouster_example -> ouster_ros
folder, open inside opening README.md
, which is completed according to the steps build
to
You should be on it, and then ouster_ros
execute this folder:
roslaunch ouster.launch sensor_hostname:=os-992030000210.local udp_dest:=192.168.100.1 lidar_mode:=2048x10 viz:=true
The lidar_mode:=2048x10 here means that it should be 2048 points horizontally and the frequency is 10hz
note:
.local
Don't forget the suffix- The ip address entered here is the ip of the computer, not the ip of the radar
- Special reminder: When compiling in the workspace, you must follow the instructions in the readme , not just use'catkin_make', but also add the compilation option'Release' mode, so that the displayed results will be no problem.
2. Display effect
Looking at it this way, the point cloud is still very dense, worthy of 128 lines
The official data can also be downloaded here:
4. Use LeGO-LOAM to build maps
The source code is here: LeGO-LOAM
uses Ouster 128 radar, so some places need to be modified:
- Modify
utility.h
file
Modify the topic of the subscribed point cloud:
// extern const string pointCloudTopic = "/velodyne_points";
extern const string pointCloudTopic = "/os_cloud_node/points";
Modify useCloudRing
options: changefalse
extern const bool useCloudRing = false; // if true, ang_res_y and ang_bottom are not used
If you don’t change it, an error will be reported:
Failed to find match for field 'ring'
Modify the parameters of the radar
/*-------------------------------------------------
DJQ 2020-09-04
-------------------------------------------------*/
// Ouster OS1-128 (GEN 2)
extern const string LIDAR_TYPE = "Ouster OS1-128";
extern const int N_SCAN = 128;
extern const int Horizon_SCAN = 2048;
extern const float ang_res_x = 360.0/float(Horizon_SCAN);
extern const float ang_res_y = 45.0/float(N_SCAN-1);
extern const float ang_bottom = 22.5+0.1;
extern const int groundScanInd = 15;
- Modify
imageProjection.cpp
file
Line 166 needs to be commented out:
cloudHeader.stamp = ros::Time::now(); // Ouster lidar users may need to uncomment this line
Then compile and run normally, and you can run LeGO-LOAM.
5. TODO
-
Here is a discussion area for the use of Ouster radar, which is worth checking out:
-
See the open source LIO-SAM framework, which uses Ouster + IMU, the effect is very good, you can try it later:
The above are the steps used by Ouster radar. If you think it is useful, you can just like it~