Skip to content

Commit

Permalink
switch rosbags module to forked package and remove code
Browse files Browse the repository at this point in the history
  • Loading branch information
YvesSchoenberg committed Oct 27, 2023
1 parent 5b0f4c3 commit dafacfb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 70 deletions.
4 changes: 2 additions & 2 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "robologs-ros-utils"
version = "0.1.1a61"
version = "0.1.1a62"
description = "robologs-ros-utils is an open source library of containerized data transformations for the robotics and drone communities"
authors = ["roboto.ai <[email protected]>"]
license = "Apache-2.0"
Expand All @@ -12,8 +12,8 @@ numpy = "^1.23.1"
opencv-python = "^4.5.0.0"
tqdm = "^4.64.1"
bagpy = "^0.5"
rosbags = "^0.9.13"
click = "^8.1.3"
rosbags = { git = "https://github.com/roboto-ai/rosbags-fork", rev = "master" }
pydantic = "^1.10.2"
pytest = "^7.2.0"
Flask = "^2"
Expand Down
68 changes: 0 additions & 68 deletions python/robologs_ros_utils/sources/ros1/ros_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,74 +500,6 @@ def is_message_within_time_range(
return True, False


# def get_clipped_bag_file(
# input_bag_path: str,
# output_bag_path: str,
# topic_list: Optional[List[str]] = None,
# start_time: Optional[Union[float, int]] = None,
# end_time: Optional[Union[float, int]] = None,
# timestamp_type: str = "rosbag_ns",
# ) -> None:
# """
# Create a clipped rosbag file from an input bag, filtered by topic and time range.
#
# Args:
# input_bag_path (str): Path to the input rosbag file.
# output_bag_path (str): Path where the new clipped bag should be written.
# topic_list (Optional[List[str]]): List of string topics to be included in the clipped bag.
# start_time (Optional[Union[float, int]]): The start time from which to include messages.
# end_time (Optional[Union[float, int]]): The end time until which to include messages.
# timestamp_type (str): Type of the provided timestamps, "rosbag_ns" for nanoseconds and
# "offset_s" for seconds offset.
#
# Raises:
# Exception: If an invalid timestamp_type is provided.
#
# Returns:
# None
# """
#
# if timestamp_type not in ["rosbag_ns", "offset_s"]:
# raise Exception(f"Robologs: invalid timestamp_type parameter: {timestamp_type}")
#
# with Bag(output_bag_path, "w") as outbag:
# msg_counter = 0
# first_time_stamp = -1
# for topic, msg, t in Bag(input_bag_path).read_messages():
# if first_time_stamp < 0:
# first_time_stamp = t.to_nsec()
# if timestamp_type == "offset_s":
# if start_time:
# start_time = convert_offset_s_to_rosbag_ns(
# offset_s=start_time, first_rosbag_time_ns=first_time_stamp
# )
#
# if end_time:
# end_time = convert_offset_s_to_rosbag_ns(
# offset_s=end_time, first_rosbag_time_ns=first_time_stamp
# )
#
# if topic_list:
# if topic not in topic_list:
# continue
#
# in_time_range, past_end_time = is_message_within_time_range(
# time_ns=t.to_nsec(), start_time_rosbag_ns=start_time, end_time_rosbag_ns=end_time
# )
#
# # stop iterating over rosbag if we're past the user specified end-time
# if past_end_time:
# break
#
# if not in_time_range:
# continue
#
# msg_counter += 1
# outbag.write(topic, msg, t)
#
# return


def get_all_topics(rosbag_list: List[str]) -> List[str]:
"""
Retrieve all unique topics from a list of rosbag files.
Expand Down

0 comments on commit dafacfb

Please sign in to comment.