ros-visualization / rviz

ROS 3D Robot Visualizer
BSD 3-Clause "New" or "Revised" License
831 stars 463 forks source link

After the display plug-in is unchecked, objects displayed in the 3D area still exist. #1764

Closed ysl-design closed 2 years ago

ysl-design commented 2 years ago

Describe your issue here and explain how to reproduce it.

My scenario goes like this: I construct a PointStamped data and send it at 30 Hz to the rviz for display. When the PointStamped plug-in is checked and unchecked several times, the following phenomenon occurs occasionally: The plug-in is unchecked, but objects are still displayed in the 3D area. This phenomenon seems to occur only in the noetic version, as I cannot reproduce it in the melodic. image

The PointStamped data I constructed is as follows: header: seq: 341 stamp: secs: 1590459933 nsecs: 777035282 frame_id: "map" point: x: 1.2 y: 2.2 z: 3.2

Your environment

rhaschke commented 2 years ago

It might be possible that there was a message pending in the ROS callback queue, when you disabled the display. This message would be processed after the display was disabled and thus show anyway. This should occur very rarely only, right? I couldn't reproduce the issue on Noetic.

rhaschke commented 2 years ago

Could you please verify whether #1765 fixes your issue?

ysl-design commented 2 years ago

There is a low probability that this problem occurs. It occurs 2 to 3 times every 100 times checked and unchecked operation. I tried this #1765 and it did work, the problem did not recur. I think not only PointStamped but also other plug-ins have the same problem. So I think this modification #1765 should be placed in the base class MessageFilterDisplay, perhaps the processTypeErasedMessage function?

rhaschke commented 2 years ago

You are right. I shifted the check to the base class.

ysl-design commented 2 years ago

I tried new modifications #1765 and found the problem reappeared. It seems that putting modifications in the incomingMessage function does not work. I tried putting the modifications in the processTypeErasedMessage function and the problem was fixed.

rhaschke commented 2 years ago

Thanks for this hint. I merged a different version to Noetic.