<commit_before>//============================================================================
// Name        : mx_calib.cpp
// Author      : 
// Version     :
// Copyright   : 
// Description : Hello World in C++, Ansi-style
//============================================================================


#include <vector>
#include <string>
#include <fstream>
#include <iostream>

#include "motorDiscovery.h"
#include "usb2dynamixel/dynamixel/dynamixel.h"
#include "usb2dynamixel/dynamixel/USB2Dynamixel.h"

#include "json/json.h"
#include "commonOptions/commonOptions.h"

namespace
{
	commonOptions::Option<std::string> cfgDevice("device", "/dev/ttyUSB0", "serial device to connect to the motors to");
	commonOptions::Option<std::string> cfgConfigFile("file", "motorConfig.json", "file to work on");
}

int main() {

	USB2Dynamixel usb2dyn("/dev/ttyUSB0", 20);
	MotorDiscovery discovery(usb2dyn);


	std::ifstream inFile;
	inFile.opencfg(*ConfigFile);

	std::stringstream strStream;
	strStream << inFile.rdbuf();
	std::string str = strStream.str();
	inFile.close();

	Json::Value rootNode;
	Json::Reader jsonReader;
	Json::StyledWriter jsonWriter;
	jsonReader.parse(str, rootNode);

	std::vector<uint>baudrates{dynamixel::baudIndexToBaudrate(1), dynamixel::baudIndexToBaudrate(34)};
	std::vector<std::pair<dynamixel::motorID, uint>> motors = discovery.scanForMotors(0, 253, baudrates);<commit_msg>oops... something went wrong here...<commit_after>//============================================================================
// Name        : mx_calib.cpp
// Author      : 
// Version     :
// Copyright   : 
// Description : Hello World in C++, Ansi-style
//============================================================================


#include <vector>
#include <string>
#include <fstream>
#include <iostream>

#include "motorDiscovery.h"
#include "usb2dynamixel/dynamixel/dynamixel.h"
#include "usb2dynamixel/dynamixel/USB2Dynamixel.h"

#include "json/json.h"
#include "commonOptions/commonOptions.h"

namespace
{
	commonOptions::Option<std::string> cfgDevice("device", "/dev/ttyUSB0", "serial device to connect to the motors to");
	commonOptions::Option<std::string> cfgConfigFile("file", "motorConfig.json", "file to work on");
}

int main() {

	USB2Dynamixel usb2dyn("/dev/ttyUSB0", 20);
	MotorDiscovery discovery(usb2dyn);


	std::ifstream inFile;
	inFile.open(*cfgConfigFile);

	std::stringstream strStream;
	strStream << inFile.rdbuf();
	std::string str = strStream.str();
	inFile.close();

	Json::Value rootNode;
	Json::Reader jsonReader;
	Json::StyledWriter jsonWriter;
	jsonReader.parse(str, rootNode);

	std::vector<uint>baudrates{dynamixel::baudIndexToBaudrate(1), dynamixel::baudIndexToBaudrate(34)};
	std::vector<std::pair<dynamixel::motorID, uint>> motors = discovery.scanForMotors(0, 253, baudrates);
{'fraction_non_alphanumeric': 0.24742998936547322, 'fraction_numerical': 0.012052463665366891, 'mean_word_length': 6.406824146981627, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 21, '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': '4464871', 'n_tokens_mistral': 945, 'n_tokens_neox': 888, 'n_words': 169}