<commit_before>/**
* @file CollisionPercept.h
*
* @author <a href="mailto:<EMAIL>"><NAME></a>
* @author <a href="mailto:<EMAIL>"><NAME></a>
* Definition of the class CollisionPercept
*/

#ifndef __CollisionPercept_h_
#define __CollisionPercept_h_

#include "Tools/DataStructures/Printable.h"
#include "Tools/DataStructures/Serializer.h"

#include <vector>
#include "Tools/Math/Vector2.h"
#include <Representations/Infrastructure/FrameInfo.h>

/**
* This describes the CollisionPercept
*/
class CollisionPercept : public naoth::Printable
{
public:
  CollisionPercept()
    : 
    timeCollisionArmLeft(0), 
    timeCollisionArmRight(0)
  {}

  ~CollisionPercept(){}

  // Stuff for the Arm collision
  unsigned int timeCollisionArmLeft;
  unsigned int timeCollisionArmRight;

  std::vector<Vector2d> referenceHullLeft;
  std::vector<Vector2d> referenceHullRight;
  std::vector<Vector2d> pointBufferLeft;
  std::vector<Vector2d> pointBufferRight;
  std::vector<Vector2d> newHullLeft;
  std::vector<Vector2d> newHullRight;

  //stuff for bumper collision
  bool isLeftFootColliding;
  bool isRightFootColliding;
  naoth::FrameInfo lastComputedCollisionLeft;
  naoth::FrameInfo lastComputedCollisionRight;
  bool collision_left_bumper;
  bool collision_right_bumper;
  
  virtual void print(std::ostream& stream) const
  {
    stream << "timeCollisionArmLeft = " << timeCollisionArmLeft << '\n';
    stream << "timeCollisionArmRight = " << timeCollisionArmRight << '\n';
    stream << "referenceHullLeft: " << "\n";
    for (size_t i = 0; i < referenceHullLeft.size(); i++){
      stream << "x= " << referenceHullLeft[i].x << " y = " << referenceHullLeft[i].y << "\n";
    }
	stream << "referenceHullRight: " << "\n";
	for (size_t i = 0; i < referenceHullRight.size(); i++){
		stream << "x= " << referenceHullRight[i].x << " y = " << referenceHullRight[i].y << "\n";
	}
  }
};

namespace naoth
{
  template<>
  class Serializer<CollisionPercept><commit_msg>Commented out hull print and added bumper prints<commit_after>/**
* @file CollisionPercept.h
*
* @author <a href="mailto:<EMAIL>"><NAME></a>
* @author <a href="mailto:<EMAIL>"><NAME></a>
* Definition of the class CollisionPercept
*/

#ifndef __CollisionPercept_h_
#define __CollisionPercept_h_

#include "Tools/DataStructures/Printable.h"
#include "Tools/DataStructures/Serializer.h"

#include <vector>
#include "Tools/Math/Vector2.h"
#include <Representations/Infrastructure/FrameInfo.h>

/**
* This describes the CollisionPercept
*/
class CollisionPercept : public naoth::Printable
{
public:
  CollisionPercept()
    : 
    timeCollisionArmLeft(0), 
    timeCollisionArmRight(0)
  {}

  ~CollisionPercept(){}

  // Stuff for the Arm collision
  unsigned int timeCollisionArmLeft;
  unsigned int timeCollisionArmRight;

  std::vector<Vector2d> referenceHullLeft;
  std::vector<Vector2d> referenceHullRight;
  std::vector<Vector2d> pointBufferLeft;
  std::vector<Vector2d> pointBufferRight;
  std::vector<Vector2d> newHullLeft;
  std::vector<Vector2d> newHullRight;

  //stuff for bumper collision
  bool isLeftFootColliding;
  bool isRightFootColliding;
  naoth::FrameInfo lastComputedCollisionLeft;
  naoth::FrameInfo lastComputedCollisionRight;
  bool collision_left_bumper;
  bool collision_right_bumper;
  
  virtual void print(std::ostream& stream) const
  {
    /*stream << "timeCollisionArmLeft = " << timeCollisionArmLeft << '\n';
    stream << "timeCollisionArmRight = " << timeCollisionArmRight << '\n';
    stream << "referenceHullLeft: " << "\n";
    for (size_t i = 0; i < referenceHullLeft.size(); i++){
      stream << "x= " << referenceHullLeft[i].x << " y = " << referenceHullLeft[i].y << "\n";
    }
	stream << "referenceHullRight: " << "\n";
	for (size_t i = 0; i < referenceHullRight.size(); i++){
		stream << "x= " << referenceHullRight[i].x << " y = " << referenceHullRight[i].y << "\n";
	}*/
    stream << "isLeftFootColliding=" << (isLeftFootColliding ? "true" : "false") << std::endl;
    stream << "isRightFootColliding=" << (isRightFootColliding ? "true" : "false") << std::endl;
    stream << "Last computed collision Left: " << lastComputedCollisionLeft.getFrameNumber() << std::endl;
    stream << "Last computed collision Right: " << lastComputedCollisionRight.getFrameNumber() << std::endl;
  }
};

namespace naoth
{
  template<>
  class Serializer<CollisionPercept>
{'fraction_non_alphanumeric': 0.14755228683061367, 'fraction_numerical': 0.00505630889450701, 'mean_word_length': 4.994490358126722, 'pattern_counts': {'":': 0, '<': 147, '<?xml version=': 0, '>': 39, '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': '2766871', 'n_tokens_mistral': 1482, 'n_tokens_neox': 1458, 'n_words': 292}