Commit 24351cb6 authored by Ian McInerney's avatar Ian McInerney

Removed old bridge code

parent f0329052
......@@ -7,29 +7,9 @@
#include <math.h>
#include <quat.h>
enum bridge_landing_state {
NOT_CLOSE, // If the quadcopter is not even close
SAME_XY, // If the quadcopter is in the right X & Y position
LANDED // If the quadcopter has landed on the bridge
};
// Struct for the bridge position
struct bridge_Position {
float x;
float y;
float z;
float isSet;
enum bridge_landing_state landingState;
};
// Bridge position
extern struct bridge_Position bridge1;
extern struct bridge_Position bridge2;
// Function prototypes for the VRPN callback routines
void VRPN_CALLBACK handle_hand(void*, const vrpn_TRACKERCB t);
void VRPN_CALLBACK callbackBridge1(void*, const vrpn_TRACKERCB t);
void VRPN_CALLBACK callbackBridge2(void*, const vrpn_TRACKERCB t);
// Function prototypes for the trackable callbacks for the quadcopters
//void VRPN_CALLBACK handle_pos(void*, const vrpn_TRACKERCB t);
......
......@@ -10,44 +10,11 @@
using namespace std;
struct bridge_Position bridge1 = {};
struct bridge_Position bridge2 = {};
void processTrackableCallback(int crazyflieNum, int radioNum,
CONTROLLER_DATA_t *controllerData,
CCrazyflie *cflieCopter,
const vrpn_TRACKERCB t);
/*
* Callback for the bridge trackable
*/
void VRPN_CALLBACK callbackBridge1(void*, const vrpn_TRACKERCB t) {
// Set the position of the bridge trackable if it hasn't been set yet
if (bridge1.isSet == 0) {
bridge1.x = t.pos[0];
bridge1.y = t.pos[1];
bridge1.z = t.pos[2];
bridge1.isSet = 1;
cout << "Bridge 1 location: " << bridge1.x << ", " << bridge1.y << ", " << bridge1.z << "\r\n";
}
}
/*
*
*/
void VRPN_CALLBACK callbackBridge2(void*, const vrpn_TRACKERCB t) {
// Set the position of the bridge trackable if it hasn't been set yet
if (bridge2.isSet == 0) {
bridge2.x = t.pos[0];
bridge2.y = t.pos[1];
bridge2.z = t.pos[2];
bridge2.isSet = 1;
cout << "Bridge 2 location: " << bridge2.x << ", " << bridge2.y << ", " << bridge2.z << "\r\n";
}
}
/**
* The VRPN callback for the 1st quadcopter
*/
......@@ -190,7 +157,7 @@ void VRPN_CALLBACK handle_pos(void*, const vrpn_TRACKERCB t) {
/**
* The VRPN callback for the 2nd quadcopter
*/
void VRPN_CALLBACK handle_Crazyflie2(void*, const vrpn_TRACKERCB t) {
/*void VRPN_CALLBACK handle_Crazyflie2(void*, const vrpn_TRACKERCB t) {
// Pull out the X, Y, Z, Yaw position of the quadcopter
EXTRACT_POSITION(1, t);
......@@ -307,7 +274,7 @@ void VRPN_CALLBACK handle_Crazyflie2(void*, const vrpn_TRACKERCB t) {
crazyflie_info[1].cflieCopter,
t);
}
*/
/**
* The VRPN callback for the 2nd quadcopter
*/
......
......@@ -201,11 +201,6 @@ void parseCommand() {
break;
case CMD_BRIDGE_HOVER:
if (bridge1.isSet == 0 || bridge2.isSet == 0) {
cout << "Bridge not defined" << endl;
break;
}
// Determine where on the bridge to land
payload = atof(&cmd[2]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment