Closed vvigilante closed 3 years ago
Please post the code of the non-working subscriber and the exact commands you are running in your terminal. Thanks
On Fri, Oct 9, 2020 at 08:35 Vincenzo notifications@github.com wrote:
Hello! Tested with ROS melodic on Ubuntu 18.04
rostopic info shows that the topic is published and subscibed as expected. rostopic hz shows that the topic is being published with a frequency of ~10hz, as expected. rostopic echo is completely silent, so is the subscriber node that I wrote.
It works if I change the type of the published topic to String or to Image, it does not work with Detection2D or Detection2DArray
My code looks like this:
from time import sleep import rospy rospy.init_node('t1') pub = rospy.Publisher('detection', Detection2DArray, queue_size=10) while True: message = Detection2DArray() pub.publish(message) sleep(0.1)
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Kukanani/vision_msgs/issues/40, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABUS6H62NJHDZ52JHUORVE3SJ4GRVANCNFSM4SKC3ABA .
--
-- Adam Allevato (303)-818-6576 Eph. 4:29
Thank you for your answer. Here is the list of the commands:
rostopic list
rostopic hz /detection
rostopic bw /detection
rostopic echo /detection
rostopic info detection
gives
Type: vision_msgs/Detection2DArray
Publishers:
* /t1 (http://ubuntu:46019/)
Subscribers:
* /t2 (http://ubuntu:35623/)
The code for the subscriber is the following.
import rospy
from vision_msgs.msg import Detection2DArray
rospy.init_node('t2')
def rcv_detection(msg):
rospy.loginfo('detection here')
sd = rospy.Subscriber("detection", Detection2DArray, rcv_detection)
rospy.spin()
It stays completely silent.
The code you posted is incomplete. Your publisher does not import Detection2DArray
.
In general, if rostopic hz
works and rostopic echo
does not, this is probably an issue with your machine setup or network transport, not the message type itself. I would investigate other issues such as
ROS_IP
or ROS_HOSTNAME
are common problems)source
d the workspace with vision_msgs
in itpython
interpreter and import vision_msgs
roswtf
I was unable to reproduce the bug on ROS melodic, Ubuntu 18.04, latest vision_msgs
on melodic-devel
branch, using the following code. I get continuous detection here
log messages on the subscriber. I verified that the following example works on both my own desktop machine and in a ros:melodic
docker container. Therefore, I am going to close the issue as wontfix
since it does not appear to be a problem with this package. If you find more detailed information that specifically points to this package as the issue. If you install another third-party messages library, does that one work using the same code?
Note that because you do not check for the rospy.is_shutdown()
state, it is "difficult" to kill publisher
(Ctrl-/ not Ctrl-C in bash
)
publisher
#!/usr/bin/python
from time import sleep
import rospy
from vision_msgs.msg import Detection2DArray
rospy.init_node('t1')
pub = rospy.Publisher('detection', Detection2DArray, queue_size=10)
while True:
message = Detection2DArray()
pub.publish(message)
sleep(0.1)
subscriber
#!/usr/bin/python
import rospy
from vision_msgs.msg import Detection2DArray
rospy.init_node('t2')
def rcv_detection(msg):
rospy.loginfo('detection here')
sd = rospy.Subscriber("detection", Detection2DArray, rcv_detection)
rospy.spin()
Dear Kukanani, thank you for your help.
roswtf gives
ERROR The following nodes should be connected but aren't:
* /t1->/t2 (/detection)
Setting ROS_ID=127.0.0.1
does not help.
The problem only happens if I apt install ros-melodic-vision-msgs
.
If I clone the repository, checkout melodic-devel
and catkin build
, everything works as expected
Hello! Tested with ROS melodic on Ubuntu 18.04
rostopic info shows that the topic is published and subscibed as expected. rostopic hz shows that the topic is being published with a frequency of ~10hz, as expected. rostopic echo is completely silent, so is the subscriber node that I wrote.
It works if I change the type of the published topic to String or to Image or to Pose2D, it does not work with Detection2D or Detection2DArray or BoundingBox2D.
My code looks like this: