Code Monkey home page Code Monkey logo

experimentplatform's Introduction

ExperimentPlatform

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.

Remote Control and Connectivity

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 [email protected] from a lab workstation.

Re-mapping an environment

  1. In a terminal window, navigate to ExperimentPlatform and run mapping_launch.sh
cd ~/ExperimentPlatform
bash mapping_launch.sh
  1. Navigate the environment slowly with the main joystick, monitoring the mapping on Rviz
  2. 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
  1. A .pgm and .yaml file will be generated, transfer them to the ExperimentPlatform folder if not already done so
  2. Edit line 8 in ros_launch.sh to point to the new map OR rename new map to match the script

Running the experiment

  1. In a terminal window, navigate to ExperimentPlatform and run 'ros_launch.sh`, which sets up the required ROS services.
cd ~/ExperimentPlatform
bash ros_launch.sh
  1. Start up the iOS app Runner on the iPhone.
  2. In another terminal window, navigate to ExperimentPlatform and run exp_launch.sh to run required python scripts that control experiment behavior.
cd ~/ExperimentPlatform
bash exp_launch.sh
  1. In Rviz, get a good localization of the platform by using P to make a initial guess on position, and driving it around slightly
  2. In the GUI window that pops up, Select the reward map under the Reward Locations drop-down list
  3. To modify the reward map, use the G key in Rviz to redefine the 6 poster locations/directions (click and drag), with FIFO overriding
    1. 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.
  4. Load or modify other experiment settings, and save the settings if you wish
  5. 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. 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. 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

End of Experiment

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

Recording of full experiments

  1. save bag file with
rosbag record -a -o data.bag -x “/RosAria/*”
  1. 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
  1. convert to csv file
rostopic echo <topic_name> -b <bag_file>.bag > <csv_file>.csv

Eyelink

  1. Eyelink Calibration is done via this
# in `powerbot` terminal
cd ~/EyelinkCalibration/EyelinkCalibration && python main_gui.py
  1. run calibrate_video.py after successful calibration for set 1 experiment
  2. 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)

For Developers

Please refer to Developer's Guide for breakdown of how the python scripts interact. Possible features and suggestions will also be listed there.

experimentplatform's People

Contributors

kianwei96 avatar ndhuu avatar samaritan-lol avatar shihchengyen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.