Skip to content

Commit

Permalink
fix: avoid the case if transforms is None
Browse files Browse the repository at this point in the history
Signed-off-by: ktro2828 <[email protected]>
  • Loading branch information
ktro2828 committed May 14, 2024
1 parent 8c0f97b commit 340679a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion perception_eval/perception_eval/common/dataset_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def _sample_to_frame(
raise ValueError("lidar data isn't found")

object_boxes = _get_sample_boxes(nusc, sample_data_token, frame_id)
transforms = _get_transforms(nusc, sample_data_token, evaluation_task, label_converter.label_type)
transforms = _get_transforms(nusc, sample_data_token)
raw_data = _load_raw_data(nusc, sample_token) if load_raw_data else None

objects_: List[DynamicObject] = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,10 @@ def _is_target_object(
)
is_target = is_target and dynamic_object.semantic_score > confidence_threshold

if dynamic_object.state.position is not None:
if transforms is None and dynamic_object.frame_id == FrameID.BASE_LINK:
position_ = dynamic_object.state.position
bev_distance_ = dynamic_object.get_distance_bev()
elif dynamic_object.state.position is not None and transforms is not None:
position_ = transforms.transform((dynamic_object.frame_id, FrameID.BASE_LINK), dynamic_object.state.position)
bev_distance_ = dynamic_object.get_distance_bev(transforms)
else:
Expand Down

0 comments on commit 340679a

Please sign in to comment.