rosboard icon indicating copy to clipboard operation
rosboard copied to clipboard

I added the following in `rosboard/rosboard.py` after line 135 and it works.

Open altineller opened this issue 2 years ago • 2 comments

It fixed this error but now:

[INFO] [1695856654.803669864] [rosboard_node]: Subscribing to /scan [WARN] [1695856654.804567837] [rosboard_node]: name 'HistoryPolicy' is not defined Traceback (most recent call last): File "/home/can/workspaces/rosboard_ws/install/rosboard/lib/python3.10/site-packages/rosboard/rosboard.py", line 264, in sync_subs kwargs = {"qos": self.get_topic_qos(topic_name)} File "/home/can/workspaces/rosboard_ws/install/rosboard/lib/python3.10/site-packages/rosboard/rosboard.py", line 137, in get_topic_qos if(topic_info[0].qos_profile.history == HistoryPolicy.UNKNOWN): NameError: name 'HistoryPolicy' is not defined [INFO] [1695856655.809106101] [rosboard_node]: Subscribing to /scan [WARN] [1695856655.812603795] [rosboard_node]: name 'HistoryPolicy' is not defined

          I added the following in `rosboard/rosboard.py` after line 135 and it works.
                if(topic_info[0].qos_profile.history == HistoryPolicy.UNKNOWN):
                    topic_info[0].qos_profile.history = HistoryPolicy.KEEP_LAST  

Originally posted by @HX2003 in https://github.com/dheera/rosboard/pull/104#pullrequestreview-1104565153

altineller avatar Sep 27 '23 23:09 altineller

Adding:

import rclpy import rclpy.logging import rclpy.qos import rclpy.qos_event

As well changing lines after 135 to:

            if(topic_info[0].qos_profile.history == rclpy.qos.HistoryPolicy.UNKNOWN):
                topic_info[0].qos_profile.history = rclpy.qos.HistoryPolicy.KEEP_LAST

is required to make it work

altineller avatar Sep 27 '23 23:09 altineller

This worked for me both on ROS2 Foxy & Humble, thanks!

Hoolo avatar Dec 08 '23 12:12 Hoolo

Thanks! I merged another PR recently that fixed this as well. Let me know if it is an issue in any of your configurations now. Thanks!

dheera avatar Jun 20 '24 05:06 dheera