[SOLVED] Randomly moving objects and collision detection and LIDAR sensors


#21

Hey again,

I actually managed it by myself. I just needed to add an ‘if’-clause, checking whether the sensor data is None or not:

@nrp.MapRobotSubscriber("lidar", Topic('/husky/laser/scan', sensor_msgs.msg.LaserScan))
@nrp.Robot2Neuron()
def read_lidar_sensor (t, lidar):
    laser_msg = lidar.value
    if laser_msg is not None:
        sensor_values = laser_msg.ranges
        clientLogger.info(sensor_values)

Again, thanks for your support.
Best,
Michael