Robotics StackExchange | Archived questions

RViz custom Tool that mimics "Publish Point" built-in Tool behavior?

Hello all,

The Publish Point Tool publishes a PointStamped to /clicked_point when used to click some object in RViz. It publishes nothing when clicked on empty space. This is the behavior I want, but I wish to make multiple Tools have this same behavior and publish to different topics.

I have seen custom plugins that can publish a point where clicked in the XY-plane (or some arbitrary plane, surface, etc), but this misses the "Z" dimension, while the Publish Point Tool takes on the XYZ-point of the object it clicks.

I have yet to find a custom RViz Plugin that can communicate with the positions of all other Display objects.

Asked by iomh on 2019-12-11 16:05:15 UTC

Comments

Answers

If you look in your .rviz configuration file, you'll notice a Tools section.

 Tools:
    - Class: rviz/Interact
      Hide Inactive Objects: true
    - Class: rviz/MoveCamera
    - Class: rviz/Select
    - Class: rviz/FocusCamera
    - Class: rviz/Measure
    - Class: rviz/SetInitialPose
      Topic: /initialpose
    - Class: rviz/SetGoal
      Topic: /move_base_simple/goal
    - Class: rviz/PublishPoint
      Single click: false
      Topic: /clicked_point

You can most probably, cut/paste the Publish Point multiple times with different Topics. I haven't tried, but give it a shot and see if it works.

Asked by pbeeson on 2020-05-14 13:59:56 UTC

Comments

Thanks for the reply! I actually abandoned this idea since PublishPoint crashed RViz too frequently for my purposes. However, I did try your solution, and it does work, but you cannot change the tool's name (even if you add a name tag to the .rviz file), so you're left with multiple tools that publish to different topics in the RViz toolbar, all with the name "Publish Point". Pretty cluttered.

Asked by iomh on 2020-06-04 19:10:58 UTC