# Stdr and RViz

My understanding: STDR provides a simulator of a 2d Robot and it's environment (map). Which means that it listens for variations of cmd_vel and moves an imaginary robot on a simulated field. The field can have obstacles, and this imaginary robot will not be able to power through the walls. Presumably you can cmd_vel all you like and your odom will tell you that you've not moved.

Separate but connected, STDR also lets me visualize the map and the robot to allow me to see what's going on. And I can create more robots and give them different sensors all that will publish on the expected Topics.

Did I get that right?

So my question is then: Why does Stdr have a GUI and still sometimes we use it with RViz? In other words, why would you need RViz when using Stdr? I am sure this question comes from my not quite understanding what RViz does and it's relationship with other packages.

### Followup based on response below:

"It's just that it's a nice tool to render the dataflows running through your application in context (ie: their spatial and temporal relationships) in a 3D world." -- I thought RViz just did 2d?

In general I am not exactly clear yet what RViz displays that STDR gui does not. The map is from the same /map service and the robots position, orientation, and sensor displays are the same aren't they? Thanks!

edit retag close merge delete

Sort by » oldest newest most voted

Why does Stdr have a GUI [..]

Because it's convenient to be able to verify that your robot's internal state (ie: the data it publishes on topics and uses for its control algorithms (in the broadest sense)) has some correspondance (ie: makes sense) to the 'real world', which is what STDR is simulating.

and [why do] we use it with RViz?

Because for humans it's infinitely easier to assess whether the internal state of your robot makes sense by looking at a 3D graphical representation than by looking at raw msg contents streamed onto a console by something like rostopic echo ...

In other words, why would you need RViz when using Stdr?

You don't need to use RViz at all. It's just that it's a nice tool to render the dataflows running through your application in context (ie: their spatial and temporal relationships) in a 3D world.

I am sure this question comes from my not quite understanding what RViz does and it's relationship with other packages.

RViz doesn't really have a relationship with other packages. You can use ROS and have a robot be completely controlled by ROS without ever touching or using RViz.

You would probably be missing out on a great visual debugging tool and one of the easier ways to get an insight into what your robot is doing though. And all 'for free', as RViz is just one other subscriber to the data that gets published by your nodes anyway.

Finally, in this particular context -- which is not unique to STDR, but would seem to be similar to RViz+Gazebo, RViz+V-REP, etc -- the idea is that the simulator is only a stand-in for a real robot. There is no 'GUI' for your real robot or the real world. Considering this, having RViz running next to your simulator doesn't seem so redundant any more I believe.

Edit:

I thought RViz just did 2d?

No. RViz is a full 3D rendering application. See this video (old, but it shows RViz' capabilities well). It's just that in a lot of navigation setups, it's used with its top-down view, which makes it look like it's 2D.

In general I am not exactly clear yet what RViz displays that STDR gui does not. The map is from the same /map service and the robots position, orientation, and sensor displays are the same aren't they?

Again, that may be true for this particular setup, but is not true in general (especially not when you replace your simulator with the real world).

RViz shows you the world as your robot 'sees' it (or: as your nodes publish their messages). Your simulator GUI shows you the internal state of the simulator.

Those two do not necessarily have to be identical.

RViz is a generic tool, it's not limited to use with STDR.

more

See extended question in original post please. Thanks!

( 2018-02-10 07:48:13 -0600 )edit