Skip to content
Snippets Groups Projects
Commit 9b6a336b authored by 488_MP-4's avatar 488_MP-4
Browse files

flushed filed

parent c54edc94
No related branches found
No related tags found
4 merge requests!104adding cflib to this branch,!103Updating develop to current state of master branch,!95Cflib groundstation,!94Merge cflib adapter into main
Showing
with 11 additions and 26 deletions
......@@ -134,19 +134,18 @@ class LogfileHandler:
self.data_log = open(self.data_log_name, 'a')
self.data_log.write("#Crazyflie\r")
self.data_log.write("#Controller:Unknown\r")
self.data_log.close()
self.data_log.flush()
def add_config_headers(self, config_list: List[LogConfig]):
self.header = []
self.header_id += 1
self.data_log = open(self.data_log_name, 'a')
header = "#" + str(self.header_id) + "\ttime"
for config in config_list:
for variable in config.variables:
header += "\t" + variable.name
self.header.append(variable.name)
self.data_log.write(header + "\r")
self.data_log.close()
self.data_log.flush()
......@@ -158,7 +157,6 @@ class LogfileHandler:
raise Exception
def write_data_points(self, data):
self.data_log = open(self.data_log_name, 'a')
line = str(data[0]['timestamp']) + "\t"
reorganize = [ 'nan' ] * 12
for point in data:
......@@ -176,7 +174,7 @@ class LogfileHandler:
line += "\t\r"
#print(line)
self.data_log.write(line)
self.data_log.close()
self.data_log.flush()
def logging_callback(self, _timestamp, data, _logconf):
""" Whenever data comes in from the logging, it is sent here,
......
......@@ -168,8 +168,8 @@ class SetpointHandler:
# scales thrust from 100 for slider control.
thrust = self.setpoint.thrust * 60000 / 100
print(f"Set attitude: {self.setpoint.yaw}, {self.setpoint.pitch}, "
f"{self.setpoint.roll}, {thrust}")
#print(f"Set attitude: {self.setpoint.yaw}, {self.setpoint.pitch}, "
# f"{self.setpoint.roll}, {thrust}")
self.commander.send_attitude_setpoint(
self.setpoint.yaw, self.setpoint.pitch, self.setpoint.roll,
......@@ -178,9 +178,9 @@ class SetpointHandler:
elif self._flight_mode == FlightMode.ATTITUDE_RATE_TYPE:
thrust = self.setpoint.thrust * 60000 / 100
print(f"Set attitude rate: {self.setpoint.yaw},"
f" {self.setpoint.pitch}, "
f"{self.setpoint.roll}, {thrust}")
#print(f"Set attitude rate: {self.setpoint.yaw},"
# f" {self.setpoint.pitch}, "
# f"{self.setpoint.roll}, {thrust}")
self.commander.send_attitude_rate_setpoint(
self.setpoint.yaw, self.setpoint.pitch, self.setpoint.roll,
......@@ -190,9 +190,9 @@ class SetpointHandler:
# scales thrust from 1000 for more fine-grained gamepad control.
thrust = self.setpoint.thrust * 60000 / 1000
print(f"Set mixed attitude: {self.setpoint.yaw},"
f" {self.setpoint.pitch}, "
f"{self.setpoint.roll}, {thrust}")
#print(f"Set mixed attitude: {self.setpoint.yaw},"
# f" {self.setpoint.pitch}, "
# f"{self.setpoint.roll}, {thrust}")
self.commander.send_mixed_attitude_setpoint(
self.setpoint.yaw, self.setpoint.pitch, self.setpoint.roll,
......
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
......@@ -138,7 +138,6 @@ class CrazyflieConnection:
raise Exception
if time == 0.0:
time = 0.1
print("Time: " + str(time))
if self.setpoint_handler.setpoint.pitch != pitch or self.setpoint_handler.setpoint.yaw != yaw or self.setpoint_handler.setpoint.roll != roll or self.setpoint_handler.setpoint.thrust != thrust:
self.setpoint_handler.setSetpoint(yaw, pitch, roll, thrust)
self.setpoint_handler.setpoint_time = time
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#Crazyflie #Controller:Unknown
\ No newline at end of file
#Crazyflie #Controller:Unknown
\ No newline at end of file
#Crazyflie #Controller:Unknown #0 time stateEstimate.roll stateEstimate.pitch stateEstimate.yaw
\ No newline at end of file
#Crazyflie #Controller:Unknown #0 time stateEstimate.roll stateEstimate.pitch stateEstimate.yaw
\ No newline at end of file
#Crazyflie #Controller:Unknown #0 time stateEstimate.roll stateEstimate.pitch stateEstimate.yaw
\ No newline at end of file
#Crazyflie #Controller:Unknown #0 time stateEstimate.roll stateEstimate.pitch stateEstimate.yaw
\ No newline at end of file
#Crazyflie #Controller:Unknown #0 time stateEstimate.roll stateEstimate.pitch stateEstimate.yaw
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment