Crazyflie hardware camera

Mounting the camera

Mount and connect the camera as show in the image below. Ensure that you connect the camera to the right pins. In the image below the USB port is on the right side (same side as battery is plugged in) and the camera is pointing forward on the drone.

Black camera (GND) cable should go on the 1st pin and the red cable is on the 2nd pin, on their respective side, counting from the USB port side.

ONLY (DIS)CONNECT THE CAMERA WHEN THE CRAZYFLIE IS POWERED OFF! to avoid shorting pins and frying electronics.

Set channel

See VTX Frequency Allocation to find the video channel number for your group, and how to set it on the video transmitter. NOTE It is not the same channel number as for the Crazyflie!

Video receiver

The camera we use is connected to off board control station (your computer) via a radio link. You need a video receiver for that. It connects to the USB on the computer and makes the camera on the drone appear as if connected to the computer as a UVC device.

You need to do some setup for this to work. Make sure that the video receiver is disconnected and run

echo 'SUBSYSTEMS=="usb", ATTRS{idVendor}=="18ec", MODE:="0666", GROUP:="plugdev"' | sudo sh -c 'dd of=/etc/udev/rules.d/99-uvc-receiver.rules 2>/dev/null && udevadm control --reload-rules && udevadm trigger'

Make sure that your user belongs to the `plugdev` group. You test this by issuing the command `id` on the command line which should result in something like

patric@PJZen:~$ id
uid=1000(patric) gid=1000(patric) groups=1000(patric),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),113(lpadmin),128(sambashare)

If you do not belong to the plugdev group issue the following command

sudo gpasswd -a $USER plugdev

You need to log out and in again for the new group properties to take effect.

Testing the camera

Fire up a program that allows you to stream video from a camera. In Linux you can use the program cheese (in Mac photobooth works). Select the video source "USB2.0 PC CAMERA" (name under Mac).