Skip to content

Commit

Permalink
[jsk_rosbag_tools] Enable catkin_virtualenv for pip dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
iory committed Jun 30, 2022
1 parent a1786d1 commit fb24554
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 3 deletions.
1 change: 1 addition & 0 deletions jsk_rosbag_tools/.gitignore
@@ -1 +1,2 @@
!.gitignore
requirements.txt
31 changes: 29 additions & 2 deletions jsk_rosbag_tools/CMakeLists.txt
Expand Up @@ -3,14 +3,32 @@ project(jsk_rosbag_tools)

find_package(
catkin REQUIRED
catkin_virtualenv
)

if (${catkin_virtualenv_VERSION} VERSION_LESS "0.5.1")
message(STATUS "jsk_rosbag_tools requires catkin_virtualenv >= 0.5.1")
return()
endif()


catkin_python_setup()

catkin_package(
CATKIN_DEPENDS
)

if($ENV{ROS_DISTRO} STREQUAL "noetic")
catkin_generate_virtualenv(
INPUT_REQUIREMENTS requirements.in
PYTHON_INTERPRETER python3
)
else()
catkin_generate_virtualenv(
INPUT_REQUIREMENTS requirements.in
)
endif()

file(GLOB SCRIPTS_FILES scripts/*)
catkin_install_python(
PROGRAMS ${SCRIPTS_FILES}
Expand Down Expand Up @@ -47,10 +65,19 @@ if(CATKIN_ENABLE_TESTING)
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})

add_rostest(tests/test_jsk_rosbag_tools.test
DEPENDENCIES download_audio_data download_video_data)
DEPENDENCIES ${PROJECT_NAME}_generate_virtualenv download_audio_data download_video_data)
if("$ENV{ROS_DISTRO}" STRGREATER "indigo")
# could not install moviepy on indigo.
add_rostest(tests/test_bag_to_video.test
DEPENDENCIES download_audio_data download_video_data)
DEPENDENCIES ${PROJECT_NAME}_generate_virtualenv download_audio_data download_video_data)
endif()
endif()

install(DIRECTORY scripts samples
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
USE_SOURCE_PERMISSIONS
)

install(FILES requirements.txt
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
7 changes: 6 additions & 1 deletion jsk_rosbag_tools/package.xml
Expand Up @@ -11,10 +11,11 @@
<buildtool_depend>catkin</buildtool_depend>
<buildtool_depend>python-catkin-pkg-modules</buildtool_depend>

<build_depend version_gte="0.5.1">catkin_virtualenv</build_depend>

<exec_depend>audio_common_msgs</exec_depend>
<exec_depend>cv_bridge</exec_depend>
<exec_depend>ffmpeg</exec_depend>
<exec_depend>python-moviepy-pip</exec_depend>
<exec_depend condition="$ROS_PYTHON_VERSION == 2">python-numpy</exec_depend>
<exec_depend condition="$ROS_PYTHON_VERSION == 2">python-rospkg-modules</exec_depend>
<exec_depend condition="$ROS_PYTHON_VERSION == 2">python-scipy</exec_depend>
Expand All @@ -34,4 +35,8 @@
<test_depend>roslint</test_depend>
<test_depend>rostest</test_depend>

<export>
<pip_requirements>requirements.txt</pip_requirements>
</export>

</package>
1 change: 1 addition & 0 deletions jsk_rosbag_tools/requirements.in
@@ -0,0 +1 @@
moviepy==1.0.3
Empty file modified jsk_rosbag_tools/scripts/bag_to_audio.py 100755 → 100644
Empty file.
Empty file modified jsk_rosbag_tools/scripts/bag_to_video.py 100755 → 100644
Empty file.
Empty file modified jsk_rosbag_tools/scripts/compress_imgs.py 100755 → 100644
Empty file.
Empty file modified jsk_rosbag_tools/scripts/merge.py 100755 → 100644
Empty file.
Empty file modified jsk_rosbag_tools/scripts/tf_static_to_tf.py 100755 → 100644
Empty file.
Empty file modified jsk_rosbag_tools/scripts/video_to_bag.py 100755 → 100644
Empty file.
Empty file modified jsk_rosbag_tools/tests/test_bag_to_video.py 100755 → 100644
Empty file.
Empty file modified jsk_rosbag_tools/tests/test_jsk_rosbag_tools.py 100755 → 100644
Empty file.

0 comments on commit fb24554

Please sign in to comment.