Camera/Nerf API
3 posters
Page 1 of 1
Camera/Nerf API
Here's what I have for the camera/nerf API. Let me know if I'm a little closer to doing it right this time
STUB CODE
- Code:
// ECE 453 - Spring 2009
// Communication group
// Camera/Nerf gun API
// Describes the application programming interface between the communication
// group and camera movement/nerf gun applications.
/*** NERF GUN APPS ***/
// Connects to nerf gun for aiming and firing functionality
// (returns true on success??)
bool Connect();
// Disconnect from nerf gun
// (returns true on success??)
bool Disconnect();
// Commands for aiming the nerf dart (Up, Down, Left, Right)
// (returns true on success??)
bool MoveUp();
bool MoveDown();
bool MoveLeft();
bool MoveRight();
// Commands for firing the nerf dart
// (returns true on success??)
bool Fire();
bool Stop(); // Not sure what this does, need to ask camera/nerf group
// Returns gun to zero (predefined starting position i.e. (0,0) coordinates)
bool ReturnToZero();
// Diagonal movement (May or may not be implemented)
bool MoveUpLeft();
bool MoveUpRight();
bool MoveDownLeft();
bool MoveDownRight();
/*** END NERF GUN APPS ***/
/*** CAMERA MOVEMENT APPS ***/
// Camera movement
// sensitivity - sets the rate at which the camera moves up, down, left, or right
// up, down, left, right - by passing parameter as "true", the camera moves in that
// direction by a constant rate set by sensitivity.
void moveCamera(bool up, bool down, bool left, bool right, int sensitivity);
//Starts and ends camera feed
// ID - id of the camera to start feed on
void startFeed(int ID);
void endFeed(int ID);
/*** END CAMERA MOVEMENT APPS ***/
STUB CODE
- Code:
// ECE 453 - Spring 2009
// Communication group
// Camera/Nerf gun Stub Code
// Stub code for the interface between communication grou
// and camera movement/nerf gun
/*** NERF GUN APPS ***/
// All nerf functions may be changed to type 'void' instead of
// bool, pending discussion with nerf group
// Connects to nerf gun for aiming and firing functionality
// (returns true on success??)
bool Connect(){
printf("Connecting to nerf gun!");
return TRUE;
}
// Disconnect from nerf gun
// (returns true on success??)
bool Disconnect(){
printf("Disconnecting from nerf gun!");
return TRUE;
}
// Commands for aiming the nerf dart (Up, Down, Left, Right)
// (returns true on success??)
bool MoveUp(){
printf("Moving dart gun up");
return TRUE;
}
bool MoveDown(){
printf("Moving dart gun down");
return TRUE;
}
bool MoveLeft(){
printf("Moving dart gun left");
return TRUE;
}
bool MoveRight(){
printf("Moving dart gun right");
return TRUE;
}
// Commands for firing the nerf dart
// (returns true on success??)
bool Fire(){
printf("Dart gun FIRE!");
return TRUE;
}
bool Stop(){
printf("Dart gun HALT!");
return TRUE;
}
// Returns gun to zero (predefined starting position i.e. (0,0) coordinates)
bool ReturnToZero(){
printf("Return dart gun to initial position");
return TRUE;
}
// Diagonal movement (May or may not be implemented)
bool MoveUpLeft(){
printf("Move dart gun UP and LEFT");
return TRUE;
}
bool MoveUpRight(){
printf("Move dart gun UP and RIGHT");
return TRUE;
}
bool MoveDownLeft(){
printf("Move dart gun DOWN and LEFT");
return TRUE;
}
bool MoveDownRight(){
printf("Move dart gun DOWN and RIGHT");
return TRUE;
}
/*** END NERF GUN APPS ***/
/*** CAMERA MOVEMENT APPS ***/
// Camera movement
// sensitivity - sets the rate at which the camera moves up, down, left, or right
// up, down, left, right - by passing parameter as "true", the camera moves in that
// direction by a constant rate set by sensitivity.
void moveCamera(bool up, bool down, bool left, bool right, int sensitivity){
printf("Move camera: ");
if(up) printf("UP ");
if(down) printf("DOWN ");
if(left) printf("LEFT ");
if(right) printf("RIGHT ");
printf("with %d sensitivity",sensitivity);
}
//Starts and ends camera feed
// ID - id of the camera to start feed on
void startFeed(int ID){
printf("Start camera feed on camera with id: %d", ID);
}
void endFeed(int ID){
printf("End camera feed on camera with id: %d", ID);
}
/*** END CAMERA MOVEMENT APPS ***/
Last edited by swesson on Wed Feb 04, 2009 6:21 pm; edited 3 times in total
swesson- Posts : 28
Join date : 2009-01-09
Re: Camera/Nerf API
swesson wrote:Here's what I have for the camera/nerf API. Let me know if I'm a little closer to doing it right this time
- Code:
// ECE 453 - Spring 2009
// Communication group
// Camera/Nerf gun API
// Describes the application programming interface between the communication
// group and camera movement/nerf gun applications.
/*** NERF GUN APPS ***/
// Connects to nerf gun for aiming and firing functionality
// (returns true on success??)
bool Connect();
// Disconnect from nerf gun
// (returns true on success??)
bool Disconnect();
// Commands for aiming the nerf dart (Up, Down, Left, Right)
// (returns true on success??)
bool MoveUp();
bool MoveDown();
bool MoveLeft();
bool MoveRight();
// Commands for firing the nerf dart
// (returns true on success??)
bool Fire();
bool Stop(); // Not sure what this does, need to ask camera/nerf group
// Returns gun to zero (predefined starting position i.e. (0,0) coordinates)
bool ReturnToZero();
// Diagonal movement (May or may not be implemented)
bool MoveUpLeft();
bool MoveUpRight();
bool MoveDownLeft();
bool MoveDownRight();
/*** END NERF GUN APPS ***/
/*** CAMERA MOVEMENT APPS ***/
// Camera movement
// sensitivity - sets the rate at which the camera moves up, down, left, or right
// up, down, left, right - by passing parameter as "true", the camera moves in that
// direction by a constant rate set by sensitivity.
void moveCamera(bool up, bool down, bool left, bool right, int sensitivity);
// Initializes shared memory between nerf gun and camera
// key - shared memory ID
int *createShm(int key);
/*** END CAMERA MOVEMENT APPS ***/
I need your stub code and a final API for this group to be able to compile them all and turn them in.
try to finalize this API too.
The only other thing is to make sure these nerf/camera commands will be commands that the gui can actually call, if not the gui needs to have them in our API with the gui group.
For instance, does the gui group know about connect and disconnect or fire and stop?
dsmarsh- Posts : 54
Join date : 2009-01-08
Age : 38
Re: Camera/Nerf API
And make sure that you have checked and made sure that the cam/nerf group is ok with this API
dsmarsh- Posts : 54
Join date : 2009-01-08
Age : 38
Re: Camera/Nerf API
Connect and Disconnect should probably not be in this API. The GUI group sends us a command (for example, fire). Then we do the connection to the laptop internally to our group. Then, once the connection is established, we call the Fire() method that the gun group will write. If the software needs to connect to the gun first, the gun group will do that after fire is called. So, I think all connecting and disconnecting is internal to either our group or the gun group.
rbrenan- Posts : 19
Join date : 2009-01-08
Re: Camera/Nerf API
rbrenan wrote:Connect and Disconnect should probably not be in this API. The GUI group sends us a command (for example, fire). Then we do the connection to the laptop internally to our group. Then, once the connection is established, we call the Fire() method that the gun group will write. If the software needs to connect to the gun first, the gun group will do that after fire is called. So, I think all connecting and disconnecting is internal to either our group or the gun group.
We'll i think that we are just passing arguments, not doing anything but that.
As long as we keep it to that then we should be good.
dsmarsh- Posts : 54
Join date : 2009-01-08
Age : 38
Re: Camera/Nerf API
I this needed?// Initializes shared memory between nerf gun and camera
// key - shared memory ID
int *createShm(int key);
I think it should only be function we will actually call.
dsmarsh- Posts : 54
Join date : 2009-01-08
Age : 38
Re: Camera/Nerf API
If the initialization is going to be hardcoded, it wont be needed in our API. (I think)
Same thing for the connect and disconnect. I think I'll be meeting the camera/nerf group today at the time our class is scheduled to hammer out the details.
Same thing for the connect and disconnect. I think I'll be meeting the camera/nerf group today at the time our class is scheduled to hammer out the details.
swesson- Posts : 28
Join date : 2009-01-09
Re: Camera/Nerf API
OK
I think it will benefit us GREATLY if we don't have to keep track of things like connect and disconnect or initialize.
Because we would then have to keep count of bullets and hits and that's should be the GUI group not us.
Lets try and keep us to the network group, which means just passing commands and/or parameters (like brooks said).
again, if we have to worry about connect and disconnect then we will have to know when the game starts and shit will start rolling down hill....
I think it will benefit us GREATLY if we don't have to keep track of things like connect and disconnect or initialize.
Because we would then have to keep count of bullets and hits and that's should be the GUI group not us.
Lets try and keep us to the network group, which means just passing commands and/or parameters (like brooks said).
again, if we have to worry about connect and disconnect then we will have to know when the game starts and shit will start rolling down hill....
dsmarsh- Posts : 54
Join date : 2009-01-08
Age : 38
Re: Camera/Nerf API
Camera API part has been edited. Still waiting to hear back about the nerf connect and disconnect. Whats the deadline for the stub code? I have to go into work for a bit (until 4 or so), so I won't have it done until after that point.
swesson- Posts : 28
Join date : 2009-01-09
Re: Camera/Nerf API
I haven't heard about the connect or disconnect function, so I'm going to leave it in there as of now. I don't see it as a big deal, seeing as if the GUI group doesn't use it then we can just take it off the comm-to-camera/nerf API.
I'm working on the stub code now and i'll have it up soon.
I'm working on the stub code now and i'll have it up soon.
swesson- Posts : 28
Join date : 2009-01-09
Re: Camera/Nerf API
API is finished with stub code added to original post.
Lemme know if you find anything wrong.
Lemme know if you find anything wrong.
swesson- Posts : 28
Join date : 2009-01-09
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|