Skip to content

Commit 9304f84

Browse files
authored
Merge pull request #6 from pypose/fix-imu-source
Fix imu source
2 parents 0c01669 + 383a46d commit 9304f84

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

imu_source/imu_corrector_tutorial.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import matplotlib.pyplot as plt
3636
from matplotlib.patches import Ellipse
3737
from matplotlib.collections import PatchCollection
38+
from torchvision.datasets.utils import download_and_extract_archive
3839

3940
######################################################################
4041
# 1. Dataset Defination
@@ -61,8 +62,12 @@
6162
#
6263

6364
class KITTI_IMU(Data.Dataset):
64-
def __init__(self, root, dataname, drive, duration=10, step_size=1, mode='train'):
65+
datalink = 'https://github.com/pypose/pypose/releases/download/v0.2.2/2011_09_26.zip'
66+
def __init__(self, root, dataname, drive, duration=10, step_size=1, mode='train',
67+
download=True):
6568
super().__init__()
69+
if download:
70+
download_and_extract_archive(self.datalink, root)
6671
self.duration = duration
6772
self.data = pykitti.raw(root, dataname, drive)
6873
self.seq_len = len(self.data.timestamps) - 1

imu_source/imu_dataset_tutorial.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@
1010
import pypose as pp
1111
from datetime import datetime
1212
import torch.utils.data as Data
13-
13+
from torchvision.datasets.utils import download_and_extract_archive
1414

1515
class KITTI_IMU(Data.Dataset):
16-
def __init__(self, root, dataname, drive, duration=10, step_size=1, mode='train'):
16+
datalink = 'https://github.com/pypose/pypose/releases/download/v0.2.2/2011_09_26.zip'
17+
def __init__(self, root, dataname, drive, duration=10, step_size=1, mode='train',
18+
download=True):
1719
super().__init__()
20+
if download:
21+
download_and_extract_archive(self.datalink, root)
1822
self.duration = duration
1923
self.data = pykitti.raw(root, dataname, drive)
2024
self.seq_len = len(self.data.timestamps) - 1

imu_source/imu_integrator_tutorial.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
import matplotlib.pyplot as plt
5252
from matplotlib.patches import Ellipse
5353
from matplotlib.collections import PatchCollection
54+
from torchvision.datasets.utils import download_and_extract_archive
5455

5556

5657
######################################################################
@@ -78,8 +79,12 @@
7879
#
7980

8081
class KITTI_IMU(Data.Dataset):
81-
def __init__(self, root, dataname, drive, duration=10, step_size=1, mode='train'):
82+
datalink = 'https://github.com/pypose/pypose/releases/download/v0.2.2/2011_09_26.zip'
83+
def __init__(self, root, dataname, drive, duration=10, step_size=1, mode='train',
84+
download=True):
8285
super().__init__()
86+
if download:
87+
download_and_extract_archive(self.datalink, root)
8388
self.duration = duration
8489
self.data = pykitti.raw(root, dataname, drive)
8590
self.seq_len = len(self.data.timestamps) - 1

0 commit comments

Comments
 (0)