Closed iory closed 2 years ago
BTW, what happens if we merge https://github.com/jsk-ros-pkg/jsk_common/pull/1704 ?? @sktometometo @iory
Thank you for this convenient features.
I want to use bag_to_video
feature at the end of daily go-to-kitchen demo.
Generating video after the demo with bag_to_video
, instead of during the demo with audio_video_recorder
, reduces fetch's CPU usage during the demo.
In this case, I thought it would be useful to import bag_to_video
as a python package.
How about achieving this feature by not using catkin_virtualenv?
Thank you for your update.
I found the following errors when executing bag_to_video.py with python 2.7.17
exist_ok=True
pip install -r requirements.txt
Once we merge this package, we should update information at
I would like to add this change to the documentation for many users.
Nice! I have tested the bag_to_video.py
node a bit and it worked great, with a few caveats (https://github.com/iory/jsk_common/pull/2)
Some thoughts:
video_to_bag.py
seems to have overlap with this node http://wiki.ros.org/movie_publisher#movie_to_bag
We have some raise Exception
with no arguments, which can lead to very hard-to-read bugs. Maybe consider adding an error message to them?
For example in https://github.com/iory/jsk_common/blob/rosbag-tools/jsk_rosbag_tools/python/jsk_rosbag_tools/makedirs.py#L30 I got
Traceback (most recent call last):
File "/home/affonso/jsk_common_ws/src/jsk_common/jsk_rosbag_tools/scripts/bag_to_video.py", line 57, in <module>
main()
File "/home/affonso/jsk_common_ws/src/jsk_common/jsk_rosbag_tools/scripts/bag_to_video.py", line 53, in main
audio_topic=args.audio_topic)
File "/home/affonso/jsk_common_ws/src/jsk_common/jsk_rosbag_tools/python/jsk_rosbag_tools/bag_to_video.py", line 84, in bag_to_video
makedirs(osp.dirname(output_filepath))
File "/home/affonso/jsk_common_ws/src/jsk_common/jsk_rosbag_tools/python/jsk_rosbag_tools/makedirs.py", line 30, in makedirs
raise OSError
OSError
as opposed to the more informative OSError: [Errno 2] No such file or directory: ''
Why --slash--
instead of normal underscores in https://github.com/iory/jsk_common/blob/rosbag-tools/jsk_rosbag_tools/python/jsk_rosbag_tools/topic_name_utils.py#L6 ???
Today's fetch go-to-kitchen demo, fetch cannot create good video from /rviz/image/compressed
..
Fetch kitchen patrol demo: 2022/06/04 (09:55:10)
I reproduce this problem on my laptop, too.
This is the link to the rosbag file. (I manually extracted /rviz/image/compressed
, so this rosbag file has only one topic).
https://drive.google.com/file/d/1x2bnU8S_XWoeuMNJGbJHBPTD3STE1DAt/view?usp=sharing
Thank you for your feedback.
video_to_bag.py seems to have overlap with this node http://wiki.ros.org/movie_publisher#movie_to_bag
I see. I think there are differences between video_to_bag.py
and movie_to_bag
video_to_bag.py
don't need roscore.
movie_to_bag
don't put audio in a bag file.
movie_to_bag
(https://github.com/peci1/movie_publisher/blob/melodic-devel/scripts/movie_to_bag) is a shell script.
Having video_to_bag.py
in jsk_rosbag_tools has the advantage of being at least easier for jsk users to recognize and maintain it.
We have some raise Exception with no arguments, which can lead to very hard-to-read bugs. Maybe consider adding an error message to them?
Thanks! I added a messages on raise
.
Why --slash-- instead of normal underscores in https://github.com/iory/jsk_common/blob/rosbag-tools/jsk_rosbag_tools/python/jsk_rosbag_tools/topic_name_utils.py#L6 ???
The topic name may contain an underscore, so I'm doing this to restore the original topic name correctly.
@708yamaguchi Thanks for your feedback! This problem occurs when the image size changes. I fixed it with this commit. https://github.com/jsk-ros-pkg/jsk_common/pull/1738/commits/ce184eef89c496af876dddfc8b34b36bb858117e
https://user-images.githubusercontent.com/4690682/172870185-7554f4cf-de02-43c6-97dd-9fd5236719fd.mp4
Test passed. Could someone review this PR?
Some people use this node in their projects. https://github.com/jsk-ros-pkg/jsk_recognition/pull/2703 @nakane11 https://github.com/knorth55/jsk_common/pull/11 @708yamaguchi @tkmtnt7000
I am afraid this package installs a lot of pip dependences , so I prefer to use catkin_virtualenv
, please re-consider using that . If so, I am happy with merging this PR
https://github.com/Zulko/moviepy/blob/18e9f57d1abbae8051b9aef75de3f19b4d1f0630/setup.py#L74-L92
Just for note; The packages is valid only when you show some results which is not achieved without the proposed feature. I am looking for RSJ papers that uses audio-visual information.
tf_static_to_tf.py とhttps://github.com/jsk-ros-pkg/jsk_common/blob/master/jsk_topic_tools/scripts/static_tf_republisher.py は一長一短があるので適切な使い分けが必要ですが、別の場所に置いてあるので片方を見つけられなそうです。2つを同じ場所に置くか、類似のソフトウェアがあることをドキュメントに書いておくことはできますでしょうか。
I am afraid this package installs a lot of pip dependences , so I prefer to use catkin_virtualenv, please re-consider using that . If so, I am happy with merging this PR
I re-enabled catkin-virtualenv
. https://github.com/jsk-ros-pkg/jsk_common/pull/1738/commits/fb24554d4519b3d090a5bdfefbbbf0db41c5822c
Just for note; The packages is valid only when you show some results which is not achieved without the proposed feature. I am looking for RSJ papers that uses audio-visual information.
I'll keep in mind.
@Naoki-Hiraoka
tf_static_to_tf.py とhttps://github.com/jsk-ros-pkg/jsk_common/blob/master/jsk_topic_tools/scripts/static_tf_republisher.py は一長一短があるので適切な使い分けが必要ですが、別の場所に置いてあるので片方を見つけられなそうです。2つを同じ場所に置くか、類似のソフトウェアがあることをドキュメントに書いておくことはできますでしょうか。
こちらのREADMEの方に書きました。 https://github.com/jsk-ros-pkg/jsk_common/pull/1738/commits/007febbbb94b5167322c1321408e6be7c62555bd 確認よろしくお願いします。
@iory ご対応くださりありがとうございます。READMEに十分な記述が加わったことを確認しました。
Thanks for merging. I updated the documents in ROS community. https://answers.ros.org/question/44777/how-to-extract-video-from-bag-file/?answer=403176#post-id-403176 http://wiki.ros.org/rosbag/Tutorials/Exporting%20image%20and%20video%20data#Converting_images_in_rosbag_into_an_Video_using_jsk_rosbag_tools
What is this?
Add
jsk_rosbag_tools
package which tools such as creating video from rosbag and compressing rosbag images.bag_to_video.py
Create video from rosbag.
Usage
Example
bag_to_audio.py
Create audio file from rosbag.
Usage
Example
video_to_bag.py
Convert video file to bagfile.
Usage
Example
compress_imgs.py
Convert
Image
messages toCompressedImage
orCompressedDepthImage
.Usage
Example
tf_static_to_tf.py
Convert tf_static to tf and save it as a rosbag.
Example
merge.py
Merges two bagfiles.
Usage
Example