Real-world maze navigation with tracking and experimental data collection.
Required scripts and files are mostly contained within this directory, which is to be located at ~/ExperimentPlatform. Program expects ROS environment to be already set up at ~/catkin_ws.
Both platforms have been set up to automatically log in and connect to the Belkin router on startup, with the network name powerbot. The router reserves 192.168.0.2 for the older platform, and 192.168.0.3 for the newer platform. To control through VNC, use vnc://192.168.0.3::5900 in TightVNC Viewer on Windows. Headless access can be made through ssh sinapse@192.168.0.X from a lab workstation.
- In a terminal window, navigate to
ExperimentPlatformand runmapping_launch.sh
cd ~/ExperimentPlatform
bash mapping_launch.sh
- Navigate the environment slowly with the main joystick, monitoring the mapping on Rviz
- Once done, run the following in a new terminal, replacing <map_name> with a file name of your choice
rosrun map_server map_saver -f <map_name>
For example, to save in the ExperimentPlatform folder:
E.g. rosrun map_server map_saver -f /home/sinapse/ExperimentPlatform/new_map
- A .pgm and .yaml file will be generated, transfer them to the
ExperimentPlatformfolder if not already done so - Edit line 8 in
ros_launch.shto point to the new map OR rename new map to match the script
- In a terminal window, navigate to
ExperimentPlatformand run 'ros_launch.sh`, which sets up the required ROS services.
cd ~/ExperimentPlatform
bash ros_launch.sh
- Start up the iOS app Runner on the iPhone.
- In another terminal window, navigate to
ExperimentPlatformand runexp_launch.shto run required python scripts that control experiment behavior.
cd ~/ExperimentPlatform
bash exp_launch.sh
- In Rviz, get a good localization of the platform by using
Pto make a initial guess on position, and driving it around slightly - In the GUI window that pops up, Select the reward map under the
Reward Locationsdrop-down list - To modify the reward map, use the
Gkey in Rviz to redefine the 6 poster locations/directions (click and drag), with FIFO overriding -
- To create a new reward map, create a new csv file in the RewardData folder. In the GUI window, choose the new csv file from the drop-down list. Use the G key in Rviz to define the poster locations/direction (click and drag). The csv file will update the data accordingly.
- Load or modify other experiment settings, and save the settings if you wish
- Press
Start
Rviz will now display current goal. In the new window that pops up, you can monitor the experiment progress and intervene as required.
There are mainly 4 phases (Pre Trial Interval, Start Trial, Cue Offset, Reward/Timeout) that you will encounter during each trial. Only at Cue Offset the robot will not be programmically unclamped and it is a cue for you to move the robot.
To intervene, press P to toggle Pause behavior. Note that the experiment will only pause at the end of the current trial. Once end of trial is reached with the Pause option, use R to resume the experiment, or T followed by Y to terminate the entire experiment. At Paused and the first phase of Terminate (when T is first pressed), the robot will go into clamp mode if it was in a moving mode previously. This is to prevent any unwanted movement and can be used in emergency cases. Do NOT quit the experiment by any other method (eg. closing the window) as that will cause some ROS data to be recorded continuously. See below for remedy.
If the program exits ungracefully, open a new window and run
rosnode kill my_bag
rosnode kill my_bag2
At the end of all the trials, terminate the experiment with T Y. You can press Start again in the GUI to re-run the whole experiment from Trial 1.
Experimental data will be stored in a folder named as the current date. A brief explanation of what each file contains:
- eparams.pkl - pickled python dictionary that stores parameters defined in the GUI
- platformPositions.csv - pose data timestamped with psychopy clock [time, dim1, dim2, sum(covariance)]
- sessionTriggers.csv - trigger values, timestamped with psychopy clock
- rospose.csv - raw pose data from ROS with ROS timing
- posebag_???-??-??-??-??-??.bag - rosbag data file, parent of rospose.csv
- rostrig.csv - trigger values, with ROS timings
- pose_bag???-??-??-??-??-??.bag - rosbag data file, parent of rostrig.csv
- save bag file with
rosbag record -a -o data.bag -x “/RosAria/*”
- playback the rosbag file
ros set use_sim_time true && rosrun rviz rviz -d rviz_config/default.rviz
# in another terminal
rosbag play <bag_file>.bag
- convert to csv file
rostopic echo <topic_name> -b <bag_file>.bag > <csv_file>.csv
- Eyelink Calibration is done via this
# in `powerbot` terminal
cd ~/EyelinkCalibration/EyelinkCalibration && python main_gui.py
- run calibrate_video.py after successful calibration for set 1 experiment
- super-position results can be found here. This is slightly different from Matlab version (using 'v4' griddata, wherease python's griddata does not have 'v4', hence failed for extrapolation)
- After calibration is done, you can physically place markers in md2 maze room to denote as the reward locations. You will then need to modify the reward locations in rviz to match the ones you placed. You can check with the researchers in md2 as to where the fixed reward locations will be at.
- Ensure the eyelink checkbox is marked in the GUI to enable eyelink for the experiment
- Follow the trial phases and rewards and look at the markers at each reward locations. Make sure your eye is being detected properly by the eyelink computer. It should be marked as green in the eyelink computer if it is detected correctly.
- After the whole experiment is done, the robot will save the eyelink data file (.edf) in /data folder
Please refer to Developer's Guide for breakdown of how the python scripts interact. Possible features and suggestions will also be listed there.
Please refer to Localisation_README.md for more information and guide