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

added support for laser.pkl if they exist #62

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
13 changes: 13 additions & 0 deletions python/pandaset/sensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ def _load_data_file(self, fp: str) -> None:


class Lidar(Sensor):
def load(self) -> None:
super().load()
self._load_laser()

@property
def _data_file_extension(self) -> str:
return 'pkl.gz'
Expand Down Expand Up @@ -225,6 +229,15 @@ def set_sensor(self, sensor_id: int) -> None:
def _load_data_file(self, fp: str) -> DataFrame:
return pd.read_pickle(fp)

def _load_laser(self):
lasers_file_location = f'{self._directory}/laser.pkl'
if not os.path.exists(lasers_file_location):
return
lasers = pd.read_pickle(lasers_file_location)

for laser, df in zip(lasers, self._data):
df.loc[df.index[df['d'] == 0], "laser"] = laser


class Camera(Sensor):
@property
Expand Down