Commit 8cf984dd authored by Ian McInerney's avatar Ian McInerney

Fixed some latent issues from the merge

parent 8562e694
......@@ -250,14 +250,6 @@ class CCrazyflie {
bool enableThrustController();
bool disableThrustController();
/**
* Modify if the thrust controller is active or not.
*
* @param enabled True to enable controller, false to disable
* @return True if packet received successfully
*/
bool modifyThrustController(bool enabled);
void setCameraPosition(lateralPosition cameraPosition);
void setCameraAngle(angularPosition cameraAngle);
void setCameraQuat(quaternionPosition cameraQuat);
......@@ -304,12 +296,6 @@ class CCrazyflie {
void setSetpointYaw(float setpoint);
void setBaseThrust(uint16_t thrust);
/**
* Enable or disable the thrust controller.
*/
bool enableThrustController();
bool disableThrustController();
/**
* Reset the controller on the quadcopter
*/
......
......@@ -74,6 +74,8 @@ CCrazyflie::CCrazyflie(CCrazyRadio *crRadio, int nRadioChannel, int quadNum, dou
std::cout << "Error opening console file for " << +(m_quadNum+1);
exit(-1);
}
this->queryControllerType();
}
CCrazyflie::~CCrazyflie() {
......
......@@ -4,6 +4,21 @@ int CCrazyflie::getControllerType() {
return controllerType;
}
std::string CCrazyflie::getControllerTypeString() {
switch (this->getControllerType() ) {
case 0:
return( "Controller:Bypassed" );
break;
case 1:
return( "Controller:PID" );
break;
case 2:
return( "Controller:LQR" );
break;
}
return( "Controller:Unknown" );
}
double CCrazyflie::batteryLevel() {
return this->sensorDoubleValue("pm.vbat");
}
......@@ -84,4 +99,4 @@ float CCrazyflie::getSetpointYaw() {
uint16_t CCrazyflie::getBaseThrust() {
return this->m_baseThrust;
}
\ No newline at end of file
}
......@@ -137,22 +137,6 @@ void parseCommand() {
case CMD_TAKEOFF:
// Configure the setpoints
<<<<<<< HEAD:groundstation-LateralOnQuad/userInput.cpp
SET_X(quadcopterNumber, crazyflie_info[quadcopterNumber-1].controllerData.xPosition);
SET_Y(quadcopterNumber, crazyflie_info[quadcopterNumber-1].controllerData.yPosition);
SET_Z(quadcopterNumber, defaultSetpoints[quadcopterNumber-1][2]);
// Initialize the quadcopter states
crazyflie_info[quadcopterNumber-1].controllerData.resetSent = false;
crazyflie_info[quadcopterNumber-1].takeoff.curStep = 0;
crazyflie_info[quadcopterNumber-1].takeoff.lastStepTime = crazyflie_info[quadcopterNumber-1].cflieCopter->currentTime();
crazyflie_info[quadcopterNumber-1].controllerData.baseThrust = crazyflie_info[quadcopterNumber-1].takeoff.profile[0];
// Disable the Z axis controller
crazyflie_info[quadcopterNumber-1].cflieCopter->disableThrustController();
// Set the flight mode
=======
SET_X(quadcopterNumber, crazyflie_info[quadcopterNumber-1].cflieCopter->getCameraX());
SET_Y(quadcopterNumber, crazyflie_info[quadcopterNumber-1].cflieCopter->getCameraY());
SET_Z(quadcopterNumber, defaultSetpoints[quadcopterNumber-1][2]);
......@@ -163,7 +147,6 @@ void parseCommand() {
crazyflie_info[quadcopterNumber-1].cflieCopter->resetController();
// Actually takeoff
>>>>>>> groundstationRefactor:groundstation-LateralOnQuad/src/userInput.cpp
SET_FLIGHTMODE(quadcopterNumber, TAKEOFF_MODE);
cout << "Crazyflie " << +quadcopterNumber << " Taking off" << endl;
break;
......@@ -253,4 +236,4 @@ void parseCommand() {
// Clear the command buffer
tempCmd[0] = 0;
}
\ No newline at end of file
}
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