Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hakunaMatataHub opened this issue Dec 28, 2023 · 1 comment

Comments

@hakunaMatataHub
Copy link

hakunaMatataHub commented Dec 28, 2023

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
@cardboardcode
Copy link
Collaborator

@hakunaMatataHub May I get your help to provide an example of a ROS 2 bag with compressed images and one without so I can reproduce the issue better?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants