Git Product home page Git Product logo

octupus-maze's Introduction

Octupus maze

Controller for a behavioral task dependent on video tracking. Track subject with a webcam, open/close gates and trigger rewards/tones to guide behavior while logging and syncing with an external data acquisition system (e.g. electrophysiology) in a choice task.

Maze diagram

Two-choice task

Refer to the maze diagram. Subject starts at the N or S arms of the maze and takes a reward. According to a contingency table, chooses to or is forced to take a left or a right turn, for a reward. Then either starts a new trial at the starting point or chooses to go to the opposite side of the maze.

Set-shift task

Refer to the maze diagram. Subject starts at the N or S arms of the maze and takes a reward. According to a contingency table, chooses to or is forced to take a left or a right turn, to then choose a feeder on the south or north halves of the maze. Then starts a new trial at the starting point or chooses to go to the opposite side of the maze.

Prerequisites

Installation

  • Install MATLAB
  • Download library from repository and place the MATLAB folder under Documents folder.
  • Create/modify Documents/MATLAB/startup.m and put addpath('Tools');

Getting Started

  • Plug in an Arduino Mega 2560 and identify the port id (e.g. 'COM4').
  • Install the firmware using Arduino/upload-firmware.vbs
  • Choose one of the available cameras listed with webcamlist by it's index (e.g. 1 for first camera, 2 for second, etc.)
  • Execute one of the examples:
obj = TwoChoice('COM4', 1);
obj = SetShift('COM4', 1);

set-shift

The control programs were written in MATLAB, using an object oriented approach to maintain behavioral states effectively. Timing of behavioral events is produced using timers or classes that run timers. Operations in actuators such as servomotors (doors) or pinch valves (feeders) are done using an Arduino micro-controller, which runs a firmata like firmware blind to the behavioral task. Behavioral states are created and updated in the main class of the task and some classes are used to aid code development:

  • Bridge - Interfaces with the Arduino to read/write hardware IO states.
  • Camera/Tracker/VirtualTracker - Interfaces with the Camera to read images or the position of the subject in the maze and trigger events associated to virtual zones.
  • UI/Image/Line - Display images and lines and reads mouse and keyboard states.
  • Delay - Handle timing in feeders.

As with every object oriented program, the starting point is the constructor of the class, which has the same name as the file. Most of the code is documented and you can read it by looking within the code or by typing help <class-name> or help <class-name>.<method-name> in the MATLAB prompt.

Version History

0.1.0

  • Initial Release: Library and example code

License

© 2018 Leonardo Molina

This project is licensed under the GNU GPLv3 License.

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.