Skip to content

Commit 86d9dc6

Browse files
lemonk3664fengqikai1414
authored andcommitted
add image_transport_plugins, support compressed and theora transport
1 parent e036817 commit 86d9dc6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+3321
-0
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
sudo: required
2+
dist: trusty
3+
language: generic
4+
env:
5+
- OPENCV_VERSION=2 ROS_DISTRO=indigo
6+
- OPENCV_VERSION=3 ROS_DISTRO=indigo
7+
- OPENCV_VERSION=2 ROS_DISTRO=jade
8+
- OPENCV_VERSION=3 ROS_DISTRO=jade
9+
# Install system dependencies, namely ROS.
10+
before_install:
11+
# Define some config vars.
12+
- export ROS_CI_DESKTOP=`lsb_release -cs` # e.g. [precise|trusty]
13+
- export CI_SOURCE_PATH=$(pwd)
14+
- export REPOSITORY_NAME=${PWD##*/}
15+
- export ROSINSTALL_FILE=$CI_SOURCE_PATH/dependencies.rosinstall
16+
- export CATKIN_OPTIONS=$CI_SOURCE_PATH/catkin.options
17+
- export ROS_PARALLEL_JOBS='-j8 -l6'
18+
# Install ROS
19+
- sudo sh -c "echo \"deb http://packages.ros.org/ros-shadow-fixed/ubuntu $ROS_CI_DESKTOP main\" > /etc/apt/sources.list.d/ros-latest.list"
20+
- wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
21+
- sudo apt-get update -qq
22+
# Install ROS
23+
- sudo apt-get install -y python-catkin-pkg python-catkin-tools python-rosdep python-wstool ros-$ROS_DISTRO-catkin
24+
- source /opt/ros/$ROS_DISTRO/setup.bash
25+
# Setup for rosdep
26+
- sudo rosdep init
27+
- rosdep update
28+
29+
# Create a catkin workspace with the package under test.
30+
install:
31+
- mkdir -p ~/catkin_ws/src
32+
33+
# Add the package under test to the workspace.
34+
- cd ~/catkin_ws/src
35+
- ln -s $CI_SOURCE_PATH . # Link the repo we are testing to the new workspace
36+
37+
- if [ $OPENCV_VERSION == 3 ]; then sed -i 's@libopencv-dev@opencv3@' $REPOSITORY_NAME/*/package.xml ; fi
38+
39+
# Install all dependencies, using wstool and rosdep.
40+
# wstool looks for a ROSINSTALL_FILE defined in before_install.
41+
before_script:
42+
# source dependencies: install using wstool.
43+
- cd ~/catkin_ws/src
44+
- wstool init
45+
- if [[ -f $ROSINSTALL_FILE ]] ; then wstool merge $ROSINSTALL_FILE ; fi
46+
- wstool up
47+
48+
# package depdencies: install using rosdep.
49+
- cd ~/catkin_ws
50+
- rosdep install -q -y -r --from-paths src --ignore-src --rosdistro $ROS_DISTRO
51+
52+
# Compile and test.
53+
script:
54+
- source /opt/ros/$ROS_DISTRO/setup.bash
55+
- cd ~/catkin_ws
56+
- catkin build -p1 -j1 --no-status
57+
- catkin run_tests -p1 -j1
58+
- catkin_test_results --all build
59+
- catkin clean -b --yes
60+
- catkin config --install
61+
- catkin build -p1 -j1 --no-status
62+
after_failure:
63+
- find ${HOME}/.ros/test_results -type f -exec echo "== {} ==" \; -exec cat {} \;
64+
- for file in ${HOME}/.ros/log/rostest-*; do echo "=== $file ==="; cat $file; done
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2+
Changelog for package compressed_depth_image_transport
3+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4+
5+
1.9.5 (2016-10-03)
6+
------------------
7+
* disable -Werr
8+
* Contributors: Vincent Rabaud
9+
10+
1.9.4 (2016-10-02)
11+
------------------
12+
* address gcc6 build error and tune
13+
With gcc6, compiling fails with `stdlib.h: No such file or directory`,
14+
as including '-isystem /usr/include' breaks with gcc6, cf.,
15+
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70129.
16+
This commit addresses this issue for this package in the same way
17+
it was addressed in various other ROS packages. A list of related
18+
commits and pull requests is at:
19+
https://github.com/ros/rosdistro/issues/12783
20+
Signed-off-by: Lukas Bulwahn <[email protected]>
21+
* Fix a missing return statement and add -Wall -Werror.
22+
* Contributors: Lukas Bulwahn, Mac Mason
23+
24+
1.9.3 (2016-01-17)
25+
------------------
26+
* Refactor the codec into its own .h and .cpp.
27+
* remove useless tf dependencies
28+
* Contributors: Mac Mason, Vincent Rabaud
29+
30+
1.9.2 (2015-04-25)
31+
------------------
32+
* use compression parameters for both depths
33+
fixes `#12 <https://github.com/ros-perception/image_transport_plugins/issues/12>`_
34+
* get code to compile with OpenCV3
35+
* Contributors: Vincent Rabaud
36+
37+
1.9.1 (2014-07-18)
38+
------------------
39+
40+
1.9.0 (2014-05-16)
41+
------------------
42+
43+
1.8.21 (2013-06-27)
44+
-------------------
45+
* maintainer: david gossow
46+
* Contributors: David Gossow
47+
48+
1.8.20 (2013-03-18)
49+
-------------------
50+
* 1.8.19 -> 1.8.20
51+
* Contributors: Julius Kammerl
52+
53+
1.8.19 (2013-02-24)
54+
-------------------
55+
* 1.8.18 -> 1.8.19
56+
* Contributors: Julius Kammerl
57+
58+
1.8.18 (2013-02-07 17:59)
59+
-------------------------
60+
* 1.8.17 -> 1.8.18
61+
* fixing input format checks (enabling rgba, bgra) + minor fixes
62+
* Contributors: Julius Kammerl
63+
64+
1.8.17 (2013-01-18)
65+
-------------------
66+
* 1.8.16 -> 1.8.17
67+
* Contributors: Julius Kammerl
68+
69+
1.8.16 (2013-01-17)
70+
-------------------
71+
* 1.8.15 -> 1.8.16
72+
* use the pluginlib script to remove some runtime warnings
73+
* Contributors: Julius Kammerl, Vincent Rabaud
74+
75+
1.8.15 (2012-12-28 20:11)
76+
-------------------------
77+
78+
1.8.14 (2012-12-28 20:02)
79+
-------------------------
80+
81+
1.8.13 (2012-12-28 19:06)
82+
-------------------------
83+
* fix the bad exports
84+
* make sure the plugins are visible by image_transport
85+
* added license headers to various cpp and h files
86+
* Contributors: Aaron Blasdel, Vincent Rabaud
87+
88+
1.8.12 (2012-12-19 19:30)
89+
-------------------------
90+
* fix downstream stuff in cmake
91+
* Contributors: Dirk Thomas
92+
93+
1.8.11 (2012-12-19 17:17)
94+
-------------------------
95+
* fix cmake order
96+
* Contributors: Dirk Thomas
97+
98+
1.8.10 (2012-12-19 17:03)
99+
-------------------------
100+
* fix dyn reconf
101+
* Contributors: Dirk Thomas
102+
103+
1.8.9 (2012-12-19 00:26)
104+
------------------------
105+
* switching to verion 1.8.9
106+
* Contributors: Julius Kammerl
107+
108+
1.8.8 (2012-12-17)
109+
------------------
110+
* adding build_deb on message_generation & mrun_deb on message_runtime
111+
* Updated package.xml for new buildtool_depend tag for catkin requirement
112+
* Contributors: Julius Kammerl, mirzashah
113+
114+
1.8.7 (2012-12-10 15:29)
115+
------------------------
116+
* adding missing tf build dependency
117+
* Contributors: Julius Kammerl
118+
119+
1.8.6 (2012-12-10 15:08)
120+
------------------------
121+
* switching to version 1.8.6
122+
* Contributors: Julius Kammerl
123+
124+
1.8.5 (2012-12-09)
125+
------------------
126+
* adding missing build debs
127+
* added class_loader_hide_library_symbols macros to CMakeList
128+
* switching to 1.8.5
129+
* Contributors: Julius Kammerl
130+
131+
1.8.4 (2012-11-30)
132+
------------------
133+
* switching to version 1.8.4
134+
* adding plugin.xml exports for pluginlib
135+
* catkinizing theora_image_transport
136+
* catkinizing compressed_depth_image_transport
137+
* github migration from code.ros.org (r40053)
138+
* Contributors: Julius Kammerl
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
cmake_minimum_required(VERSION 2.8.3)
2+
project(compressed_depth_image_transport)
3+
4+
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
5+
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror")
6+
endif()
7+
8+
find_package(OpenCV REQUIRED)
9+
find_package(catkin REQUIRED cv_bridge dynamic_reconfigure image_transport)
10+
11+
# generate the dynamic_reconfigure config file
12+
generate_dynamic_reconfigure_options(cfg/CompressedDepthPublisher.cfg)
13+
14+
catkin_package(
15+
INCLUDE_DIRS include
16+
LIBRARIES ${PROJECT_NAME}
17+
CATKIN_DEPENDS cv_bridge dynamic_reconfigure image_transport
18+
DEPENDS OpenCV
19+
)
20+
21+
include_directories(include ${catkin_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS})
22+
23+
add_library(${PROJECT_NAME} src/compressed_depth_publisher.cpp src/compressed_depth_subscriber.cpp src/manifest.cpp src/codec.cpp)
24+
add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}_gencfg)
25+
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} ${OpenCV_LIBRARIES})
26+
27+
class_loader_hide_library_symbols(${PROJECT_NAME})
28+
29+
install(TARGETS ${PROJECT_NAME}
30+
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
31+
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
32+
)
33+
install(DIRECTORY include/${PROJECT_NAME}/
34+
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
35+
)
36+
37+
# add xml file
38+
install(FILES compressed_depth_plugins.xml
39+
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
40+
)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#! /usr/bin/env python
2+
3+
PACKAGE='compressed_depth_image_transport'
4+
5+
from dynamic_reconfigure.parameter_generator_catkin import *
6+
7+
gen = ParameterGenerator()
8+
9+
gen.add("depth_max", double_t, 0, "Maximum depth value (meter) ", 10 , 1, 100)
10+
gen.add("depth_quantization", double_t, 0, "Depth value at which the sensor accuracy is 1 m (Kinect: >75)", 100, 1, 150)
11+
gen.add("png_level", int_t, 0, "PNG compression level", 9, 1, 9)
12+
13+
14+
exit(gen.generate(PACKAGE, "CompressedDepthPublisher", "CompressedDepthPublisher"))
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<library path="lib/libcompressed_depth_image_transport">
2+
<class name="image_transport/compressedDepth_pub" type="compressed_depth_image_transport::CompressedDepthPublisher" base_class_type="image_transport::PublisherPlugin">
3+
<description>
4+
This plugin publishes a compressed depth images using PNG compression.
5+
</description>
6+
</class>
7+
8+
<class name="image_transport/compressedDepth_sub" type="compressed_depth_image_transport::CompressedDepthSubscriber" base_class_type="image_transport::SubscriberPlugin">
9+
<description>
10+
This plugin decodes a compressed depth images.
11+
</description>
12+
</class>
13+
</library>
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/*********************************************************************
2+
* Software License Agreement (BSD License)
3+
*
4+
* Copyright (c) 2012, Willow Garage.
5+
* Copyright (c) 2016, Google, Inc.
6+
* All rights reserved.
7+
*
8+
* Redistribution and use in source and binary forms, with or without
9+
* modification, are permitted provided that the following conditions
10+
* are met:
11+
*
12+
* * Redistributions of source code must retain the above copyright
13+
* notice, this list of conditions and the following disclaimer.
14+
* * Redistributions in binary form must reproduce the above
15+
* copyright notice, this list of conditions and the following
16+
* disclaimer in the documentation and/or other materials provided
17+
* with the distribution.
18+
* * Neither the name of the Willow Garage nor the names of its
19+
* contributors may be used to endorse or promote products derived
20+
* from this software without specific prior written permission.
21+
*
22+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23+
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24+
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25+
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26+
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27+
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28+
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29+
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31+
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32+
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33+
* POSSIBILITY OF SUCH DAMAGE.
34+
*********************************************************************/
35+
36+
#include <opencv2/core/core.hpp>
37+
38+
#include "sensor_msgs/CompressedImage.h"
39+
#include "sensor_msgs/Image.h"
40+
#include "sensor_msgs/image_encodings.h"
41+
42+
// Encoding and decoding of compressed depth images.
43+
namespace compressed_depth_image_transport
44+
{
45+
46+
// Returns a null pointer on bad input.
47+
sensor_msgs::Image::Ptr decodeCompressedDepthImage(const sensor_msgs::CompressedImage& compressed_image);
48+
49+
// Compress a depth image. The png_compression parameter is passed straight through to
50+
// OpenCV as IMWRITE_PNG_COMPRESSION. Returns a null pointer on bad input.
51+
sensor_msgs::CompressedImage::Ptr encodeCompressedDepthImage(
52+
const sensor_msgs::Image& message,
53+
double depth_max,
54+
double depth_quantization,
55+
int png_level);
56+
57+
} // namespace compressed_depth_image_transport

0 commit comments

Comments
 (0)