Skip to content
heuristicus edited this page Aug 31, 2011 · 1 revision

Summmary

This node is used to publish data from the files which contain data from experiments to ROS. It requires a parameter to be set in the launch file so that it can get the directory containing the files. The filename must also be in a specific format in order to be used. This file is also used to select the movement path for the sonar through the data in order to simulate actual movement. It contains a GUI for this purpose.

Information

Publishes to:

  • sonar_sim_readable (type proc_sonar)

Subscribes to:

  • none

The initialisation requires the directory location, and two optional parameters, the range and sleep time.

range parameter

Since there are 4 ranges which the sonar was set to for the experiments, there are sets of files for the same ranges at different locations. The ranges used were 5, 10, 20 and 50 metres, and so this optional parameter should be changed to the range that you want to use. There is also a parameter in the launch file for this which is read by many other files, so this should probably be used instead of the optional parameter.

sleep time parameter

The sleep time is used to generate an artificial action time between publishing the data.

Initialisation method

pt_list is a dictionary containing the locations of all the points at which data readings were taken at. These points are used to draw the locations of the points on the GUI so that a path through the points can be selected.

This method also creates the GUI to be used for path selection, and binds the left mouse button to the path method.

path method

This is called when the mouse button is clicked on the GUI, and adds points to the move list used to determine the path of the sonar through the points. Clicking within 10 pixels of a point means that that point is added to the list. This method also creates lines between points to give a visual representation of the path that will be taken.

run method

Runs through all the files with the same range as the initialisation parameter. Requires files to be in the form prc_x_y_range.txt. It will read all data in the file and then add the location and range data for that particular point to the message, and then publish it.

Improvements

There is currently an error which means that although the move list can be reset, after running through the path once it is not possible to reset the path and do another set of movements. This is because the underlying localisation mechanism does not reset when the path is reset, and so assumes that movement is from continuing from the last position of the particles. Basically, there is no support for moving particles to a specific point, so the whole system has to be restarted.