-
Notifications
You must be signed in to change notification settings - Fork 81
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
Add jsk_rosbag_tools package #1738
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once we merge this package, we should update information at
http://wiki.ros.org/rosbag/Tutorials/Exporting%20image%20and%20video%20data
https://answers.ros.org/question/44777/how-to-extract-video-from-bag-file/
jsk_rosbag_tools/package.xml
Outdated
<?xml version="1.0"?> | ||
<package format="3"> | ||
<name>jsk_rosbag_tools</name> | ||
<version>0.0.1</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please set version to 2.2.1, all packages in a repository must have same version number
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed. Thank you.
|
||
|
||
# cv_bridge_python3 import | ||
if os.environ['ROS_PYTHON_VERSION'] == '3': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why
import sys, os; sys.path.insert(0,'/opt/ros/' + os.environ['ROS_DISTRO'] + '/lib/python3/dist-packages/')
import cv_bridge
from cv_bridge.boost.cv_bridge_boost import getCvType
did not work?
c.f. ros/rosdistro#32505 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I no longer need this import because I no longer use catkin virtualenv.
jsk_rosbag_tools/requirements.in
Outdated
@@ -0,0 +1,4 @@ | |||
moviepy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could specify version? to prevent install latest version which is not compatible with this source tree.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I no longer use catkin virtualenv. So, I add it to package.xml.
https://github.com/jsk-ros-pkg/jsk_common/blob/9b7b79ed30773e275fa8ebc0aab788248bfb80dd/jsk_rosbag_tools/package.xml
<launch> | ||
|
||
<test test-name="test_bag_to_video" pkg="jsk_rosbag_tools" type="test_jsk_rosbag_tools.py" | ||
time-limit="3600.0" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am afraid this test takes too long time, increasing the total test time of jsk_common
, could you consider shoulder version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I modified rosbag file to reduce test time.
Therefore, I changed the time-limit
to 360.0
.
jsk_rosbag_tools/CMakeLists.txt
Outdated
|
||
if (${catkin_virtualenv_VERSION} VERSION_LESS "0.6.1") | ||
message(WARNING "Please install catkin_virtualenv>=0.6.1.") | ||
message(WARNING "Current catkin_virtualen version is ${catkin_virtualenv_VERSION}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add return()
here??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I no longer use catkin virtualenv.
jsk_rosbag_tools/CMakeLists.txt
Outdated
INPUT_REQUIREMENTS requirements.in | ||
PYTHON_INTERPRETER python3 | ||
USE_SYSTEM_PACKAGES TRUE | ||
ISOLATE_REQUIREMENTS FALSE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just out of curiosity, why we set FALSE?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I no longer use catkin virtualenv.
jsk_rosbag_tools/CMakeLists.txt
Outdated
|
||
|
||
if(CATKIN_ENABLE_TESTING) | ||
find_package(catkin REQUIRED COMPONENTS catkin_virtualenv roslint rostest) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we need to set find catkin_virtualenv
and catkin_generate_vertualenv
, which is already set Line .19
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I no longer use catkin virtualenv.
BTW, what happens if we merge #1704 ?? @sktometometo @iory |
Thank you for this convenient features. I want to use Generating video after the demo with In this case, I thought it would be useful to import |
replaced_topic_name = topic_name | ||
replaced_topic_name = replaced_topic_name.replace('/', '--slash--') | ||
output_videopath = os.path.join( | ||
out, "{}.mp4".format(replaced_topic_name)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about adding an argument that specifies the name of the output file? (Same for other programs)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Modified
Thank you for your update. I found the following errors when executing bag_to_video.py with python 2.7.17
|
I would like to add this change to the documentation for many users. |
Nice! I have tested the Some thoughts:
as opposed to the more informative
|
Today's fetch go-to-kitchen demo, fetch cannot create good video from I reproduce this problem on my laptop, too. |
Thank you for your feedback.
I see. I think there are differences between
Having
Thanks! I added a messages on
The topic name may contain an underscore, so I'm doing this to restore the original topic name correctly. |
@708yamaguchi rviz--slash--image--slash--compressed.mp4 |
abce8c5
to
7d6bb9e
Compare
Test passed. Some people use this node in their projects. |
I am afraid this package installs a lot of pip dependences , so I prefer to use Just for note; |
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 re-enabled
I'll keep in mind. |
こちらのREADMEの方に書きました。 |
@iory ご対応くださりありがとうございます。READMEに十分な記述が加わったことを確認しました。 |
Thanks for merging. |
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