sora_maker
I’ve got an EZ-B IoTiny on a small 2WD rover (two CR servos on D0/D1, powered by a 2S LiPo with a 5V BEC to the IoTiny). The IoTiny connects over WiFi to ARC on my Windows laptop. I’m using a Slamtec RPLidar A1 connected via USB to the laptop with the RPLidar robot skill, and I can see a solid 360 scan and obstacle arcs in the RPLidar UI. I set the lidar placement in the skill to 90 mm forward of the robot center and rotation 0, which lines up with my chassis.
I want to drive an EZ Gauge Chart to show the nearest obstacle directly in front of the robot (say, 20) in centimeters. I can configure and update the gauge fine with ControlCommand if I hardcode a value:
ControlCommand("EZ Gauge Chart", "SetRangeMinimum", 0)
ControlCommand("EZ Gauge Chart", "SetRangeMaximum", 200)
ControlCommand("EZ Gauge Chart", "SetTitle", "Front Obstacle (cm)")
# later in a loop
ControlCommand("EZ Gauge Chart", "SetValue", $front_cm)
What I can’t figure out is how to read the lidar’s NMS data from a script to compute $front_cm. I skimmed the NMS manual but didn’t find a concrete example of accessing Group #1 lidar samples in EZ-Script or JavaScript. I tried guessing variables like $RPLidar_* and also looked for a ControlCommand on the RPLidar skill that returns a nearest-distance, but no luck. Is there a recommended way (sample script or function) to subscribe to NMS and extract the minimum range within a heading window (e.g., -20 to +20) so I can feed that number into the EZ Gauge Chart?
Related Hardware (view all EZB hardware)
