How to install sdk on raspberry pi 3B+?

841 views
Skip to first unread message

gim...@gmail.com

unread,
May 3, 2019, 7:19:42 AM5/3/19
to Livox LiDARs
I follow the guide for installation on ubuntu on my raspberry pi, but running the make command gives med the following error about unknown type name 'off64_t'

pi@raspberrypi:~/livox/Livox-SDK/build $ make
[ 84%] Built target livox_sdk_static
[ 88%] Building C object sample/hub/CMakeFiles/hub_sample.dir/main.c.o
In file included from /usr/include/apr-1.0/apr_general.h:28,
                 from /home/pi/livox/Livox-SDK/sample/hub/main.c:33:
/usr/include/apr-1.0/apr.h:358:10: error: unknown type name ‘off64_t’
 typedef  off64_t           apr_off_t;
          ^~~~~~~
sample/hub/CMakeFiles/hub_sample.dir/build.make:62: recipe for target 'sample/hub/CMakeFiles/hub_sample.dir/main.c.o' failed
make[2]: *** [sample/hub/CMakeFiles/hub_sample.dir/main.c.o] Error 1
CMakeFiles/Makefile2:140: recipe for target 'sample/hub/CMakeFiles/hub_sample.dir/all' failed
make[1]: *** [sample/hub/CMakeFiles/hub_sample.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Is there a specific way for installation on a raspberry pi or what to do?

darrel...@ncl.ac.uk

unread,
May 3, 2019, 10:56:19 AM5/3/19
to Livox LiDARs
Look on the thread "Livox-SDK updated(Version 1.1.0)" and you will see what I had to do.

Jon H

unread,
May 3, 2019, 2:03:37 PM5/3/19
to Livox LiDARs
Thanks, I was having the same issues, and I'm curious you meant in your post in that thread where you mention using "a 64 bit kernel in a container. You need to download all the the gcc components." 

I'm not an Ubuntu user, so could you explain that? Is that done through the command line? 

darrel...@ncl.ac.uk

unread,
May 3, 2019, 2:17:57 PM5/3/19
to Livox LiDARs
When you install that image there are menu options to start a container. The container has the 64 bit kernel (as opposed to the host operating system which is using the 32 bit kernel) but nothing else is installed so in order to compile the SDK you will need to install the compiler. I cant remember exactly what I did in the 64 bit terminal windows, but I think I just did  $ sudo apt install build-essential  - this should install the compilers. Then just follow the instructions for linux install (i.e for apr etc) on the SDK github page.  I don't remember whether I had to do anything else (sorry I tend to do these things on autopilot). The code compiled and when executing the sample application it started looking for the LiDAR. Because my Mid-40 now has a static IP I have yet to setup the Pi to find it but I do not imagine it will be an issue.
Hope that helps.

darrel...@ncl.ac.uk

unread,
May 3, 2019, 2:20:51 PM5/3/19
to Livox LiDARs
Just realised you also need to install cmake.  There are many guides to this on the web - but you will need the compilers for this also.

Jon H

unread,
May 4, 2019, 4:17:33 PM5/4/19
to Livox LiDARs
Hmmm... Now it's producing a different error on make. 

pi@raspberrypi:~/Livox-SDK/build $ make
[ 84%] Built target livox_sdk_static
sample/hub/CMakeFiles/hub_sample.dir/build.make:94: *** target pattern contains no '%'.  Stop.

gim...@gmail.com

unread,
May 5, 2019, 9:56:54 AM5/5/19
to Livox LiDARs
I got this to work too using the image in the "Livox-SDK updated(Version 1.1.0)" thread, thanks darre...@ncl.ac.uk
I am running RPi headless and you enter the container with the command ds64-shell
Then
- update and upgrade
- Install the packages build-essentiels libboost-dev pkg-config and maybe more I do not remember
- Install apr from the webpage, edit the configure file line 30145 (or close to) replace $RM "$cfgfile" to $RM -f "$cfgfile"
- Follow Livox manual and look for errors

darrel...@ncl.ac.uk

unread,
May 5, 2019, 10:15:27 AM5/5/19
to Livox LiDARs
Great! Sorry Jon I did not get that error and without seeing specifically where it fails I do not know what to suggest (I tend to experiment until things work - more by magic than design).

gim - have you looked at the resource usage when using the Livox?  I guess that is not possible until they give us the code to log !! (hint to Livox Dev - please help us!).

I have actually switched to something a little more capable. I have just received a jetson nano. When streaming from my ardusimple f9p GNSS and a InertialSense IMU the jetson is using ~40-50%. The data rates from the Livox I suspect are higher but I think I have enough headroom. I just wonder how the Pi will cope.  I am also concerned about writing to the SD card. I am using U3 cards but whether it will need to buffer I do not yet know. With the Jetson I have 4GB but the 1GB RAM on the Pi may also prove insufficient. Hopefully we will soon know. I would like the Pi to work as they are cheaper and my multirotor history is littered with malfunctions (mainly the operator :) ).

gim...@gmail.com

unread,
May 5, 2019, 10:32:04 AM5/5/19
to Livox LiDARs
-> Jon, I did not get that error either

-> darre, I have not looked at the resource usage yet, I will let you know

-> Livox dev, I also need the log functionality


gim...@gmail.com

unread,
May 6, 2019, 4:24:46 PM5/6/19
to Livox LiDARs
Logging timestamp,x,y,z,reflectivity data pr line only on the RPi uses app 35-40% CPU
I have no problem writing to disc

ediso...@gmail.com

unread,
May 7, 2019, 12:25:35 AM5/7/19
to Livox LiDARs
working as you stated (much appreciated sir ) using the link you've posted to 64bit raspbian image. however if mid-40 is not connected to router the pi3 running lidar_sample does not detect device. Is it possible to connect mid-40 to pi3 without router? is dhcp needed?

darrel...@ncl.ac.uk

unread,
May 7, 2019, 8:45:59 AM5/7/19
to Livox LiDARs
That looks promising. How are you logging on on the pi?

darrel...@ncl.ac.uk

unread,
May 7, 2019, 8:49:13 AM5/7/19
to Livox LiDARs
ediso... ,

You need to setup the Livox and the Pi with a fixed IP address and on the same network e.g. 192.168.1.5 and 192.168.1.50 . You set the IP for the livox in the viewer so initially you need to connect the Livox to a local network as it is set to dynamic IP by default. You then need to set the IP n the Pi - just google that. This is all explained in the manual. Only after this will they communicate without the aid off a router and its dhcp allocation.

gim...@gmail.com

unread,
May 7, 2019, 10:00:23 AM5/7/19
to Livox LiDARs
In the sample lidar application in the SDK (the function GetLidarData) you have all the info you need for writing to a file. The (LivoxEthPacket *data) holds 1 timestamp and 100 points. Loop through the hundred points and calculate your own timestamp for each point based on the sample rate.

If you compare the current timestamp with the previous you can detect whether the LiDAR received a PPS. In that case you just wait until the next GPRMC (or in my case GPGGA) sentence to come from the GNSS unit, and then you have the GPS time for synchronisation. (have not implemented that yet, but it works in other applications I have done)

We are starting to get a bit off topic, maybe we should find another forum to discuss?

darrel...@ncl.ac.uk

unread,
May 7, 2019, 10:45:48 AM5/7/19
to Livox LiDARs
Thanks. It looks like the new SDK has the file write capability so my immediate problem is solved.  I will worry about synchronization once I have everything working on my multi-rotor.
One problem at a time :) Looks like you have far more experience than me at doing this so you may see a new thread asking for help later :)

gim...@gmail.com

unread,
May 7, 2019, 11:20:29 AM5/7/19
to Livox LiDARs
Yes, just saw it. But it does not work for me unless I have an open source lvx-reader, where I can export on my own. The convert to las just mix the whole time issue up and consider the entire point cloud to the same time -> no go for kinematic applications.
I go for a postprocessed IMU+GNSS solution, because I find RTK data link unreliable in general. Furthermore you can do a tightly coupled solution (superior to normal loosely coupled), where you proces forward and backward in time. The realtime solution only supports forward in time.
I also need to write an external app for combining the position and heading solution with the LiDAR data (rotate and translate the Livox coordinate system) and then I can convert to a standard format.
Just start a new thread when you feel the need :)

darrel...@ncl.ac.uk

unread,
May 7, 2019, 11:43:53 AM5/7/19
to Livox LiDARs
OK you are way ahead of me (I am doing this for the first time).

I will collect data from an f9p (dual frequency) for ppk and data from the InertialSense IMU (which also has a gps timestamp). If you say the lvx conversion omits the time signature then that is also useless for me and my kinematic solution.  I need to delve more deeply into the data format and see what I can do. It does not look difficult it is just finding time to do it. All part of the fun.

I will start the new thread when I hit a wall. Many thanks for your help.

ediso...@gmail.com

unread,
May 10, 2019, 12:46:32 AM5/10/19
to Livox LiDARs
Compiling when outside the 64bit shell yields errors relating to apr1.h and off_64_t mentioned in the first post


Is it possible to compile 32bit version of the livox-sdk? Reason being that Pi3 camera is inaccessible in the ds64 shell

Reply all
Reply to author
Forward
0 new messages