GithubHelp home page GithubHelp logo

hrishi16 / mousebehaviour Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bhallalab/mousebehaviour

0.0 0.0 0.0 18.07 MB

Arduino and PointGrey camera based behaviour setup.

License: GNU General Public License v3.0

OpenSCAD 1.80% Makefile 15.14% Python 31.51% CMake 2.01% C 1.30% C++ 30.81% Shell 2.32% Roff 0.29% MATLAB 14.81%

mousebehaviour's Introduction

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.

mousebehaviour's People

Contributors

ananthamurthy avatar dilawar avatar soumyadead avatar bhumikasingh0110 avatar anzalks avatar shriya9 avatar hrishi16 avatar soumyaaymous 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.