Comm / GUI interaction

Go down

Comm / GUI interaction

Post  cdabbott316 on Mon Feb 02, 2009 10:06 pm

Here is what we have so far, let me know if we need to discuss some changes.

I believe the Comm Group is providing the SendCommand and ReceiveImage functions for you, and you are providing the ReceiveDart for us. Is that right?

Code:
// Robot codes
#define   NO_ROBOT  0
#define   ROBOT1    1
#define   ROBOT2    2

//Codes for commands
#define  ROVER_FORWARDS 101
#define  ROVER_BACKWARDS 102
#define  ROVER_RIGHT 103
#define  ROVER_LEFT 104
#define  FRONT_CAMERA_UP 201
#define  FRONT_CAMERA_DOWN 202
#define  FRONT_CAMERA_RIGHT 203
#define  FRONT_CAMERA_LEFT 204
#define  FRONT_CAMERA_ZOOM_IN 205
#define  FRONT_CAMERA_ZOOM_OUT 206
#define  GUN_UP 301
#define  GUN_DOWN 302
#define  GUN_RIGHT 303
#define  GUN_LEFT 304
#define  GUN_FIRE 305
#define  INITIALIZE -111
#define  KILL -555
#define  RESET -999

//codes for camera feeds
#define CAMERA_TOP 501
#define CAMERA_TOP_LEFT 502
#define CAMERA_TOP_RIGHT 503
#define CAMERA_BOTTOM 504
#define CAMERA_BOTTOM_LEFT 505
#define CAMERA_BOTTOM_RIGHT 506
#define CAMERA_ROBOT1_FRONT 507
#define CAMERA_ROBOT1_GUN 508
#define CAMERA_ROBOT2_FRONT 509
#define CAMERA_ROBOT2_GUN 510

// Requests that a command be run on a rover
// Returns true if function is called
//        false if function is not called
bool SendCommCommand(
   int rover_ID, // which rover to send the command to
   int command_name // the command code
);

// Requests an image from the server
// Returns a string with the filename or path on the apache server
string ReceiveCommImage(
   int camera_feed // which camera feed to get
);

// Requests data on if a rover has been hit
// Returns true if rover has been hit
//        false if rover has not been hit
bool ReceiveGuiDart(
   int rover_ID // which rover to get the data from
);
avatar
cdabbott316

Posts : 12
Join date : 2009-01-08

View user profile

Back to top Go down

Re: Comm / GUI interaction

Post  cdabbott316 on Tue Feb 03, 2009 9:37 pm

or are we only suppose to call the dart one when there is a hit?

something like

// sends data to gui saying that rover has been hit
// stops all gui controlling stuff
// does whatever you all decide needs to be done
report_hit(rover)
avatar
cdabbott316

Posts : 12
Join date : 2009-01-08

View user profile

Back to top Go down

Re: Comm / GUI interaction

Post  seanc on Wed Feb 04, 2009 12:46 pm

what do you mean we provide the ReceiveDart for us?
I do know this:

We are keeping track of how many darts there are (3/3)
we are displaying 3 pictures that we will mark out each time a dart is fired
if a dart misses we need to receive a MISS
if a dart hits we need to receive a HIT

does this make any sense? I am sorry for late response I thought Ryan would have replied or talked to David.

_________________
Sean Cavanaugh
seanc@clemson.edu
avatar
seanc

Posts : 30
Join date : 2009-01-07
Age : 32
Location : Clemson,SC

View user profile http://people.clemson.edu/~seanc

Back to top Go down

Re: Comm / GUI interaction

Post  dsmarsh on Wed Feb 04, 2009 1:14 pm

he means that when there is a hit it triggers a series of events>
sensor calls function that comm writes>
comm calls function that gui writes>
gui's function ends game if hit was recieved...

so gui needs this function written so we can call it.

Code:
// Requests data on if a rover has been hit
// Returns true if rover has been hit
//        false if rover has not been hit
bool ReceiveGuiDart(
  int rover_ID // which rover to get the data from
);


i would change this to>>>

Code:
void ReceiveGuiDart(
  int rover_ID, // which rover to get the data from
  bool hit; //true if hit false if not hit
);

that way, the gui group will know which robot and if it was hit or not.

--i dont think the other way makes sense
because the gui group cant return a bool of whether the robot was hit or not, it has to be something we pass to them

so chris you can have something like this for your stub code
Code:
void ReceiveGuiDart(
  int rover_ID, // which rover to get the data from
  bool hit; //true if hit false if not hit
){
  if (hit==true)
      printf("hit landed!!!\n");
  else
      printf("hit missed!!!\n);
};

_________________
David Marshall
(803) 707-3466
dsmarsh@clemson.edu
Comm Group Leader
avatar
dsmarsh

Posts : 54
Join date : 2009-01-08
Age : 32

View user profile

Back to top Go down

Re: Comm / GUI interaction

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum