0
$\begingroup$

Rosanswers logo

Hi everyone,

I have to control more than one robot at a time. The robots are administered by a central ROS server and can be displayed and controlled using ROS RVIZ at the same time. Every robot runs in a distinct name space such that same topics (like 'move_base/simple_goal') of different robots do not collide.

I was now looking for multiple navigation goal buttons in the tool panel of RVIZ, one for each robot. Currently I have to change the goal topic of the tool each time I intend to give the next robot a moving command. That is not very sophisticated and annoying.

Is there a simple way to have multiple buttons on the toolbar with the same functionality? So far I found nothing that would help.

PS: I am not interested in running ROS cores on each robot and/or opening different instances of RVIZ, just in case someone is about to suggest anything like this ;)

Really appreciate any help and thanks in advance. J.Buesch


Originally posted by JBuesch on ROS Answers with karma: 237 on 2012-04-10

Post score: 6

$\endgroup$

3 Answers 3

0
$\begingroup$

Rosanswers logo

You have to hack rviz source and recompile it. Do as follows:

roscd rviz
cd src/rviz

Edit the file visualization_manager.cpp and go to line 215. You will see there:

createTool< InteractionTool >("Interact", "i" );
...
createTool< GoalTool >("2D Nav Goal", "g");
...

Copy the GoalTool line as many times as you need. Syntax:

createTool< TypeOfTheTool >("Label on the button", "shortcut_key");

Save and rosmake rviz. (If you've got precompiled packages remember to delete ROS_NOBUILD before rosmake.)

Now you free to add lines in rviz configuration files .vcg for each tool:

Tool\ Label\ on\ the\ buttonTopic=/robot_n/move_base_simple/goal

Have fun.


Originally posted by Jakub with karma: 1821 on 2012-07-30

This answer was ACCEPTED on the original site

Post score: 6


Original comments

Comment by JBuesch on 2012-08-03:
Would it really be that simple? :) Thanks for the accurate hints!

Comment by Brioche on 2012-10-01:
I was curious: is it possible to add another kind of button or shortcut key? example to stop refreshing the point cloud stream. Something close to RGBDSlam actually, but I want to show also the urdf model of my robot.

Comment by Jakub on 2012-10-01:
For new tools more hacking is required. You have to check out the source code of already existing tools in rviz/src/rviz/tools. All new tools must derive from Tool class (tools.h, tools.cpp). Once done, the above solution would be valid for new tools.

$\endgroup$
0
$\begingroup$

Rosanswers logo

A clean solution would probably be to create an Interactive Marker server that supplies this functionality (e.g. a huge flat box marker that you can click on).

This would also allow you to customize the functionality to your specific application.


Originally posted by dgossow with karma: 1444 on 2012-08-03

This answer was NOT ACCEPTED on the original site

Post score: 3


Original comments

Comment by JBuesch on 2012-08-03:
Yes, sounds like a reasonable approach.. More generic than hacking the sources.. When I placed the question my environment was not able to use interactive markers, but fortunately that has changed now.

Comment by jayess on 2017-07-26:
I think that this approach is better than the accepted answer as it can be used without hacking.

$\endgroup$
0
$\begingroup$

Rosanswers logo

There's an even simpler way than anyone else has described (except for @joq's answer) that doesn't require any hacking or coding whatsoever. You can add multiple instances of the same tool by using a custom (or modifying the default) .rviz configuration file.

Under the Tools section add:

- Class: rviz/SetGoal
  Topic: /name1/move_base_simple/goal
- Class: rviz/SetGoal
  Topic: /name2/move_base_simple/goal

where name1 and name2 are the names of your robots.


Originally posted by jayess with karma: 6155 on 2017-08-10

This answer was NOT ACCEPTED on the original site

Post score: 6

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.