|Screenshot of wing amplitude tracking using Kinefly|
I'll mostly follow Steve's instructions here, but make notes of any differences. To start off with, I installed 64-bit Ubuntu 14.04 LTS on a new hard drive.
Departing from Steve's instructions, I'll first install ROS Indigo, which is a newer version of ROS and will hopefully be supported for longer. I'll follow the directions here.
I'll be using a firewire (IEEE1394) camera in my rig, not a gigE (Ethernet) camera, so I'll skip the Camera Aravis installation (lines 29-35 of Steve's installation instructions). I also skipped lines 50-53. Instead I installed the ROS drivers for 1394 cameras:
git clone https://github.com/ros-drivers/camera1394.git
Now I'm going to download and install coriander to test that the camera is working:
sudo apt-get install corianderThen I plugged the camera into the computer and ran
corianderUnder the Services tab, click Display and you should see a live image from the camera.
In line 90, I copied the 'polarization' rig instead of 'thadsrig' because that rig used a 1394 camera:
cp -R polarization yourrigname
We are almost done! Now just three lines of code that need to be changed because ROS indigo uses opencv2 instead of an earlier version (I think):
gedit ~/src.git/Kinefly/nodes/kinefly.pyand edit line 240 to be:
rosimg = self.cvbridge.cv2_to_imgmsg(imgInitial, 'passthrough') # used to be img = np.uint8(cv.GetMat(self.cvbridge.imgmsg_to_cv(rosimg, 'passthrough')))line 619 to be
img = np.array(self.cvbridge.imgmsg_to_cv2(rosimg, 'passthrough')) # used to be img = np.uint8(cv.GetMat(self.cvbridge.imgmsg_to_cv(rosimg, 'passthrough')))and line 769 to be
rosimgOutput = self.cvbridge.cv2_to_imgmsg(imgOutput, 'passthrough') # used to be rosimgOutput = self.cvbridge.cv_to_imgmsg(cv.fromarray(imgOutput), 'passthrough')
If you want to test Kinefly without the LED panels attached, you can edit the _main.launch file:
Comment out the following three lines:
<include file= "$(find Kinefly)/launch/$(env RIG)/params_ledpanels.launch" ns="kinefly" />by inserting <!-- before each and --> after each. Now test Kinefly by running this command:
<node name="ledpanels" pkg="ledpanels" type="ledpanels.py" />
<node name="flystate2ledpanels" pkg="Kinefly" type="flystate2ledpanels.py" ns="kinefly" />
roslaunch Kinefly main.launch
Don't forget to click the 'exit' button to close Kinefly--the red x doesn't work!