Getting Started with the LiDAR Camera L515 - Carleton-SRL/SPOT GitHub Wiki
The RED platform has onboard an Intel RealSense LiDAR Camera L515 that provides depth information from the camera at 30 fps. Its field of view is 70° x 55° (+/- 3°), ideal operating range is 0.25 m to 9 m, and output resolution is up to 1024 x 768 pixels. The manufacturer provides the following specs (at 95% reflectivity):
| Distance | Average Depth Error | Std Dev Depth Error |
|---|---|---|
| 1 m | < 5mm | 2.5 mm |
| 9 m | < 14 mm | 15.5 mm |
The LiDAR also has a RGB camera (field of view is 70° x 45°, +/- 3°) that operates at 30 fps, outputting 1920 x 1080 pixel images.
The sensor also has an IMU -- see sample code below.
So far, the LiDAR has only been tested using a simple plug-and-play application (see the Intel Getting Started page for details).
- Connect the LiDAR to your computer using its USB‑C 3.1 Gen 1 cable.
- For Windows users, go to the Intel RealSense v2.50.0 GitHub page. and download the Intel.RealSense.Viewer.exe.
- Run the executable file.
- Add the L515 camera as the source and you may toggle various capabilities of the camera using this menu.
Future students will complete software development using the LiDAR, and this page will be updated accordingly.
Sample code, wrappers, and SDK resources can be found here and here.
The L515 lidar also includes an IMU accessible through standard API methods. Currently, the lidar reference frame maps onto the servicer reference frame as:
| lidar | servicer |
|---|---|
|
|
negative |
|
|
negative |
|
|
positive |
A code snippet for streaming IMU values by UDP can be found below.
Click to view the code block
import pyrealsense2 as rs
import socket
import struct
sock_send = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
imu_server_address = ('192.168.1.110',10097)
pipeline = rs.pipeline()
config = rs.config()
config.enable_stream(rs.stream.accel)
config.enable_stream(rs.stream.gyro)
pipeline.start(config)
loopCount = 0
while True:
frames = pipeline.wait_for_frames()
accel_frame = frames.first_or_default(rs.stream.accel)
if accel_frame:
accel_data = accel_frame.as_motion_frame().get_motion_data()
xAccel = accel_data.x
yAccel = accel_data.y
zAccel = accel_data.z
else:
xAccel = 0
yAccel = 0
zAccel = 0
gyro_frame= frames.first_or_default(rs.stream.gyro)
if gyro_frame:
gyro_data = gyro_frame.as_motion_frame().get_motion_data()
xGyro = gyro_data.x
yGyro = gyro_data.y
zGyro = gyro_data.z
else:
xGyro = 0
yGyro = 0
zGyro = 0
imu_udp = bytearray(struct.pack("ffffff", xAccel, yAccel, zAccel, xGyro, yGyro, zGyro))
sock_send.sendto(imu_udp, imu_server_address)
if loopCount < 100:
loopCount += 1
else:
loopCount = 0
print(f"xAccel={xAccel}, zAccel={zAccel}, yGyro={yGyro}.")