Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed uint32 OverflowError on Windows. #273

Merged
merged 1 commit into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/fusion_engine_client/analysis/data_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def to_numpy(self, remove_nan_times: bool = True):

if do_conversion:
self.__dict__.update(self.message_class.to_numpy(self.messages))
self.messages_bytes = np.array(self.messages_bytes, dtype=int)
self.messages_bytes = np.array(self.messages_bytes, dtype=np.uint64)
self.message_index = np.array(self.message_index, dtype=int)

if remove_nan_times and 'p1_time' in self.__dict__:
Expand Down
14 changes: 7 additions & 7 deletions python/fusion_engine_client/messages/measurements.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,10 +592,10 @@ def __str__(self):
@classmethod
def to_numpy(cls, messages):
result = {
'front_left_wheel_ticks': np.array([m.front_left_wheel_ticks for m in messages], dtype=int),
'front_right_wheel_ticks': np.array([m.front_right_wheel_ticks for m in messages], dtype=int),
'rear_left_wheel_ticks': np.array([m.rear_left_wheel_ticks for m in messages], dtype=int),
'rear_right_wheel_ticks': np.array([m.rear_right_wheel_ticks for m in messages], dtype=int),
'front_left_wheel_ticks': np.array([m.front_left_wheel_ticks for m in messages], dtype=np.uint32),
'front_right_wheel_ticks': np.array([m.front_right_wheel_ticks for m in messages], dtype=np.uint32),
'rear_left_wheel_ticks': np.array([m.rear_left_wheel_ticks for m in messages], dtype=np.uint32),
'rear_right_wheel_ticks': np.array([m.rear_right_wheel_ticks for m in messages], dtype=np.uint32),
'gear': np.array([m.gear for m in messages], dtype=int),
}
result.update(MeasurementDetails.to_numpy([m.details for m in messages]))
Expand Down Expand Up @@ -690,7 +690,7 @@ def __str__(self):
@classmethod
def to_numpy(cls, messages):
result = {
'tick_count': np.array([m.tick_count for m in messages], dtype=int),
'tick_count': np.array([m.tick_count for m in messages], dtype=np.uint32),
'gear': np.array([m.gear for m in messages], dtype=int),
}
result.update(MeasurementDetails.to_numpy([m.details for m in messages]))
Expand Down Expand Up @@ -1003,7 +1003,7 @@ def calcsize(cls) -> int:
def to_numpy(cls, messages: Sequence['HeadingOutput']):
result = {
'solution_type': np.array([int(m.solution_type) for m in messages], dtype=int),
'flags': np.array([int(m.flags) for m in messages], dtype=int),
'flags': np.array([int(m.flags) for m in messages], dtype=np.uint32),
'ypr_deg': np.array([m.ypr_deg for m in messages]).T,
'heading_true_north_deg': np.array([m.heading_true_north_deg for m in messages], dtype=float).T,
}
Expand Down Expand Up @@ -1122,7 +1122,7 @@ def calcsize(cls) -> int:
def to_numpy(cls, messages: Sequence['RawHeadingOutput']):
result = {
'solution_type': np.array([int(m.solution_type) for m in messages], dtype=int),
'flags': np.array([int(m.flags) for m in messages], dtype=int),
'flags': np.array([int(m.flags) for m in messages], dtype=np.uint32),
'relative_position_enu_m': np.array([m.relative_position_enu_m for m in messages]).T,
'position_std_enu_m': np.array([m.position_std_enu_m for m in messages]).T,
'heading_true_north_deg': np.array([float(m.heading_true_north_deg) for m in messages]),
Expand Down
2 changes: 1 addition & 1 deletion python/fusion_engine_client/messages/solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ def to_numpy(cls, messages):
'num_svs': np.array([int(m.num_svs) for m in messages], dtype=int),
'corrections_age_sec': np.array([m.corrections_age_sec for m in messages]),
'baseline_distance_m': np.array([m.baseline_distance_m for m in messages]),
'reference_station_id': np.array([int(m.reference_station_id) for m in messages], dtype=int),
'reference_station_id': np.array([int(m.reference_station_id) for m in messages], dtype=np.uint32),
'gdop': np.array([m.gdop for m in messages]),
'pdop': np.array([m.pdop for m in messages]),
'hdop': np.array([m.hdop for m in messages]),
Expand Down
Loading