This step is not stictly necessary, but everything works in Lucid, so it may save time.
- Download and install Ubuntu 10.04 (Lucid) from http://www.ubuntu.com/download/ubuntu/download
- Often the display will be improved by looking under System>Administration>Hardware Drivers for video card drivers.
- Run the Update Manager (under System>Administration).
Andrew Straw wrote fview, a general purpose video acquistion application. Strokelitude (also by Dr. Straw) is a plugin for fview.
Add the repositories, following the instructions at http://code.astraw.com/projects/motmot/download.html
sudo add-apt-repository ppa:astraw/ppa sudo wget --output-document=/etc/apt/sources.list.d/astraw.list http://debs.astraw.com/sources.list.d/astraw-$(lsb_release -cs).list sudo apt-get update && sudo apt-get install astraw-keyring && sudo apt-get update
From synaptic (System>Administration>Synaptic Package Manager) install the following packages with all their dependencies:
Test fview by typing fview at a terminal (Applications>Accessories>Terminal) or going to Applications>Sound & Video>fview don't worry about error message:
While attempting to open the plugin "fview_ext_trig", FView encountered an error. The error is: Cannot find device. (Perhaps run with environment variable REQUIRE_TRIGGER=0.)
Initialize the camera by going to Camera>initialize camera...
Note: If you are using a firewire (1394) camera and you cannot initialize it, try running sudo fview instead. Also, run the following command in a terminal:
sudo adduser $USER video sudo chown .video /dev/raw1394
then log out and log back in.
Now we are ready to install the plugin, "strokelitude," that actually tracks the wing positions.
In a terminal, type:
mkdir src cd src git clone git://github.com/astraw/remote_traits.git cd remote_traits/ sudo python setup.py install cd .. git clone git://github.com/motmot/strokelitude.git cd strokelitude/ sudo python setup.py install
Start fview, you should now see strokelitude as an option under Windows.
Install ROS (Electric)
The easiest way to save strokelitude data is to install ROS (Robot Operating System) and save the "topics" that strokelitude "publishes" in a .bag file. In order to do this, we install ROS, then start roscor before opening fview. We record using the rosbag record command.
Follow the instructions at http://www.ros.org/wiki/electric/Installation/Ubuntu . Briefly, you need to do the following. In a terminal, type:
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu lucid main" > /etc/apt/sources.list.d/ros-latest.list' wget http://packages.ros.org/ros.key -O - | sudo apt-key add - sudo apt-get update sudo apt-get install ros-electric-desktop-full echo "source /opt/ros/electric/setup.bash" >> ~/.bashrc . ~/.bashrc
The fourth line will take some time -- you are installing all of ROS.
Now we'll need to create a directory in which we can place ROS scripts (see http://www.ros.org/wiki/ROS/Tutorials/InstallingandConfiguringROSEnvironment ). In a terminal, type
cd ~/src mkdir ros_workspace cd ros_workspace
We want to tell ROS that this directory will contain ROS scripts. Create a file named setup.sh:
#!/bin/sh source /opt/ros/electric/setup.bash export ROS_ROOT=/opt/ros/electric/ros export PATH=$ROS_ROOT/bin:$PATH export PYTHONPATH=$ROS_ROOT/core/roslib/src:$PYTHONPATH export ROS_PACKAGE_PATH=~/src/ros_workspace:/opt/ros/electric/stacks:$ROS_PACKAGE_PATH
then run the file using the command . setup.sh
To make this change permanent, assuming the setup.sh file is in your home directory, add to the bottom of your .bashrc file:
Now we are ready to install the package that defines the message type strokelitude will publish in ROS. In a terminal type:
git clone git://github.com/motmot/strokelitude_ros.git rospack profile rosmake strokelitude_ros rosdep install rxtools rosmake roscpp_tutorials rospy_tutorials rxtools roscore
then open fview by typing fview in a new terminal. Open the strokelitude window and click box next to 'Processing enabled'
In a new terminal type rxplot /strokelitude/left_wing_angle_radians /strokelitude/right_wing_angle_radians in order to view a realtime plot of the fview data
In new terminal, navigate to the directory where you want to record data, then type rosbag record -O data /strokelitude (this will save data in data.bag file)
To import your data into Python, do something like the following in a python script:
import roslib roslib.load_manifest('rosbag') import rosbag bag = rosbag.Bag('data.bag') leftWingRad=list() rightWingRad=list() for topic, msg, t in bag.read_messages(): leftWingRad.append(msg.left_wing_angle_radians) rightWingRad.append(msg.right_wing_angle_radians)
If you want to do closed-loop experiments using the Reiser panels, probably the simplest way is to use the mcc analog output board to output an analog voltage proportional to each wingstroke. In order to install this, follow these steps:
Using synaptic package manager, install libmcclibhid
Plug in the usb1208FS (this used to be called pmd1208FS and those work also) and test it by running the command sudo testusb1208FS in a terminal. Type 'b' to blink the LED.
Using synaptic, install python-wjul. This allows Python access to the usb1208FS.
install strokelitude-jfi-emulater by typing the following into a terminal:
cd src git clone git://github.com/motmot/strokelitude-jfi-emulator.git cd strokelitude-jfi-emulator sudo python setup.py install