-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add list_pointcloud_topics function to retrieve PointCloud2 top…
…ics; update CHANGELOG and tests
- Loading branch information
Showing
6 changed files
with
87 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
from .dataset import Dataset | ||
from .io.dataset.topics import list_pointcloud_topics | ||
from .pointcloud import PointCloud | ||
|
||
__version__ = "0.10.0" | ||
|
||
__all__ = [ | ||
"Dataset", | ||
"PointCloud", | ||
"list_pointcloud_topics", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from pathlib import Path | ||
|
||
from rosbags.highlevel import AnyReader | ||
|
||
|
||
def list_pointcloud_topics(bagfile: Path) -> list[str]: | ||
"""Returns a list of all pointcloud topics in a ROS1 bagfile or a directory containing ROS2 mcap file.""" | ||
with AnyReader([bagfile]) as reader: | ||
all_topics = reader.topics | ||
|
||
return [k for k, v in all_topics.items() if v.msgtype == "sensor_msgs/msg/PointCloud2"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.