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

Transfer Process Doesn't Move Further #21

Open
wangzizhe opened this issue Jul 5, 2021 · 6 comments
Open

Transfer Process Doesn't Move Further #21

wangzizhe opened this issue Jul 5, 2021 · 6 comments

Comments

@wangzizhe
Copy link

Hi,

thanks for the code. I've run it, at first it ran smoothly. After some minutes the process doesn't move forward. I waited for 30 minutes and it doesn't get any update (frozen as the screenshot below).

image

Is that a problem or how long should I wait? The .bag file is 1.4 GB.

Thanks a lot in advance.

@kenkainkane
Copy link

I have the same problem

@innovation-x
Copy link

I have the same problem as well. Is this issue be solved now?

@innovation-x
Copy link

However, I run the ros2 bag2videos. It stuck like the figure below.
image

@wangzizhe
Copy link
Author

I don't think this problem has been solved... You'd better try other ways to transfer the files...

@innovation-x
Copy link

I see... Would you please share some methods for converting the rosbag .db3 files into .mp4 files?

@wangzizhe
Copy link
Author

I remember I used this code at that time and it worked perfect! Just create a python file and copy paste these codes into that file and modify the codes according to your own camera settings.

#!/usr/bin/python3
​
# general stuff
import cv2
import numpy as np
import time
import copy
import os
import math
​
# ros stuff
import rospy
from sensor_msgs.msg import Image
from cv_bridge import CvBridge
​
from datetime import datetime
​
# is used to convert ROS message into OpenCV structure
bridge = CvBridge()
# opencv video write object
# camera resolution is 2064x1544
out = cv2.VideoWriter('test.avi',cv2.VideoWriter_fourcc('M','J','P','G'), 30, (2064,1544))
​
def cbImg(msg):
    global bridge, out
    cv_image = bridge.imgmsg_to_cv2(msg, desired_encoding="bgr8")
    # image is flipped
    out.write(cv2.flip(cv_image, -1))
​
​
def main():
    global out
​
    rospy.init_node('video_writer', anonymous=True)
​
    #change comments for different topics
    rospy.Subscriber("/ximea_cam_left/image_raw", Image, cbImg, queue_size=1)
    # rospy.Subscriber("/ximea_cam_right/image_raw", Image, cbImg, queue_size=1)
​
    # spin() simply keeps python from exiting until this node is stopped
    rate = rospy.Rate(10)
    while not rospy.is_shutdown():
        rate.sleep()
​
    # end video write
    out.release()
​
    rospy.spin()
​
if __name__ == '__main__':
    main()

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

3 participants