Skip to content

Commit

Permalink
style(pre-commit): autofix
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Jun 7, 2024
1 parent ff2fcfe commit 7acac74
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
from rosbag2_py import StorageFilter
from rosidl_runtime_py.utilities import get_message
from sensor_msgs.msg import PointCloud2
from utils import open_reader,get_starting_time
from utils import get_starting_time
from utils import open_reader


class PerceptionReplayerCommon(Node):
Expand Down Expand Up @@ -82,9 +83,13 @@ def __init__(self, args, name):
# load rosbag
print("Stared loading rosbag")
if os.path.isdir(args.bag):
bags = [ os.path.join(args.bag, base_name) for base_name in os.listdir(args.bag) if base_name.endswith(args.rosbag_format) ]
bags = [
os.path.join(args.bag, base_name)
for base_name in os.listdir(args.bag)
if base_name.endswith(args.rosbag_format)
]
for bag_file in sorted(bags, key=get_starting_time):
self.load_rosbag(bag_file)
self.load_rosbag(bag_file)
else:
self.load_rosbag(args.bag)
print("Ended loading rosbag")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@
from tf_transformations import euler_from_quaternion
from tf_transformations import quaternion_from_euler


def get_starting_time(uri: str):
info = rosbag2_py.Info().read_metadata(uri, "sqlite3")
return info.starting_time


def get_rosbag_options(path, serialization_format="cdr"):
storage_options = rosbag2_py.StorageOptions(uri=path, storage_id="sqlite3")

Expand Down

0 comments on commit 7acac74

Please sign in to comment.