This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
wiki:v2:building_the_libpixyusb_example_on_linux [2018/06/29 16:16] pixycam [3. Example projects] |
wiki:v2:building_the_libpixyusb_example_on_linux [2019/06/12 16:09] (current) jfrench |
||
|---|---|---|---|
| Line 2: | Line 2: | ||
| - | ====== 1. Introduction ====== | + | ====== 1.0. Introduction ====== |
| The libpixyusb2 library provides a software application programming interface (API) for communicating\\ | The libpixyusb2 library provides a software application programming interface (API) for communicating\\ | ||
| Line 16: | Line 16: | ||
| Although this procedure uses Linux Mint-18, it //should// work with any Linux distribution that uses the Debian package manager (e.g. Ubuntu). | Although this procedure uses Linux Mint-18, it //should// work with any Linux distribution that uses the Debian package manager (e.g. Ubuntu). | ||
| + | **IMPORTANT:** due to USB conflicts, attempting to use Pixy with a virtual machine is NOT recommended. | ||
| - | ====== 2. Procedure ====== | + | |
| + | ====== 2.0. Procedure ====== | ||
| ===== 2.1. Install dependencies for building libpixyusb2 ===== | ===== 2.1. Install dependencies for building libpixyusb2 ===== | ||
| Line 27: | Line 29: | ||
| In the terminal window type: | In the terminal window type: | ||
| - | ''%%sudo apt-get install git libusb-1.0-0-dev g++%%'' | + | ''%%sudo apt-get install git libusb-1.0-0-dev g++ build-essential%%'' |
| ===== 2.2. Build libpixyusb2 ===== | ===== 2.2. Build libpixyusb2 ===== | ||
| - | ==== 2.2.1 Download Pixy2 source code ==== | + | ==== 2.2.1. Download Pixy2 source code ==== |
| In the terminal window type: | In the terminal window type: | ||
| Line 42: | Line 44: | ||
| In the terminal window type: | In the terminal window type: | ||
| - | ''%%./pixy2/scripts/build_libpixyusb2.sh%%'' | + | ''%%cd pixy2/scripts && ./build_libpixyusb2.sh%%'' |
| {{:undefined:build_libpixyusb2.png?400|}} | {{:undefined:build_libpixyusb2.png?400|}} | ||
| - | ====== 3. Example projects ====== | + | ====== 2.3. Example projects ====== |
| Before trying the examples below, connect Pixy2 to your Linux system using a USB Micro-B cable: | Before trying the examples below, connect Pixy2 to your Linux system using a USB Micro-B cable: | ||
| Line 52: | Line 54: | ||
| {{wiki:v2:img_5268_result.jpg?400|}} | {{wiki:v2:img_5268_result.jpg?400|}} | ||
| - | ===== 3.1. Color Identification Example (GetBlocksCPPDemo) ===== | + | ===== 2.3.1. Color Identification Example (GetBlocksCPPDemo) ===== |
| The example does the following: | The example does the following: | ||
| Line 60: | Line 62: | ||
| - Block information is displayed (as shown in the image above) if color signatures have been set and if the signatures are currently being detected by Pixy2. | - Block information is displayed (as shown in the image above) if color signatures have been set and if the signatures are currently being detected by Pixy2. | ||
| - | ==== 3.1.1. Build the 'get_blocks_cpp_demo' example ==== | + | ==== Build the 'get_blocks_cpp_demo' example ==== |
| In the terminal window type: | In the terminal window type: | ||
| - | ''%%./pixy2/scripts/build_get_blocks_cpp_demo.sh%%'' | + | ''%%./build_get_blocks_cpp_demo.sh%%'' |
| {{:wiki:v2:build_get_blocks.png?400|}} | {{:wiki:v2:build_get_blocks.png?400|}} | ||
| - | ==== 3.1.2. Start the example ==== | + | ==== Start the example ==== |
| To start the get blocks example, run 'get\_blocks\_cpp\_demo' as root. | To start the get blocks example, run 'get\_blocks\_cpp\_demo' as root. | ||
| Line 74: | Line 76: | ||
| In the terminal window type: | In the terminal window type: | ||
| - | ''%%cd ./pixy2/build/get_blocks_cpp_demo%%''\\ | + | ''%%cd ../build/get_blocks_cpp_demo/%%''\\ |
| ''%%sudo ./get_blocks_cpp_demo%%'' | ''%%sudo ./get_blocks_cpp_demo%%'' | ||
| Line 81: | Line 83: | ||
| Block data received from Pixy2 is displayed in stdout. | Block data received from Pixy2 is displayed in stdout. | ||
| - | ===== 3.2. Line Identification Example (GetLinesCPPDemo) ===== | + | ===== 2.3.2. Line Identification Example (GetLinesCPPDemo) ===== |
| This example does the following: | This example does the following: | ||
| Line 88: | Line 90: | ||
| - Configures Pixy2 for line feature identification | - Configures Pixy2 for line feature identification | ||
| - | ==== 3.2.1. Build the 'get_lines_cpp_demo' example ==== | + | ==== Build the 'get_lines_cpp_demo' example ==== |
| In the terminal window type: | In the terminal window type: | ||
| Line 94: | Line 96: | ||
| ''%%./pixy2/scripts/build_get_lines_cpp_demo.sh%%'' | ''%%./pixy2/scripts/build_get_lines_cpp_demo.sh%%'' | ||
| - | ==== 3.2.2. Start the example ==== | + | ==== Start the example ==== |
| - | To start the pan_tilt demo, run 'get\_lines\_cpp\_demo' as root. | + | To start the get_lines demo, run 'get\_lines\_cpp\_demo' as root. |
| ''%%cd ./pixy2/build/get_lines_cpp_demo%%''\\ | ''%%cd ./pixy2/build/get_lines_cpp_demo%%''\\ | ||
| Line 103: | Line 105: | ||
| {{:wiki:v2:get_lines_demo.png?400|}} | {{:wiki:v2:get_lines_demo.png?400|}} | ||
| - | ====== 3. Comments ====== | + | ====== 3.0. Comments ====== |
| - | We welcome your thoughts and feedback! Please let us know how we can improve. | + | We welcome your thoughts and feedback! Please let us know how we can improve... |