Monday, December 23, 2013

Running Our Own Code on the RaspberryPi

Myself and Albert finally got our own code running on the RaspberryPi. 

Why is this important?

     Up to this point, we had been working on getting OpenCV (our chosen library for computer vision) and the RaspberryPi Camera libraries installed. These are necessary for writing our code for vision detection, as without them we have no programming tools. We finished the installation of OpenCV a few weeks ago, but did not get the raspicam libraries installed until yesterday. The raspicam libraries are used to connect and utilize the RaspberryPi camera. With these things installed, we are now able to write and compile our code. 

How did we do it?

     After getting our libraries installed, we needed to figure out how to write code that would have access to both the OpenCV libraries and the raspicam libraries. This was problematic as both of the libraries were in different locations, and we had no idea how to get them to work together. 
     We solved the issue by locating example programs and storing our program in the same place. Although it is not the most elegant solution, it works. At this point we aren't linux-savvy enough to find a better solution, so we'll stick with this because it works. 

Other notable findings

     One big issue we we're having was figuring out how to compile code that was written. An example would be the program that we wrote that was stored in the sample program workspace, as mentioned above. We had the program written but it was not in an executable form. The fix was to run the  make command within the build directory inside the workspace. This recompiled the code and gave us an executable file to run.

What does the program do?

     The program that we wrote is very simple. All it does it open up a window that streams the view of the camera. The point of it was to make sure everything was functional.

What's next?

     The next step is to begin writing code for motion detection. We also plan to get another RaspberryPi running with opencv, the raspicam library, and python libraries so we can test python against the c++ we have thus far. 


No comments:

Post a Comment