/* 
    Robot Simulator

    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation; either version 2
    of the License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

    (C) 2006 Jason Hunt
    nulluser@gmail.gom 
*/

#include <windows.h>
#include "utility.h"

#ifndef ROBOT_H
#define ROBOT_H


#define MAX_IR_DIST 2.0


/*typedef struct sensor_type
{
    double wall, food, other;
};*/



typedef struct robot_type
{
    //robot_type *next;         // Pointer to next animal in linked list
    
    double x_size, y_size;
    double x, y, dx, dy;                // (x,y) position in world space
    double dir, ddir;                 // Facing direction
    
    double speed;
    
    double sensor_dist; // Distance from center for touch sensor
    double sensor_size; // diameter of sensor
    

    unsigned num_touch_points;
    
    // Inputs to neural network
    bool touch[6];

    double ir[6];
    unsigned int num_vision_points;

   // sensor_type vision[30];

/*    double end_x[60];
    double end_y[60];*/
    
    double size;

    // Outputs from neural network
    double l_drive, r_drive;    // Left and right drive motors    
    
    
    bool wall_found[6];
    point wall_points[6];
    
    bool draw_vision;
  
    double nav_dir;
    double nav_mag;
    double nav_off;
  
};



void robot_draw(HDC dc);
void robot_update();
void robot_init();
void robot_motion(double l, double r);

void robot_reset( );

extern robot_type robot;
#endif


