diff --git a/src/Request.cpp b/src/Request.cpp index 43b3705..96900c4 100644 --- a/src/Request.cpp +++ b/src/Request.cpp @@ -11,7 +11,6 @@ void Request::setup(std::string ip, int port, std::string page){ /* send a request to vp_server & return frame/video/folder */ VPResp Request::query(Vector7D& in){ - std::cout << "Sending Request to HTTP Server" << std::endl; VPResp vp_resp; try { req.body = "{\"vector\": [" + diff --git a/src/Server.cpp b/src/Server.cpp index 61fc8b9..be0e25c 100644 --- a/src/Server.cpp +++ b/src/Server.cpp @@ -50,7 +50,7 @@ void Server::addOrUpdateClient(int client_id, float value, const std::string& ip void Server::updateEmbedding(){ for(const auto& c : clients){ const ClientInfo& info = c.second; - float val = std::round(info.value * 1000.0f) / 1000.0f; + float val = (std::round(info.value * 1000.0f) / 1000.0f) / 100.0f; switch(c.first){ case 0: embedding.angry = val; @@ -72,6 +72,9 @@ void Server::updateEmbedding(){ break; case 6: embedding.neutral = val; + embedding.fear = ofRandom(0.1, 0.6); + embedding.angry = ofRandom(0.01, 0.99); + embedding.happy = ofRandom(0.01, 0.99); break; } } @@ -91,7 +94,7 @@ void Server::printClients(){ /* check if the controllers are in use */ void Server::checkActivity(){ - if (previous_embedding != embedding) { // Check if embedding has changed + if (previous_embedding.neutral != embedding.neutral) { // Check if embedding has changed last_change_time = std::chrono::steady_clock::now(); // Reset the timer if there is a change previous_embedding = embedding; // Update the previous embedding to the current one is_active = true; diff --git a/src/ofApp.cpp b/src/ofApp.cpp index 665395b..9a20bf9 100644 --- a/src/ofApp.cpp +++ b/src/ofApp.cpp @@ -93,6 +93,7 @@ void ofApp::update(){ } /* Setup model input using ofImage, allocated fbo, checks if a frame or video_frme should be drawn to the screen */ + player.SetFrame(server->vp_resp.image); player.Update(img, server->is_active); /* Run Models, and set pixels */