Sensor Debugging

Tools and techniques for debugging sensor issues.

GPS/IMU Debugging

Check Connection

# List serial devices
ls /dev/ttyUSB*

# Check device permissions
ls -la /dev/ttyUSB0

View Raw Data

from xsens_class import XsensReceiver
gps = XsensReceiver()

while True:
    print(f"Pos: {gps.get_position()}")
    print(f"RTK: {gps.get_rtk_status()}")
    time.sleep(1)

LIDAR Debugging

Network Check

# Check connectivity
ping 192.168.1.201

# Check UDP traffic
sudo tcpdump -i eth0 port 2368

View Point Cloud

from sensors.lidar_interface import VelodyneLIDAR
import open3d as o3d

lidar = VelodyneLIDAR()
points = lidar.get_scan()

pcd = o3d.geometry.PointCloud()
pcd.points = o3d.utility.Vector3dVector(points)
o3d.visualization.draw_geometries([pcd])

Camera Debugging

List Cameras

v4l2-ctl --list-devices

Test Capture

import cv2

cap = cv2.VideoCapture(0)
ret, frame = cap.read()
cv2.imwrite('test_capture.jpg', frame)
cap.release()