Commit c9435d35 authored by Ian McInerney's avatar Ian McInerney

Changed logging function to use get routines

parent a8aaba01
...@@ -86,11 +86,6 @@ int main(int argc, char **argv) { ...@@ -86,11 +86,6 @@ int main(int argc, char **argv) {
sleep(1); //***FOR TESTING PURPOSES*** (REMOVE) sleep(1); //***FOR TESTING PURPOSES*** (REMOVE)
signal(SIGINT, &ctrlc_handler); signal(SIGINT, &ctrlc_handler);
// init the tcp server that will transmit data to Eris
//TCPServer serv(erisIP, port, buffLen);
//serv.createSocket();
initMulticast();
// Initialize the crazyflie radios // Initialize the crazyflie radios
for (int i = 0; i < NUM_RADIOS; i++) { for (int i = 0; i < NUM_RADIOS; i++) {
...@@ -344,7 +339,7 @@ void closeoutProgram() { ...@@ -344,7 +339,7 @@ void closeoutProgram() {
// Turn off the crazyflies // Turn off the crazyflies
if ( crazyflie_info[i].cflieCopter->copterInRange() ) { if ( crazyflie_info[i].cflieCopter->copterInRange() ) {
// Only do this if the Crazyflies are in range and responding // Only do this if the Crazyflies are in range and responding
crazyflie_info[i].cflieCopter->setThrust(10000); crazyflie_info[i].cflieCopter->setBaseThrust( 0 );
crazyflie_info[i].cflieCopter->cycle(); crazyflie_info[i].cflieCopter->cycle();
cout << "Battery" << i << ": " << crazyflie_info[i].cflieCopter->batteryLevel() << endl; cout << "Battery" << i << ": " << crazyflie_info[i].cflieCopter->batteryLevel() << endl;
crazyflie_info[i].cflieCopter->cycle(); crazyflie_info[i].cflieCopter->cycle();
......
...@@ -89,16 +89,16 @@ void logging_WriteData( uint8_t quadNum) { ...@@ -89,16 +89,16 @@ void logging_WriteData( uint8_t quadNum) {
*logfile << endl; *logfile << endl;
// Print the time // Print the time
*logfile << quad->cflieCopter->currentTime() << "\t\t"; *logfile << cflieCopter->currentTime() << "\t\t";
// Print the battery // Print the battery
*logfile << "\t\t" << quad->cflieCopter->sensorDoubleValue("pm.vbat"); *logfile << "\t\t" << cflieCopter->batteryLevel();
// Print the setpoints // Print the setpoints
*logfile << "\t\t" << quad->controllerData.xSetpoint; *logfile << "\t\t" << cflieCopter->getSetpointX();
*logfile << "\t\t" << quad->controllerData.ySetpoint; *logfile << "\t\t" << cflieCopter->getSetpointY();
*logfile << "\t\t" << quad->controllerData.zSetpoint; *logfile << "\t\t" << cflieCopter->getSetpointZ();
*logfile << "\t\t" << quad->controllerData.yawSetpoint; *logfile << "\t\t" << cflieCopter->getSetpointYaw();
// Print the current position // Print the current position
*logfile << "\t\t" << cflieCopter->getCameraX(); *logfile << "\t\t" << cflieCopter->getCameraX();
...@@ -114,38 +114,38 @@ void logging_WriteData( uint8_t quadNum) { ...@@ -114,38 +114,38 @@ void logging_WriteData( uint8_t quadNum) {
*logfile << "\t\t" << cflieCopter->getCameraYaw(); *logfile << "\t\t" << cflieCopter->getCameraYaw();
// Print the sensor data // Print the sensor data
*logfile << "\t\t" << quad->cflieCopter->sensorDoubleValue("gyro.x"); *logfile << "\t\t" << cflieCopter->sensorDoubleValue("gyro.x");
*logfile << "\t\t" << quad->cflieCopter->sensorDoubleValue("gyro.y"); *logfile << "\t\t" << cflieCopter->sensorDoubleValue("gyro.y");
*logfile << "\t\t" << quad->cflieCopter->sensorDoubleValue("gyro.z"); *logfile << "\t\t" << cflieCopter->sensorDoubleValue("gyro.z");
*logfile << "\t\t" << quad->cflieCopter->sensorDoubleValue("accel.x"); *logfile << "\t\t" << cflieCopter->sensorDoubleValue("accel.x");
*logfile << "\t\t" << quad->cflieCopter->sensorDoubleValue("accel.y"); *logfile << "\t\t" << cflieCopter->sensorDoubleValue("accel.y");
*logfile << "\t\t" << quad->cflieCopter->sensorDoubleValue("accel.z"); *logfile << "\t\t" << cflieCopter->sensorDoubleValue("accel.z");
*logfile << "\t\t" << quad->cflieCopter->sensorDoubleValue("motor.m1"); *logfile << "\t\t" << cflieCopter->sensorDoubleValue("motor.m1");
*logfile << "\t\t" << quad->cflieCopter->sensorDoubleValue("motor.m2"); *logfile << "\t\t" << cflieCopter->sensorDoubleValue("motor.m2");
*logfile << "\t\t" << quad->cflieCopter->sensorDoubleValue("motor.m3"); *logfile << "\t\t" << cflieCopter->sensorDoubleValue("motor.m3");
*logfile << "\t\t" << quad->cflieCopter->sensorDoubleValue("motor.m4"); *logfile << "\t\t" << cflieCopter->sensorDoubleValue("motor.m4");
*logfile << "\t\t" << quad->cflieCopter->sensorDoubleValue("posCtlAlt.outz"); *logfile << "\t\t" << cflieCopter->sensorDoubleValue("posCtlAlt.outz");
*logfile << "\t\t" << quad->cflieCopter->sensorDoubleValue("posCtlAlt.outy"); *logfile << "\t\t" << cflieCopter->sensorDoubleValue("posCtlAlt.outy");
*logfile << "\t\t" << quad->cflieCopter->sensorDoubleValue("posCtlAlt.outz"); *logfile << "\t\t" << cflieCopter->sensorDoubleValue("posCtlAlt.outz");
*logfile << "\t\t" << quad->cflieCopter->sensorDoubleValue("pitchPID.output"); *logfile << "\t\t" << cflieCopter->sensorDoubleValue("pitchPID.output");
*logfile << "\t\t" << quad->cflieCopter->sensorDoubleValue("rollPID.output"); *logfile << "\t\t" << cflieCopter->sensorDoubleValue("rollPID.output");
*logfile << "\t\t" << quad->cflieCopter->sensorDoubleValue("yawPID.output"); *logfile << "\t\t" << cflieCopter->sensorDoubleValue("yawPID.output");
*logfile << "\t\t" << quad->cflieCopter->sensorDoubleValue("pitchRatePID.output"); *logfile << "\t\t" << cflieCopter->sensorDoubleValue("pitchRatePID.output");
*logfile << "\t\t" << quad->cflieCopter->sensorDoubleValue("rollRatePID.output"); *logfile << "\t\t" << cflieCopter->sensorDoubleValue("rollRatePID.output");
*logfile << "\t\t" << quad->cflieCopter->sensorDoubleValue("yawRatePID.output"); *logfile << "\t\t" << cflieCopter->sensorDoubleValue("yawRatePID.output");
*logfile << "\t\t" << quad->controllerData.baseThrust; *logfile << "\t\t" << cflieCopter->getBaseThrust();
*logfile << "\t\t" << quad->controllerData.resetController; *logfile << "\t\t" << quad->controllerData.resetController;
*logfile << "\t\t" << quad->cflieCopter->sensorDoubleValue("mixer.ctr_thrust"); *logfile << "\t\t" << cflieCopter->sensorDoubleValue("mixer.ctr_thrust");
*logfile << "\t\t" << quad->cflieCopter->sensorDoubleValue("mixer.ctr_roll"); *logfile << "\t\t" << cflieCopter->sensorDoubleValue("mixer.ctr_roll");
*logfile << "\t\t" << quad->cflieCopter->sensorDoubleValue("mixer.ctr_pitch"); *logfile << "\t\t" << cflieCopter->sensorDoubleValue("mixer.ctr_pitch");
*logfile << "\t\t" << quad->cflieCopter->sensorDoubleValue("mixer.ctr_yaw"); *logfile << "\t\t" << cflieCopter->sensorDoubleValue("mixer.ctr_yaw");
} }
......
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