Skip to content
GarethG edited this page Mar 23, 2012 · 4 revisions

SLAM

Possibilities:

  • Write our own SLAM algorithms.

  • gmapping with the sonar outputting fake LaserScan msgs. In order for gmapping to work, the sonar scans need to be tagged with a transformation from tf. We also need this for the navigation stack and its a useful tool for logging our position.

With a little reading it looks like gmapping uses those LaserScan msgs which are as followed:

Header header            # timestamp in the header is the acquisition time of 
                         # the first ray in the scan.
                         #
                         # in frame frame_id, angles are measured around 
                         # the positive Z axis (counterclockwise, if Z is up)
                         # with zero angle being forward along the x axis
                         
float32 angle_min        # start angle of the scan [rad]
float32 angle_max        # end angle of the scan [rad]
float32 angle_increment  # angular distance between measurements [rad]

float32 time_increment   # time between measurements [seconds] - if your scanner
                         # is moving, this will be used in interpolating position
                         # of 3d points
float32 scan_time        # time between scans [seconds]

float32 range_min        # minimum range value [m]
float32 range_max        # maximum range value [m]

float32[] ranges         # range data [m] (Note: values < range_min or > range_max should be discarded)
float32[] intensities    # intensity data [device-specific units].  If your
                         # device does not provide intensities, please leave
                         # the array empty.

With the exception of "header" and "scan_time" all of this data is written in to the code and thus will only require some simple conversion to the required types.

angle_min, angle_max and angle_increment are currently in the sonars stepper motor steps rather than radians, easily convertible.

It's 6400 steps per full rotation, so: 360 / 6399 = 0.05625 degrees, therefore: radians = degrees * (pi/180), 0.05625 * (3.14/180) 0.00098125 radians

bish, bash, bosh.

range_min, range_max require meters and the sonar is set in meters. The full range is currently set at 75 which is divided into 90 (so: 75/90 = 0.833333333 per binary).

ranges[] and intensities[] will need some investigation in to what they actually require, hopefully it is just the array of binaries that the sonar dumps out and we can just blast them in.

scan_time and time_increment should be easy enough to work out.

Once we gmapping is up and running we need to do something intelligent with it the navigation stack seems most likely to provide this

Clone this wiki locally