<commit_before>#include "Communicator.hpp"

#include <ctime>
#include <iostream>
#include <string>
#include "api_application/Announce.h"

Communicator::Communicator(CvKinect *device, CvImageProcessor *analyzer):
	device(device),
	analyzer(analyzer),
	initialized(false)
{
	ros::NodeHandle n;

	// Advertise myself to API
	ros::ServiceClient announceClient = n.serviceClient<api_application::Announce>("announce");
	
	api_application::Announce announce;
	announce.request.type = 0; // 0 means camera module
	
	if (announceClient.call(announce))
	{
		id = announce.response.id;
	
		if (id == ~0 /* -1 */)
		{
			ROS_ERROR("Error! Got id -1");
			exit(1);
		}
		else
		{
			ROS_INFO("Position module successfully announced. Got id %d", id);
		}
	}
	else
	{
		ROS_ERROR("Error! Could not announce myself to API!");
		exit(2);
	}
	
	// Services<commit_msg>Changed output<commit_after>#include "Communicator.hpp"

#include <ctime>
#include <iostream>
#include <string>
#include "api_application/Announce.h"

Communicator::Communicator(CvKinect *device, CvImageProcessor *analyzer):
	device(device),
	analyzer(analyzer),
	initialized(false)
{
	ros::NodeHandle n;

	// Advertise myself to API
	ros::ServiceClient announceClient = n.serviceClient<api_application::Announce>("announce");
	
	api_application::Announce announce;
	announce.request.type = 0; // 0 means camera module
	
	if (announceClient.call(announce))
	{
		id = announce.response.id;
	
		if (id == ~0 /* -1 */)
		{
			ROS_ERROR("Error! Got id -1");
			exit(1);
		}
		else
		{
			ROS_INFO("Camera module successfully announced. Got id %d", id);
		}
	}
	else
	{
		ROS_ERROR("Error! Could not announce myself to API!");
		exit(2);
	}
	
	// Services
{'fraction_non_alphanumeric': 0.14344503233392122, 'fraction_numerical': 0.00823045267489712, 'mean_word_length': 4.420382165605096, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '312558', 'n_tokens_mistral': 648, 'n_tokens_neox': 589, 'n_words': 132}