This repository contains the software control code and documentation for the Rollercoaster V2 setup.
The software was written to control the following hardware:
- An NI USB-6229 DAQ
- A Teensy 3.2
- An Aerotech linear stage (ACT115) with Soloist HLe controller
- A multiplexer
- A pump for reward
- A solenoid for blocking the treadmill
This code has been developed on Windows 7 with MATLAB 2018b.
In order to use all hardware the following should be installed on the system:
- Aerotech drivers for controlling the linear stage (software comes with stage)
- Arduino software for controlling the Teensy's (https://www.pjrc.com/teensy/td_download.html)
- NI-DAQmx drivers
Different physical RC2 rigs will implement different hardware interactions and configurations. Therefore, some parts of the code base will not be transferable across rigs and should be configured locally for a particular setup. In particular, configuration descriptions and Soloist communication executables will vary between rigs, and should therefore be tailored for each rig.
Individual users of RC2 should create their own branch or fork of the repo (rig-user) and implement any rig specific changes there.
For example, to install RC2 on a new rig for a new user:
- Clone the main repo.
- Create a new branch named (e.g. 3p-aerskine).
- This branch should be used only for adding user and rig specific configs, protocols, calibrations in the rc/user folder.
- Use the configs in the rc\user\template folder as a guide as these include relative pathing.
- Configs can also be copied from other users (although ensure that they use relative paths as well). Make sure that copied configs are renamed to reflect the new user / rig.
- If any changes to the main RC2 codebase are required (e.g. new Sensor module, GUI changes) they should be made in the main branch (or a development branch of the main branch that is then merged back into main).
- To implement those changes, users should rebase their rig-user branch onto the main branch.
The RC2 codebase contains a user folder (rc/user) to place rig/experiment specific files in (see rc/user/template). Users should create their own named folder under user and place configurations, protocols and calibrations here. Config files should use relative paths from this directory wherever possible. Additionally config files should ensure the MATLAB search path for configs, protocols, calibrations is relative to the user folder, e.g.
% ensure searches are relative to user's path
rmpath(genpath(fileparts(config.user))); % Remove all user folders from the path
addpath(genpath(config.user)); % Add back only the current user folder
The .exe files for communication with the Soloist are not tracked by the git repo as they are rig specific. These executables should be built from source for a fresh install of the software of if the source files are modified (use rc/soloist_c/src/build.bat)
See the README in the docs folder for instructions on how to build the documentation.