grepros

grep for ROS bag files and live topics

Index
Installation
Using pip
Using apt
Using catkin
Using colcon
Dependencies
Using the program
Matching and filtering
Outputs
Command-line options
Plugins
Changelog

API documentation
View the Project on GitHub suurjaak/grepros

Installation

grepros is written in Python, supporting both Python 2 and Python 3.

Developed and tested under ROS1 Noetic and ROS2 Foxy,
works in later ROS2 versions (Galactic, Humble, Iron, and likewise Rolling);
also works in the earlier ROS1 version Melodic (lacking MCAP and Parquet support).

Using pip

pip install grepros

This will add the grepros command to path.

Requires ROS Python packages (ROS1: rospy, roslib, rosbag, genpy; ROS2: rclpy, rosidl_parser, rosidl_runtime_py, builtin_interfaces).

For ROS1, if only using bag files and no live topics, minimal ROS1 Python packages can also be installed separately with:

pip install rospy rosbag roslib roslz4 \
            --extra-index-url https://rospypi.github.io/simple/

Using apt

If ROS apt repository has been added to system:

sudo apt install ros-noetic-grepros  # ROS1 Noetic

sudo apt install ros-foxy-grepros    # ROS2 Foxy

This will add the grepros command to the global ROS1 / ROS2 environment.

Using catkin

In a ROS1 workspace, under the source directory:

git clone https://github.com/suurjaak/grepros.git
cd grepros
catkin build --this

This will add the grepros command to the local ROS1 workspace path.

Using colcon

In a ROS2 workspace, at the workspace root:

git clone https://github.com/suurjaak/grepros.git src/grepros
colcon build --packages-select grepros

This will add the grepros command to the local ROS2 workspace path.

Dependencies

grepros requires Python 3.8+ or Python 2.7, and the following 3rd-party Python packages: Optional, for decompressing archived bags: Optional, for faster reading of ROS1 bags: Optional, for Postgres output: Optional, for Parquet output: Optional, for MCAP input-output: Optional, for generating API documentation: All dependencies other than rospy/rclpy can be installed with:
pip install pyyaml six zstandard embag psycopg2 pandas pyarrow \
            mcap mcap_ros1_support mcap_ros2_support \
            git+https://github.com/Feneric/doxypypy