A cmake
based C++/Python pipeline to run behavioural experiment.
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.
Both arduino and camera must be connected to computer before doing the following.
This code will only work on Ubuntu-16.04. Install arduino, c++ compiler (gcc), cmake, and boost libraries. More details below.
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).
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 scripts are written in python and requires common numerical computational
framework e.g., numpy
, scipy
, pandas
and additionally tifflib
.
- sudo apt install python-tifflib
- Puff : p
- Tone : t
- Led : l
- Start : s
- Stop : ctrl+c
See function write_data_line
in file src/main.ino
for updated values.
Go to directory ./analysis
and read the README.md
file there.