ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

Yes. Assuming you have enough memory/CPU/GPU power you can start as many rviz instances as you like. The only "gotcha" that I can think of is that each instance should have a unique ROS name (just like every other ROS node). This happens automatically with rosrun and can easily be implemented in roslaunch with the anon substitution arg.

If by "independent" you mean they shouldn't be able to talk to each other via ROS mechanisms. Then, once again, yes. That is possible. You would just need to set the ROS_MASTER_URI different for each instance (and have a corresponding roscore running).

Yes. Assuming you have enough memory/CPU/GPU power you can start as many rviz instances as you like. The only "gotcha" that I can think of is that each instance should have a unique ROS name (just like every other ROS node). This happens automatically with rosrun and can easily be implemented in roslaunch with the anon substitution arg.

If by "independent" you mean they shouldn't be able to talk to each other via ROS mechanisms. Then, once again, yes. That is possible. You would just need to set the ROS_MASTER_URI different for each instance (and have a corresponding roscore running).

EDIT

If the second paragraph is really what you want, there are certainly a few ways this could be done, but none of them seem great. If you already had two ros masters running on different ports (could be started with roscore -p see here) then you could use the env tag to set the ROS_MASTER_URI for each rviz instance. For example:

<launch>
  <node name="rviz_instance1" pkg="rviz" type="rviz">
    <env name="ROS_MASTER_URI" value="http://localhost:11311" />
  </node>

  <node name="rviz_instance2" pkg="rviz" type="rviz">
    <env name="ROS_MASTER_URI" value="http://localhost:11312" />
  </node>
</launch>

I verified this works, but it obviously isn't great as it requires you to manually start one ROS master independently of the call to roslaunch (the second master could get started automatically by roslaunch). Here are a few potential solutions to this problem:

  1. Use a shell script that starts the ROS cores for you. It might be tricky to make sure that they are both up and running before calling roslaunch. You will also need to be careful that everything shuts down properly.

  2. In principle, you could edit the nodes that get started when calling roscore by editing roscore.xml. I don't think this is a great idea though.