Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
Custom_CrazyFlie_Software
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Distributed Autonomous Networked Control Lab
Custom_CrazyFlie_Software
Commits
c9435d35
Commit
c9435d35
authored
Apr 15, 2017
by
Ian McInerney
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed logging function to use get routines
parent
a8aaba01
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
36 deletions
+31
-36
groundstation-LateralOnQuad/src/crazyflieGroundStation.cpp
groundstation-LateralOnQuad/src/crazyflieGroundStation.cpp
+1
-6
groundstation-LateralOnQuad/src/logData.cpp
groundstation-LateralOnQuad/src/logData.cpp
+30
-30
No files found.
groundstation-LateralOnQuad/src/crazyflieGroundStation.cpp
View file @
c9435d35
...
...
@@ -86,11 +86,6 @@ int main(int argc, char **argv) {
sleep
(
1
);
//***FOR TESTING PURPOSES*** (REMOVE)
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
for
(
int
i
=
0
;
i
<
NUM_RADIOS
;
i
++
)
{
...
...
@@ -344,7 +339,7 @@ void closeoutProgram() {
// Turn off the crazyflies
if
(
crazyflie_info
[
i
].
cflieCopter
->
copterInRange
()
)
{
// Only do this if the Crazyflies are in range and responding
crazyflie_info
[
i
].
cflieCopter
->
set
Thrust
(
10000
);
crazyflie_info
[
i
].
cflieCopter
->
set
BaseThrust
(
0
);
crazyflie_info
[
i
].
cflieCopter
->
cycle
();
cout
<<
"Battery"
<<
i
<<
": "
<<
crazyflie_info
[
i
].
cflieCopter
->
batteryLevel
()
<<
endl
;
crazyflie_info
[
i
].
cflieCopter
->
cycle
();
...
...
groundstation-LateralOnQuad/src/logData.cpp
View file @
c9435d35
...
...
@@ -89,16 +89,16 @@ void logging_WriteData( uint8_t quadNum) {
*
logfile
<<
endl
;
// Print the time
*
logfile
<<
quad
->
cflieCopter
->
currentTime
()
<<
"
\t\t
"
;
*
logfile
<<
cflieCopter
->
currentTime
()
<<
"
\t\t
"
;
// Print the battery
*
logfile
<<
"
\t\t
"
<<
quad
->
cflieCopter
->
sensorDoubleValue
(
"pm.vbat"
);
*
logfile
<<
"
\t\t
"
<<
cflieCopter
->
batteryLevel
(
);
// Print the setpoints
*
logfile
<<
"
\t\t
"
<<
quad
->
controllerData
.
xSetpoint
;
*
logfile
<<
"
\t\t
"
<<
quad
->
controllerData
.
ySetpoint
;
*
logfile
<<
"
\t\t
"
<<
quad
->
controllerData
.
zSetpoint
;
*
logfile
<<
"
\t\t
"
<<
quad
->
controllerData
.
yawSetpoint
;
*
logfile
<<
"
\t\t
"
<<
cflieCopter
->
getSetpointX
()
;
*
logfile
<<
"
\t\t
"
<<
cflieCopter
->
getSetpointY
()
;
*
logfile
<<
"
\t\t
"
<<
cflieCopter
->
getSetpointZ
()
;
*
logfile
<<
"
\t\t
"
<<
cflieCopter
->
getSetpointYaw
()
;
// Print the current position
*
logfile
<<
"
\t\t
"
<<
cflieCopter
->
getCameraX
();
...
...
@@ -114,38 +114,38 @@ void logging_WriteData( uint8_t quadNum) {
*
logfile
<<
"
\t\t
"
<<
cflieCopter
->
getCameraYaw
();
// Print the sensor data
*
logfile
<<
"
\t\t
"
<<
quad
->
cflieCopter
->
sensorDoubleValue
(
"gyro.x"
);
*
logfile
<<
"
\t\t
"
<<
quad
->
cflieCopter
->
sensorDoubleValue
(
"gyro.y"
);
*
logfile
<<
"
\t\t
"
<<
quad
->
cflieCopter
->
sensorDoubleValue
(
"gyro.z"
);
*
logfile
<<
"
\t\t
"
<<
quad
->
cflieCopter
->
sensorDoubleValue
(
"accel.x"
);
*
logfile
<<
"
\t\t
"
<<
quad
->
cflieCopter
->
sensorDoubleValue
(
"accel.y"
);
*
logfile
<<
"
\t\t
"
<<
quad
->
cflieCopter
->
sensorDoubleValue
(
"accel.z"
);
*
logfile
<<
"
\t\t
"
<<
cflieCopter
->
sensorDoubleValue
(
"gyro.x"
);
*
logfile
<<
"
\t\t
"
<<
cflieCopter
->
sensorDoubleValue
(
"gyro.y"
);
*
logfile
<<
"
\t\t
"
<<
cflieCopter
->
sensorDoubleValue
(
"gyro.z"
);
*
logfile
<<
"
\t\t
"
<<
cflieCopter
->
sensorDoubleValue
(
"accel.x"
);
*
logfile
<<
"
\t\t
"
<<
cflieCopter
->
sensorDoubleValue
(
"accel.y"
);
*
logfile
<<
"
\t\t
"
<<
cflieCopter
->
sensorDoubleValue
(
"accel.z"
);
*
logfile
<<
"
\t\t
"
<<
quad
->
cflieCopter
->
sensorDoubleValue
(
"motor.m1"
);
*
logfile
<<
"
\t\t
"
<<
quad
->
cflieCopter
->
sensorDoubleValue
(
"motor.m2"
);
*
logfile
<<
"
\t\t
"
<<
quad
->
cflieCopter
->
sensorDoubleValue
(
"motor.m3"
);
*
logfile
<<
"
\t\t
"
<<
quad
->
cflieCopter
->
sensorDoubleValue
(
"motor.m4"
);
*
logfile
<<
"
\t\t
"
<<
cflieCopter
->
sensorDoubleValue
(
"motor.m1"
);
*
logfile
<<
"
\t\t
"
<<
cflieCopter
->
sensorDoubleValue
(
"motor.m2"
);
*
logfile
<<
"
\t\t
"
<<
cflieCopter
->
sensorDoubleValue
(
"motor.m3"
);
*
logfile
<<
"
\t\t
"
<<
cflieCopter
->
sensorDoubleValue
(
"motor.m4"
);
*
logfile
<<
"
\t\t
"
<<
quad
->
cflieCopter
->
sensorDoubleValue
(
"posCtlAlt.outz"
);
*
logfile
<<
"
\t\t
"
<<
quad
->
cflieCopter
->
sensorDoubleValue
(
"posCtlAlt.outy"
);
*
logfile
<<
"
\t\t
"
<<
quad
->
cflieCopter
->
sensorDoubleValue
(
"posCtlAlt.outz"
);
*
logfile
<<
"
\t\t
"
<<
cflieCopter
->
sensorDoubleValue
(
"posCtlAlt.outz"
);
*
logfile
<<
"
\t\t
"
<<
cflieCopter
->
sensorDoubleValue
(
"posCtlAlt.outy"
);
*
logfile
<<
"
\t\t
"
<<
cflieCopter
->
sensorDoubleValue
(
"posCtlAlt.outz"
);
*
logfile
<<
"
\t\t
"
<<
quad
->
cflieCopter
->
sensorDoubleValue
(
"pitchPID.output"
);
*
logfile
<<
"
\t\t
"
<<
quad
->
cflieCopter
->
sensorDoubleValue
(
"rollPID.output"
);
*
logfile
<<
"
\t\t
"
<<
quad
->
cflieCopter
->
sensorDoubleValue
(
"yawPID.output"
);
*
logfile
<<
"
\t\t
"
<<
cflieCopter
->
sensorDoubleValue
(
"pitchPID.output"
);
*
logfile
<<
"
\t\t
"
<<
cflieCopter
->
sensorDoubleValue
(
"rollPID.output"
);
*
logfile
<<
"
\t\t
"
<<
cflieCopter
->
sensorDoubleValue
(
"yawPID.output"
);
*
logfile
<<
"
\t\t
"
<<
quad
->
cflieCopter
->
sensorDoubleValue
(
"pitchRatePID.output"
);
*
logfile
<<
"
\t\t
"
<<
quad
->
cflieCopter
->
sensorDoubleValue
(
"rollRatePID.output"
);
*
logfile
<<
"
\t\t
"
<<
quad
->
cflieCopter
->
sensorDoubleValue
(
"yawRatePID.output"
);
*
logfile
<<
"
\t\t
"
<<
cflieCopter
->
sensorDoubleValue
(
"pitchRatePID.output"
);
*
logfile
<<
"
\t\t
"
<<
cflieCopter
->
sensorDoubleValue
(
"rollRatePID.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
->
cflieCopter
->
sensorDoubleValue
(
"mixer.ctr_thrust"
);
*
logfile
<<
"
\t\t
"
<<
quad
->
cflieCopter
->
sensorDoubleValue
(
"mixer.ctr_roll"
);
*
logfile
<<
"
\t\t
"
<<
quad
->
cflieCopter
->
sensorDoubleValue
(
"mixer.ctr_pitch"
);
*
logfile
<<
"
\t\t
"
<<
quad
->
cflieCopter
->
sensorDoubleValue
(
"mixer.ctr_yaw"
);
*
logfile
<<
"
\t\t
"
<<
cflieCopter
->
sensorDoubleValue
(
"mixer.ctr_thrust"
);
*
logfile
<<
"
\t\t
"
<<
cflieCopter
->
sensorDoubleValue
(
"mixer.ctr_roll"
);
*
logfile
<<
"
\t\t
"
<<
cflieCopter
->
sensorDoubleValue
(
"mixer.ctr_pitch"
);
*
logfile
<<
"
\t\t
"
<<
cflieCopter
->
sensorDoubleValue
(
"mixer.ctr_yaw"
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment