Commit 5b3fc747 authored by JOSSOUD Olivier's avatar JOSSOUD Olivier
Browse files

Encoder. Lower the threshold to detect move-up events.

parent c9103f50
Pipeline #170341 failed with stage
in 1 minute and 17 seconds
......@@ -56,10 +56,10 @@ def get_moveup_events(encoder_df: pd.DataFrame,
``end_position`` (in mm) and ``event_type``.
"""
encoder_df = encoder_df.copy()
encoder_df["pos_diff"] = encoder_df["position"].diff()
encoder_df["pos_diff"] = -encoder_df["position"].diff(-1)
# Get the datetime of the start of each "encoder moves up" event
starts_df = encoder_df[encoder_df["pos_diff"] > 5]
starts_df = encoder_df[encoder_df["pos_diff"] > 2]
starts_df = starts_df.copy()
starts_df["diff"] = starts_df.index.to_series().diff().fillna(pd.Timedelta(days=100))
start_datetimes = starts_df[starts_df["diff"] > pd.Timedelta(seconds=5)].index.to_series()
......
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