cu-ecen-aeld / final-project-abbottwhitley

final-project-abbottwhitley created by GitHub Classroom
0 stars 0 forks source link

Setup daemons and Startup Scripts #20

Closed abbottwhitley closed 3 years ago

abbottwhitley commented 3 years ago

Camera module currently requires user input to start the application server. Setup init.d scripts to start the camera module application server and python HTML server.

DoD: server.cpp and python html program initialize at startup on the Camera module

abbottwhitley commented 3 years ago

Added init scripts for python and C++ video server. Had to add logic to server.cpp to detect architecture. Init script wouldn't load the relative path for the facedetection xml files.

const char *dev_arch = "x86_64";                                                                                     
dev_arch = getBuild();                                                                                               
if (dev_arch == "x86_64")
{                                 
    // Development machine, use relative path                                                                                       
    imgStruct.nestedCascade.load(samples::findFileOrKeep("xml/haarcascade_eye_tree_eyeglasses.xml")); 
    imgStruct.cascade.load(samples::findFile("xml/haarcascade_frontalface_alt.xml"));
}   
else
{
    // Target machine, use full path                                                    
    imgStruct.nestedCascade.load(samples::findFileOrKeep("/usr/bin/opencv/camera_app/cpp/xml/haarcascade_eye_tre$        
    imgStruct.cascade.load(samples::findFile("/usr/bin/opencv/camera_app/cpp/xml/haarcascade_frontalface_alt.xml$    
}                                                                                                                             

Both servers start at boot without user interaction. See this commit