ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Ferguth's profile - activity

2019-11-15 03:44:32 -0500 received badge  Famous Question (source)
2019-11-15 03:44:32 -0500 received badge  Notable Question (source)
2019-10-15 03:59:06 -0500 received badge  Famous Question (source)
2019-04-08 07:53:23 -0500 received badge  Notable Question (source)
2019-02-14 03:01:12 -0500 edited question depth data retrieved by image_transport has confusing format

depth data retrieved by image_transport has confusing format OS: Ubuntu 16.04 LTS ROS distro: kinetic Hey, I am rea

2019-02-14 02:02:15 -0500 received badge  Popular Question (source)
2019-02-13 09:26:37 -0500 edited question depth data retrieved by image_transport has confusing format

depth data retrieved by image_transport has confusing format OS: Ubuntu 16.04 LTS ROS distro: kinetic Hey, I am rea

2019-02-13 09:19:09 -0500 edited question depth data retrieved by image_transport has confusing format

depth data retrieved by image_transport has confusing format OS: Ubuntu 16.04 LTS ROS distro: kinetic Hey, I am rea

2019-02-13 09:19:09 -0500 received badge  Editor (source)
2019-02-13 09:14:39 -0500 commented answer depth data retrieved by image_transport has confusing format

Thank you for your responses! I update my post.

2019-02-08 08:46:51 -0500 asked a question depth data retrieved by image_transport has confusing format

depth data retrieved by image_transport has confusing format OS: Ubuntu 16.04 LTS ROS distro: kinetic Hey, I am readi

2019-02-07 10:19:26 -0500 received badge  Popular Question (source)
2019-02-07 08:24:09 -0500 commented answer decompress jpeg depth data

Thank you, subscribing to the compressed topic was wrong.

2019-02-07 08:22:05 -0500 marked best answer decompress jpeg depth data
  • OS: Ubuntu 16.04 LTS
    • ROS distro: kinetic

Hey, I am using an old Microsoft Kienct camera and freenect for publishing the data.

Subscribing to the topic "/camera/depth_registered/image_raw/compressed", the format of the recieved message of type CompressedImage is 16UC1; jpeg compressed.

Question: How can I decompress the jpeg data to get my 16UC1 encoded depth data? It doesn't matter if ropsy or roscpp.

EDIT:

I tried using image_transport. It works when subscribing to a topic with message type /Image, like /camera/depth_registered/image_raw/. Subscribing to a message of type /CompressedImage leads to a compiler error when running catkin_make.

My node:

#include <ros/ros.h>
#include <sensor_msgs/Image.h>
#include <sensor_msgs/CompressedImage.h>
#include <image_transport/image_transport.h>

void depthCallback(const sensor_msgs::CompressedImage::ConstPtr& msg)
  {
  sensor_msgs::CompressedImage image;
  image.data = msg->data;
  image.format = msg->format;
  int length = image.data.size();
  ROS_INFO("Data:[%i]", length);
  }

int main(int argc, char **argv)
  {
  ros::init(argc, argv, "depth");
  ros::NodeHandle nh;
  image_transport::ImageTransport it(nh);
  image_transport::Subscriber sub = it.subscribe("/camera/depth_registered/image_raw/compressed", 1, depthCallback);
  ros::spin();

  return 0;
  }

the error message when compiling:

gtcc1@gtcc1-Latitude-E5520:~/catkin_gunnar_ws$ catkin_make
Base path: /home/gtcc1/catkin_gunnar_ws
Source space: /home/gtcc1/catkin_gunnar_ws/src
Build space: /home/gtcc1/catkin_gunnar_ws/build
Devel space: /home/gtcc1/catkin_gunnar_ws/devel
Install space: /home/gtcc1/catkin_gunnar_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/gtcc1/catkin_gunnar_ws/build"
####
####
#### Running command: "make -j4 -l4" in "/home/gtcc1/catkin_gunnar_ws/build"
####
Scanning dependencies of target depth
[ 50%] Building CXX object depth_node/CMakeFiles/depth.dir/src/depth.cpp.o
In file included from /usr/include/boost/function/detail/maybe_include.hpp:18:0,
                 from /usr/include/boost/function/detail/function_iterate.hpp:14,
                 from /usr/include/boost/preprocessor/iteration/detail/iter/forward1.hpp:52,
                 from /usr/include/boost/function.hpp:64,
                 from /opt/ros/kinetic/include/ros/forwards.h:40,
                 from /opt/ros/kinetic/include/ros/common.h:37,
                 from /opt/ros/kinetic/include/ros/ros.h:43,
                 from /home/gtcc1/catkin_gunnar_ws/src/depth_node/src/depth.cpp:1:
/usr/include/boost/function/function_template.hpp: In instantiation of ‘static void boost::detail::function::void_function_invoker1<FunctionPtr, R, T0>::invoke(boost::detail::function::function_buffer&, T0) [with FunctionPtr = void (*)(const boost::shared_ptr<const sensor_msgs::CompressedImage_<std::allocator<void> > >&); R = void; T0 = const boost::shared_ptr<const sensor_msgs::Image_<std::allocator<void> > >&]’:
/usr/include/boost/function/function_template.hpp:940:38:   required from ‘void boost::function1<R, T1>::assign_to(Functor) [with Functor = void (*)(const boost::shared_ptr<const sensor_msgs::CompressedImage_<std::allocator<void> > >&); R = void; T0 = const boost::shared_ptr<const sensor_msgs::Image_<std::allocator<void> > >&]’
/usr/include/boost/function/function_template.hpp:728:7:   required from ‘boost::function1<R, T1>::function1(Functor, typename boost::enable_if_c<boost::type_traits::ice_not<boost::is_integral<Functor>::value>::value, int>::type) [with Functor = void (*)(const boost::shared_ptr<const sensor_msgs::CompressedImage_<std::allocator<void> > >&); R = void; T0 = const boost::shared_ptr<const sensor_msgs::Image_<std::allocator<void> > >&; typename boost::enable_if_c<boost::type_traits::ice_not<boost::is_integral<Functor>::value>::value, int>::type = int]’
/usr/include/boost/function/function_template.hpp:1077:16:   required from ‘boost::function<R ...
(more)
2019-02-07 08:22:05 -0500 received badge  Scholar (source)
2019-02-07 08:21:56 -0500 received badge  Supporter (source)
2019-02-07 08:01:13 -0500 commented question decompress jpeg depth data

Thanks for the response, I updated my post.

2019-02-07 08:00:34 -0500 edited question decompress jpeg depth data

decompress jpeg depth data OS: Ubuntu 16.04 LTS ROS distro: kinetic Hey, I am using an old Microsoft Kienct camera

2019-02-07 07:38:30 -0500 asked a question decompress jpeg depth data

decompress jpeg depth data OS: Ubuntu 16.04 LTS ROS distro: kinetic Hey, I am using an old Microsoft Kienct camera