/* LICENSE:
  =========================================================================
    CMPack'04 Source Code Release for OPEN-R SDK 1.1.5-r2 for ERS7
    Copyright (C) 2004 Multirobot Lab [Project Head: Manuela Veloso]
    School of Computer Science, Carnegie Mellon University
    All rights reserved.
  ========================================================================= */

#ifndef INCLUDED_RobotViewData_h
#define INCLUDED_RobotViewData_h

#include "../../agent/headers/MessageStructures.hh"
#include "../../agent/Vision/VisionInterface.h"

#include "../log_processing/shared/WorldModelPacketDecoder.h"
#include "../log_processing/shared/TrackerPacketDecoder.h"
#include "../log_processing/shared/WMDebugPacketDecoder.h"

using namespace VisionInterface;

static const int RVDMaxRobotId = 8;
static const int RVDMaxRobots  = 9;

static const int MaxImageXSize=208;
static const int MaxImageYSize=160;

/*------------------------------------------------------------------
CLASS
  RobotViewData

DESCRIPTION
  The data available about the robot's current understanding of the
world.
------------------------------------------------------------------*/
struct RobotViewData {
  RobotPositionInfo robotPosn;
  Gaussian2 worldModelObjs[WorldModelPacketDecoder::NumGaussians];
  uchar worldModelObjsValid[WorldModelPacketDecoder::NumGaussians];
  Gaussian2 trackerObjs[TrackerPacketDecoder::NumGaussians];
  uchar trackerObjsValid[TrackerPacketDecoder::NumGaussians];
  WMDebug wmDebugObjs[WMDebugPacketDecoder::NUMOBJS];
  RadialObjectMap visMap;
  ObjectInfo visionObjs;
  int rleImageXSize;
  int rleImageYSize;
  int rawImageXSize;
  int rawImageYSize;
  uchar rleImg[MaxImageXSize*MaxImageYSize];
  uchar rawImg[MaxImageXSize*MaxImageYSize*3];
  bool kicking;
};

/*------------------------------------------------------------------
CLASS
  RobotViewData

DESCRIPTION
  The data available about the robots' current understanding of the
world.
------------------------------------------------------------------*/
struct AllRobotViewData {
  bool robotsActive[RVDMaxRobots];
  RobotViewData robots[RVDMaxRobots];

  AllRobotViewData() {
    for(int robot_idx=0; robot_idx<RVDMaxRobots; robot_idx++)
      robotsActive[robot_idx]=false;
  }
};

#endif
