Skip to content

Arduino and PointGrey camera based behaviour setup.

License

Notifications You must be signed in to change notification settings

hrishi16/MouseBehaviour

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

A cmake based C++/Python pipeline to run behavioural experiment.

Protocols

Various protocols are supported. They are listed in ./Protocols/BehaviourProtocols.xlsx and (csv copy ./Protocols/BehaviourProtocols.xlsx). Make sure that you use the right protocol. See section How to run the pipeline below.

How to run the pipeline

Both arduino and camera must be connected to computer before doing the following.

Download and setup

This code will only work on Ubuntu-16.04. Install arduino, c++ compiler (gcc), cmake, and boost libraries. More details below.

Dependencies

Script bootstrap.sh will install all of the dependencies. Required libraries for PointGrey camera is in the source.

Download the code:

$ git clone  https://github.com/BhallaLab/MouseBehaviour.git
$ cd MouseBehaviour 

The script bootstap.sh will try to configure your system. You must have sudo permissions because we need to add to various groups (pgrimaging and dialout) before you can access camera and serial port. In case, something odd happens, raise an issue on github.

Once bootstrap is successful, logout and login. Changed group takes effect only after fresh login. To verify that you are in appropriate groups, type groups command in terminal. Make sure that pgrimaging and dialout appears in the group list. If not, things have not gone properly.

To build and upload to arduino:

$ mkdir _build 
$ cd _build
$ cmake -DANIMAL_NAME=k2 -DSESSION_NUM=1 -DSESSION_TYPE=S -DPROTO_CODE=All1 ..
$ make run              # to run the whole setup, (arduino and camera both must be connected)or
$ make miniterm         # Just to test arduino board. (camera need to be connected)

On make run, a windows will appear which shows the running plots. While sending commands to arduino, make sure that you focus on the window (click on it).

Press CTRL+C in terminal to close the session. If just running make miniterm, press CTRL+] to come out of miniterm (scrolling text).

CMake options

Port

If you need to change the arduino port, pass -DPORT=/path/to/port option to cmake. On a linux system, e.g.

 $ cmake -DPORT=/dev/ttyACM1 -DANIMAL_NAME=k2 -DSESSION_NUM=1 -DSESSION_TYPE=2 ..

Analysis

Analysis scripts are written in python and requires common numerical computational framework e.g., numpy, scipy, pandas and additionally tifflib.

  • sudo apt install python-tifflib

Commands

  • Puff : p
  • Tone : t
  • Led : l
  • Start : s
  • Stop : ctrl+c

What is being printed.

See function write_data_line in file src/main.ino for updated values.

How to analyze data

Go to directory ./analysis and read the README.md file there.

About

Arduino and PointGrey camera based behaviour setup.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 31.6%
  • C++ 30.8%
  • Makefile 15.1%
  • MATLAB 14.8%
  • Shell 2.3%
  • CMake 2.0%
  • Other 3.4%