Comm / GUI interaction
3 posters
Page 1 of 1
Comm / GUI interaction
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?
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
);
cdabbott316- Posts : 12
Join date : 2009-01-08
Re: Comm / GUI interaction
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)
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)
cdabbott316- Posts : 12
Join date : 2009-01-08
Re: Comm / GUI interaction
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.
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.
Re: Comm / GUI interaction
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.
i would change this to>>>
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
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);
};
dsmarsh- Posts : 54
Join date : 2009-01-08
Age : 38
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|