Commit 69a57918 authored by Ian McInerney's avatar Ian McInerney

Added intializers to fix some Valgrind issues

parent 629a10fc
......@@ -48,19 +48,52 @@ CCrazyflie::CCrazyflie(CCrazyRadio *crRadio, int nRadioChannel, int quadNum, dou
m_fYaw = 0;
m_nThrust = 0;
// Initialize the sending stuff
m_sendSetpoints = false;
m_sendPosition = false;
// Initialize the log and parameters
m_tocParameters = new CTOC(m_crRadio, this, nRadioChannel, 2);
m_tocLogs = new CTOC(m_crRadio, this, nRadioChannel, 5);
// Initialize the ACK miss stuff
m_nAckMissCounter = 0;
m_nAckMissTolerance = 0;
// Initalize the cycle state
m_enumState = STATE_ZERO;
m_dSendSetpointPeriod = 0.01; // Seconds
m_dSetpointLastSent = 0;
// Initialize the positions
m_currentCameraPosition.x = 0;
m_currentCameraPosition.y = 0;
m_currentCameraPosition.z = 0;
m_currentCameraAngle.roll = 0;
m_currentCameraAngle.pitch = 0;
m_currentCameraAngle.yaw = 0;
m_currentCameraQuat.q0 = 0;
m_currentCameraQuat.q1 = 0;
m_currentCameraQuat.q2 = 0;
m_currentCameraQuat.q3 = 1;
// Initialize the setpoints
m_desiredPosition.x = 0;
m_desiredPosition.y = 0;
m_desiredPosition.z = 0;
m_desiredYaw = 0;
m_baseThrust = 0;
// Set the default flight mode to grounded
m_enumFlightMode = GROUNDED_MODE;
// Initialize the takeoff stuff
takeoffProfile = NULL;
numTakeoffSteps = 0;
currentStep = 0;
lastStepTime = 0;
m_startTime = startTime;
m_bufferEnd = 0;
......@@ -250,3 +283,4 @@ bool CCrazyflie::isInitialized() {
enum State CCrazyflie::getCurrentState() {
return this->m_enumState;
}
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