ros / ros_comm

ROS communications-related packages, including core client libraries (roscpp, rospy, roslisp) and graph introspection tools (rostopic, rosnode, rosservice, rosparam).
http://wiki.ros.org/ros_comm
753 stars 911 forks source link

[question] rospy publisher queue_size type #2295

Open woudie opened 1 year ago

woudie commented 1 year ago

Hi All,

I have more of a general question regarding the rospy publisher queue_size parameter.

Recently I bumped into a weird problem with rospy noetic where a publisher has 'seemingly' been set up correctly but was unable to publish anything at all without any error/exceptions being thrown. After being confused for a while, I found that it was the queue_size had accidentally been set to a string and an integer (as the doc specifies), but I was still confused as to why an exception had been thrown to indicate this. After looking through the codebase, I saw their is no type check for publishers specifically here. I saw this was not the case for subcribers here. What is this reason for this?

Additionally, this issue only popped up when using ros noetic + python3 and not when using ros melodic + python2. Any ideas on why? Besides python3 having some better type checking, the relevant code is the same in melodic and noetic rospy and an exception was never thrown in either scenerio. It just working in melodic, but not noetic. Any advice or insight on these matters is greatly appreciated!