Skip to content

Commit 781195e

Browse files
authored
Support mutli ID topics when checking for required topics (#206)
* Use id for required topics * Hot fix, use a different index for calculating flight time
1 parent b31ecf3 commit 781195e

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Tools/parametric_model/src/tools/data_handler.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,12 @@ def loadLogFile(self, rel_data_path):
122122
def check_ulog_for_req_topics(self, ulog):
123123
for topic_type in self.req_topics_dict.keys():
124124
try:
125-
topic_type_data = ulog.get_dataset(topic_type)
125+
topic_dict = self.req_topics_dict[topic_type]
126+
if "id" in topic_dict.keys():
127+
id = topic_dict["id"]
128+
topic_type_data = ulog.get_dataset(topic_type, id)
129+
else:
130+
topic_type_data = ulog.get_dataset(topic_type)
126131
except:
127132
print("Missing topic type: ", topic_type)
128133
exit(1)

Tools/parametric_model/src/tools/dataframe_tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def compute_flight_time(act_df, pwm_threshold=None, control_threshold=None):
5555

5656
if control_threshold is None:
5757
control_threshold = ACTUATOR_CONTROLS_THRESHOLD
58-
58+
act_df_crp = act_df[act_df.iloc[:, 2] > pwm_threshold]
5959
act_df_crp = act_df[act_df.iloc[:, 4] > pwm_threshold]
6060

6161
t_start = act_df_crp.iloc[1, 0]

0 commit comments

Comments
 (0)