Ask Your Question
0

is there a way for rviz to subscribe to topic of message typ sensor_msgs::ImagePtr?

asked 2018-03-26 16:22:30 -0500

chanhyeoni gravatar image

updated 2018-03-27 10:32:44 -0500

gvdhoorn gravatar image

For image, I know that the Image Topic must be of type sensor_msgs::Image, but is there any feature in Rviz that would subscribe to any topic whose message type is sensor_msgs::ImagePtr?


Edit: @gvdhoorn I have ELP Camera usb-connected to Jetson TX1, and there is the package that publishes the video feed. And I want my laptop, which is connected to the Jetson via Ethernet crossover cable, to subscribe the video feed data (whether it is sensor_msgs::Image or sensor_msgs::ImagePtr) through Rviz. My old code published the data of type sensor_msgs::Image but for some reason, Rviz stopped when I added the topic for video feed, and I had to restart it. Any techniques as to how I should handle this?

edit retag flag offensive close merge delete

Comments

Afaik ImagePtr is not a message type in sensor_msgs. It is only a type in the C++ code that gets generated by gencpp and then used in nodes that subscribe to sensor_msgs/Image. What are you trying to do exactly?

gvdhoorn gravatar imagegvdhoorn ( 2018-03-27 02:40:23 -0500 )edit

Publishing video/frames of a video could probably be done using sensor_msgs/Image directly but should preferably be done using image_transport. In all cases you wouldn't be publishing a ImagePtr, but an Image msg.

gvdhoorn gravatar imagegvdhoorn ( 2018-03-27 10:34:10 -0500 )edit

I see. Thanks for your help. So my next question is whether there has ever been a project that remotely transmits video feed from a device A to a device B using ROS.

chanhyeoni gravatar imagechanhyeoni ( 2018-03-27 11:02:12 -0500 )edit

Sure. All the time. It's not going to be the most efficient way to do it with sensor_msgs/Image, but it can be done.

Why do you ask?

gvdhoorn gravatar imagegvdhoorn ( 2018-03-27 11:02:57 -0500 )edit

I tried to find any example projects like that, and I couldn't. I tried to do this myself using all available sources, and I'm still stuck.

chanhyeoni gravatar imagechanhyeoni ( 2018-03-27 11:04:14 -0500 )edit

Wouldn't just about every camera driver do that?

What about the image_transport/Tutorials?

gvdhoorn gravatar imagegvdhoorn ( 2018-03-27 11:05:07 -0500 )edit

I thought so. But I guess, unlike mine, most camera-related projects I have examined are based on a single machine, so no one has ever experimented it in an environment with multiple connected machines. I should try with sensor_msgs::Compressed, which no one has ever tried with.

chanhyeoni gravatar imagechanhyeoni ( 2018-03-27 11:20:49 -0500 )edit

I'm rather confused: ROS is supposed to make multi-machine networks transparent and using a compressed transport with image_transport is also transparent to the node (ie configured outside the node).

Can you describe what makes your 'multi machine' setup different / difficult?

gvdhoorn gravatar imagegvdhoorn ( 2018-03-27 11:23:11 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-03-30 11:45:52 -0500

chanhyeoni gravatar image

I found the solution. The image_transport package was not fully installed; the plugins for type compressed and theora were not installed. So I built the remaining types from source, and it is working fine. I don't know why other plugins were not installed when they were supposed to be (e.g. when I typed the command sudo apt-get install ros-kinetic-image-transport)

edit flag offensive delete link more

Comments

I don't know why other plugins were not installed when they were supposed to be

As far as I can tell, image_transport_plugins is not a dependency of image_transport. So it would seem to be ok for them to not be installed.

gvdhoorn gravatar imagegvdhoorn ( 2018-03-30 12:01:29 -0500 )edit

So I built the remaining types from source

unless you are planning to work on the transport plugins, I would strongly recommend to not build those from source. Just install ros-kinetic-image-transport-plugins and things should work.

gvdhoorn gravatar imagegvdhoorn ( 2018-03-30 12:02:16 -0500 )edit

Thanks for your help. I removed the source from my catkin project and instead installed using commands. By the way, ros-kinetic-image-transport-plugins does not install the plugins. Rather, I used the command sudo apt-get install ros-<distro>-<type>-image-transport, and it is working fine.

chanhyeoni gravatar imagechanhyeoni ( 2018-03-30 12:40:35 -0500 )edit

That is rather strange, as ros-kinetic-image-transport-plugins is supposed to bring in all plugins. Its dependencies are exactly the plugins.

But if things work for you, then ok.

gvdhoorn gravatar imagegvdhoorn ( 2018-03-30 12:43:14 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-03-26 16:22:30 -0500

Seen: 160 times

Last updated: Mar 30 '18