Can't send a captured image from raspi4 to other machine.
Hi, I tried sending a captured image from raspi4 to other machine, using a uvc-camera.
The way to publish an image is following (used this ros2-node: https://index.ros.org/r/v4l2_camera/):
$ # run on raspberry-pi4
$ ROS_DOMAIN_ID=1
$ ros2 run v4l2_camera v4l2_camera_node
However couldn't send an image.
$ # run on other machine
$ ROS_DOMAIN_ID=1
$ ros2 topic list # confirm all topics
/camera_info
/image_raw
/image_raw/compressed
/image_raw/compressedDepth
/image_raw/theora
/parameter_events
/rosout
$ ros2 topic echo /image_raw # nothing happens if execute
-----
Though, could send a text in the same way.
$ ros2 topic pub /chatter std_msgs/String "data: Hello, World!!" # run on raspberry-pi4
$ ros2 topic echo /chatter # run on other machine
data: Hello, World
---
data: Hello, World
---
...
What do you think is the cause?
Looks like your
ros2 topic echo /image_raw
is not returning any message. Could you make sure your sensor_msgs/Image messages are properly being published to the /image_raw topic? It should at least show the intensity values if not images.Thank you for your answer!
At least I can see
/image_raw
on the Raspberry Pi side with a commandros2 topic echo
orros2 topic hz
.However, for some reason, a command
ros2 topic echo /image_raw
cannot be confirmed on the other machine side. A environmental valueROS_DOMAIN_ID
is the same as a one on the Raspberry pi side.And I can get information on some topics with
ros2 topic list -t
, somehow.Also, for some reason, after asking a question, I checked a compressed image topic
/image_raw/compressed
on the other machine side. Moreover I was also able to visualize it.I don't know that cannot received a raw image topic
/image_raw
. What is this ...Information: Raspberry Pi and other machine are communicating via WiFi.
There are currently some problems when sending very large pieces of information over the network, particularly over WiFi. That's likely the reason you can see the compressed one but not the raw one; the compressed one is small enough that it isn't flooding the network. There is some tuning you can do to help improve this; see https://index.ros.org/doc/ros2/Troubl... . However, my suggestion is to just not try to send very large data over a WiFi network. I'd suggest either hooking up your Raspberry Pi via ethernet, or doing some additional processing on the Pi and sending the results of the processing to your other computer.
Oh, an uncompressed image was too big! I got it!
Also, thank you for a nice suggestion.
I see. I will not send a raw image as much as possible, next time.
I didn't know an improvement by DDS tuning, want to try later.
In the end, thank you everyone for answering my poor English.