Interfacing ultrasonic sensor HC-SR04

asked 2017-05-23 02:28:40 -0600

Veera Ragav gravatar image

I'm doing it with raspberry pi2 with ros indigo. I referred link text this one for the message type. My sensor measures upto 3metre. I would like to restrict its range to 1metre. I decided to assign 0.03metre to min range and 1metre to max range. I don't know how to assign the field of view. For range it is mentioned that the values outside the min and max range should be discarded. Does it mean if the value doesn't fit into the min and max range, i should not publish that range value? If i didn't publish the range, it assumes that the obstacle is out of range?

edit retag flag offensive close merge delete

Comments

1

Just clip the range value, e.g. if range > max_range: range=max_range The field of view is a problem, see question #219218

Humpelstilzchen gravatar imageHumpelstilzchen ( 2017-05-24 03:38:45 -0600 )edit