Configuring the PixyCam

triangle-exclamation

Using Pixy2 with PX4

The pixy2 camera is a computer-aided visual recognition system used in NXP Cup to create a line-following robot. It can also be trained to detect colored objects.

Configuring the camera

To start working with the camera you first need to configure it. Download and install Pixymon v2arrow-up-right then connect your camera to your computer using USB.

The camera communication interface has to be configured first. Follow this guide arrow-up-rightfor more information.

Open Pixymon v2. In the "Program" tab you can choose different modes. As default there are four different modes to choose from:

  • color connected components or CCC: a color-based filtering algorithm. you can teach the camera what you are interested in sensing (more information herearrow-up-right)

  • line tracking: detect and track line (more information herearrow-up-right)

  • pan tilt demo: testing the program of pan-tilt mechanism (more information herearrow-up-right)

  • video: video display (more information herearrow-up-right)

Example code

An example code is already integrated to PX4 code. This code used line tracking mode and publish vector data using the uORB messaging API of PX4 (more information in this linkarrow-up-right).

Another example code is available under the NXP HoverGames GitHub. This code uses CCC mode to print block data. This code is good to start learning the API :

Line tracking mode

The Pixy 2 has to be in the mode "line tracking ". The instructions can be found herearrow-up-right.

To develop new application for line tracking, you can refer to this documentationarrow-up-right.

Last updated

Was this helpful?