<commit_before>/*
 * @file VirtualVisionProcessor.cpp
 *
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 * @breief calculate perceptions from virtual vision
 *
 */

#include "VirtualVisionProcessor.h"

#include <Tools/Math/Matrix_mxn.h>
#include "Tools/DataConversion.h"

using namespace std;

VirtualVisionProcessor::VirtualVisionProcessor()
{
  goalPostNames.insert("G1L");
  goalPostNames.insert("G2L");
  goalPostNames.insert("G1R");
  goalPostNames.insert("G2R");

  goalPostTypes["G1L"] = GoalPercept::GoalPost::rightPost;
  goalPostTypes["G2L"] = GoalPercept::GoalPost::leftPost;
  goalPostTypes["G1R"] = GoalPercept::GoalPost::leftPost;
  goalPostTypes["G2R"] = GoalPercept::GoalPost::rightPost;

  // NOTE: this is the configuration of SPL, blue team defence blue goal
  // it is not match the visualization of SimSpark
  goalPostColors["G1L"] = ColorClasses::skyblue;
  goalPostColors["G2L"] = ColorClasses::skyblue;
  goalPostColors["G1R"] = ColorClasses::yellow;
  goalPostColors["G2R"] = ColorClasses::yellow;

  lineNames.push_back(LineName("F1L","F1R"));
  lineNames.push_back(LineName("F2L","F2R"));
  lineNames.push_back(LineName("F1L","F2L"));
  lineNames.push_back(LineName("F1R","F2R"));

  cornerNames.insert("F1L");
  cornerNames.insert("F1R");
  cornerNames.insert("F2L");
  cornerNames.insert("F2R");

  const FieldInfo& theFieldInfo = getFieldInfo();
  flagPosOnField[GameData::blue]["F1L"] = theFieldInfo.crossings[FieldInfo::ownCornerLeft].position;
  flagPosOnField[GameData::blue]["F2L"] = theFieldInfo.crossings[FieldInfo::ownCornerRight].position;
  flagPosOnField[GameData::blue]["F1R"] = theFieldInfo.crossings[FieldInfo::opponentCornerLeft].position;
  flagPosOnField[GameData::blue]["F2R"] = theFieldInfo.crossings[FieldInfo::opponentCornerRight].position;

  flagPosOnField[GameData::red]["F1L"] = theFieldInfo.crossings[FieldInfo::opponentCornerRight].position;
  flagPosOnField[GameData::red]["F2L"] = theFieldInfo.crossings[FieldInfo::opponentCornerLeft].position;
  flagPosOnField[GameData::red]["F1R"] = theFieldInfo.crossings[FieldInfo::ownCornerRight].position;
  flagPosOnField[GameData::red]["F2R"] = theFieldInfo.crossings[FieldInfo::ownCornerLeft].position;

  DEBUG_REQUEST_REGISTER("VirtualVisionProcessor:corner_flags", "draw the corner flags", false);<commit_msg>style<commit_after>/*
 * @file VirtualVisionProcessor.cpp
 *
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 * @breief calculate perceptions from virtual vision
 *
 */

#include "VirtualVisionProcessor.h"

#include <Tools/Math/Matrix_mxn.h>
#include "Tools/DataConversion.h"

using namespace std;

VirtualVisionProcessor::VirtualVisionProcessor()
{
  goalPostNames.insert("G1L");
  goalPostNames.insert("G2L");
  goalPostNames.insert("G1R");
  goalPostNames.insert("G2R");

  goalPostTypes["G1L"] = GoalPercept::GoalPost::rightPost;
  goalPostTypes["G2L"] = GoalPercept::GoalPost::leftPost;
  goalPostTypes["G1R"] = GoalPercept::GoalPost::leftPost;
  goalPostTypes["G2R"] = GoalPercept::GoalPost::rightPost;

  // NOTE: this is the configuration of SPL, blue team defence blue goal
  // it is not match the visualization of SimSpark
  goalPostColors["G1L"] = ColorClasses::skyblue;
  goalPostColors["G2L"] = ColorClasses::skyblue;
  goalPostColors["G1R"] = ColorClasses::yellow;
  goalPostColors["G2R"] = ColorClasses::yellow;

  lineNames.push_back(LineName("F1L","F1R"));
  lineNames.push_back(LineName("F2L","F2R"));
  lineNames.push_back(LineName("F1L","F2L"));
  lineNames.push_back(LineName("F1R","F2R"));

  cornerNames.insert("F1L");
  cornerNames.insert("F1R");
  cornerNames.insert("F2L");
  cornerNames.insert("F2R");

  flagPosOnField[GameData::blue]["F1L"] = getFieldInfo().crossings[FieldInfo::ownCornerLeft].position;
  flagPosOnField[GameData::blue]["F2L"] = getFieldInfo().crossings[FieldInfo::ownCornerRight].position;
  flagPosOnField[GameData::blue]["F1R"] = getFieldInfo().crossings[FieldInfo::opponentCornerLeft].position;
  flagPosOnField[GameData::blue]["F2R"] = getFieldInfo().crossings[FieldInfo::opponentCornerRight].position;

  flagPosOnField[GameData::red]["F1L"] = getFieldInfo().crossings[FieldInfo::opponentCornerRight].position;
  flagPosOnField[GameData::red]["F2L"] = getFieldInfo().crossings[FieldInfo::opponentCornerLeft].position;
  flagPosOnField[GameData::red]["F1R"] = getFieldInfo().crossings[FieldInfo::ownCornerRight].position;
  flagPosOnField[GameData::red]["F2R"] = getFieldInfo().crossings[FieldInfo::ownCornerLeft].position;

  DEBUG_REQUEST_REGISTER("VirtualVisionProcessor:corner_flags", "draw the corner flags", false);
{'fraction_non_alphanumeric': 0.16070649803750545, 'fraction_numerical': 0.013955516790231139, 'mean_word_length': 8.516597510373444, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '1469523', 'n_tokens_mistral': 1611, 'n_tokens_neox': 1594, 'n_words': 187}