Skip to content

Update Readme To Make the Features of the Package Explicit. ros2bag2video.py only works with compressed image stream #37

@hakunaMatataHub

Description

@hakunaMatataHub

I am running Master branch with ros2 foxy, and trying to convert a color stream (image_raw) to mp4. Apparently this script only works for compressed images out of the box, you can modify the 'img = self.bridge.compressed_imgmsg_to_cv2(msg, self.msg_fmt)' to ' img = self.bridge.imgmsg_to_cv2(msg, self.msg_fmt)' in listner_callback function in the ros2bag2video.py executable. I further commented out the some code in the _playback_ros_bag function to make it compatible for non-compressed image stream, here is how it looks

 def _playback_ros_bag(self):
        print("Starting ROS bag playback...")
        process = subprocess.Popen(
            [
                "ros2",
                "bag",
                "play",
                self.bag_file,
                # "-r",
                # str(self.rate),
                # "--topics",
                # # HACK AJB Use this for SkateBot
                # # "/camera_node/image_raw/compressed",
                # # HACK AJB Use this for joeys.
                # "/je7c/camera/compressed",
            ]
        )
        return process
    P.S this will work for ros2 image_raw non compressed streams but it breaks the capability to set rate, and topic name by passing arguments to the script from cmd line. For my use case I was cool with the original fps and my bag had only one stream

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions