Skip to content

Conversation

@kugelrund
Copy link

Depends on this change donadigo/pygbx#11 in pygbx.

Copy link
Owner

@donadigo donadigo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments for now.

val >>= int32(8)
return -val

def clean_duplicate_events(events: list):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please annotate that this also returns list.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

"""
events_cleaned = []
for i in range(0, (len(events)-1)):
if int(events[i+1].time / 10) * 10 != int(events[i].time / 10) * 10:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens when there's events like this?

10000 Accelerate (1)
10000 Brake (1)
10010 Accelerate (0)

Is the first accelerate simply skipped?

Copy link
Author

@kugelrund kugelrund Jun 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good point. Reworked the function to skip over everything that is not a Steer event

val >>= int32(8)
return -val

def clean_duplicate_events(events: list):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

- Only clean steer events and leave other events completely untouched
- round up time to next 10 instead of midway rounding
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants