Closed jabrena closed 7 years ago
Implemented both sensors. Pending tests.
Related issue: https://github.com/rctoris/jrosbridge/issues/24
Initial tests with a IR Sensor:
header:
seq: 428
stamp:
secs: 1505425774
nsecs: 51000064
frame_id: base_link
radiation_type: 1
field_of_view: 0.0500000007451
min_range: 0.0500000007451
max_range: 0.800000011921
range: 43.0
Initial tests with a US Sensor:
header:
seq: 264
stamp:
secs: 1505426295
nsecs: 107000064
frame_id: base_link
radiation_type: 0
field_of_view: 0.0500000007451
min_range: 0.0500000007451
max_range: 2.5
range: 73.5
vagrant@vagrant:~$ rostopic hz /range
subscribed to [/range]
average rate: 30.048
min: 0.007s max: 0.076s std dev: 0.01353s window: 29
average rate: 30.519
min: 0.001s max: 0.076s std dev: 0.01385s window: 60
average rate: 30.362
min: 0.001s max: 0.080s std dev: 0.01423s window: 89
average rate: 30.326
min: 0.001s max: 0.080s std dev: 0.01389s window: 120
average rate: 29.754
min: 0.001s max: 0.173s std dev: 0.01793s window: 148
average rate: 29.825
min: 0.001s max: 0.173s std dev: 0.01778s window: 160
It is necessary to review the min_range
& max_range
of both EV3 Sensors.
IR Sensor:
https://shop.lego.com/en-US/EV3-Infrared-Sensor-45509 Proximity measurement of approximately 50-70 cm
Ultrasonic Sensor:
https://shop.lego.com/es-ES/EV3-Ultrasonic-Sensor-45504 Measures distances between one and 250 cm
ROS Range Definition:
public static final String DEFINITION =
"# Single range reading from an active ranger that emits energy and reports\n" +
"# one range reading that is valid along an arc at the distance measured. \n" +
"# This message is not appropriate for laser scanners. See the LaserScan\n" +
"# message if you are working with a laser scanner.\n\n" +
"# This message also can represent a fixed-distance (binary) ranger. This\n" +
"# sensor will have min_range===max_range===distance of detection.\n" +
"# These sensors follow REP 117 and will output -Inf if the object is detected\n" +
"# and +Inf if the object is outside of the detection range.\n\n" +
"Header header " +
"# timestamp in the header is the time the ranger\n " +
"# returned the distance reading\n\n" +
"# Radiation type enums\n" +
"# If you want a value added to this list, send an email to the ros-users list\n" +
"uint8 ULTRASOUND=0\n" +
"uint8 INFRARED=1\n\n" +
"uint8 radiation_type " +
"# the type of radiation used by the sensor\n " +
"# (sound, IR, etc) [enum]\n\n" +
"float32 field_of_view " +
"# the size of the arc that the distance reading is\n " +
"# valid for [rad]\n " +
"# the object causing the range reading may have\n " +
"# been anywhere within -field_of_view/2 and\n " +
"# field_of_view/2 at the measured range. \n " +
"# 0 angle corresponds to the x-axis of the sensor.\n\nfloat32 min_range " +
"# minimum range value [m]\n" +
"float32 max_range " +
"# maximum range value [m]\n " +
"# Fixed distance rangers require min_range==max_range\n\n" +
"float32 range " +
"# range data [m]\n " +
"# (Note: values < range_min or > range_max\n " +
"# should be discarded)\n " +
"# Fixed distance rangers only output -Inf or +Inf.\n " +
"# -Inf represents a detection within fixed distance.\n " +
"# (Detection too close to the sensor to quantify)\n " +
"# +Inf represents no detection within the fixed distance.\n " +
"# (Object out of range)";
ROS Units:
float32 field_of_view valid for [rad] float32 min_range minimum range value [m] float32 max_range maximum range value [m] float32 range range data [m]
EV3 Units:
range: cm
It is necessary to add support for a RangeFinder on EV3.
Currently, exist 2 alternatives on EV3 to use a RangeFinder:
Tasks:
Examples: The following examples could be useful to publish a Range message on ROS using both sensors. https://sourceforge.net/p/lejos/nxt/code/HEAD/tree/trunk/ros/nxt_lejos/nxt_lejos_proxy/src/org/lejos/ros/sensors/ https://sourceforge.net/p/lejos/nxt/code/HEAD/tree/trunk/ros/nxt_lejos/nxt_lejos_proxy/src/org/lejos/ros/sensors/UltrasonicSensor.java https://github.com/Hacks4ROS/h4r_ev3_ctrl/blob/develop/h4r_ev3_control/src/h4r_ev3_control/ev3_ultrasonic_controller.cpp https://github.com/Hacks4ROS/h4r_ev3_ctrl/blob/develop/h4r_ev3_control/src/h4r_ev3_control/ev3_infrared_controller.cpp https://github.com/srmanikandasriram/ev3-ros/blob/master/src/ultrasonic_sensor.cpp https://github.com/NCharabaruk/maxsonar_arduino_ros/blob/master/maxsonar_arduino_ros.ino