File: index.rst

package info (click to toggle)
ros-rviz 1.14.19%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 6,892 kB
  • sloc: cpp: 43,289; python: 1,217; xml: 387; sh: 27; ansic: 26; makefile: 13
file content (361 lines) | stat: -rw-r--r-- 12,633 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
RViz User's Guide
=================

Troubleshooting
---------------

If you're running into problems and have not seen the answer below, try the `Troubleshooting Page <http://wiki.ros.org/rviz/Troubleshooting>`_.

Build/Startup
---------------

First satisfy any system dependencies.::

  rosdep install rviz

Now build the visualizer::

  rosmake rviz

Then start the visualizer::

  rosrun rviz rviz

When rviz starts for the first time, you will see an empty view:

.. image:: empty-rviz.png

The central area with the grid is the 3D view. On the left is the
Displays list, which will show any displays you have loaded. Right now
it just contains the global options and the time view, which I'll get
to later. On the right are some of the other panels, described below.

Displays
--------

A display is something that draws something in the 3D world, and
likely has some options available in the displays list. An example is
a point cloud, the robot state, etc.

For the current list of RViz display types, see `RViz Display Types
<http://wiki.ros.org/rviz/DisplayTypes>`_.


Adding a new display
....................

To add a display, type "control-N" (for "new") or click the Add button
at the bottom:

.. image:: add-button.png

This will pop up the new display dialog:

.. image:: add-display-dialog.png

The list at the top shows the available display types, grouped by the
plugin that provides them. The text box in the middle gives a
description of the selected display type. At the bottom you can give a
name to the new instance of the display, which defaults to the name of
the type name.

Display Properties
..................

Each display gets its own list of properties. For example:

.. image:: display-properties.png

Display Status
..............

Each display gets its own status to help let you know if everything is
OK or not. The status can be one of 4: OK, Warning, Error and
Disabled. The status is indicated in the display's title by the text
color and icon, as well as in the Status category that you can see if
the display is expanded:

.. image:: display-statuses.png

The Status category also expands to show specific status
information. This information is different for different displays, and
the messages should be self explanitory.  The top-level status level
for the display is set based on the worst of the sub-statuses.

Organizing Displays
...................

You can move displays up or down in the list by dragging them with the
left mouse button.  You can select multiple displays and drag them
together.  You can also create a "Group" display, which serves as a
container for other displays.  Displays in a group can be enabled and
disabled together with the group's checkbox.  In this example, the
"Sensor data" group has been disabled and the "Plans" group is
enabled:

.. image:: grouped-displays.png

Naming Displays
...............

In the above example, the "Group" and "Path" displays have been given
meaningful names.  You can do this either at creation time in the new
display dialog (described above) or any time later by selecting one
display and typing "control-R" (for "rename") or by clicking the
"Rename" button.

Configurations
--------------

Different configurations of displays are often useful for different
uses of the visualizer. A configuration useful for a full PR2 is not
necessarily useful for a test cart, for example. To this end, the
visualizer lets you load and save different configurations.

A configuration contains:

 * Displays and their properties
 * Tools and their properties
 * View controller type and settings for the initial viewpoint, plus saved views
 * Window layout and the list of panels

RViz treats configurations similarly to files in an editor.  When a
configuration file is opened, changes are made, and the "save" menu
(or control-"s") is triggered, the original config file is
overwritten.

When no config file is specified, rviz loads the file
``~/.rviz/default.rviz``, creating it if it does not exist.

When a config file other than the default is in use, RViz includes the
file name in the window title bar.  An asterisk ("*") next to the file
name indicates changes have been made since the last time the
configuration was loaded or saved.

The config file format is YAML.  This has changed since the Fuerte
version of RViz, so config files saved with Fuerte RViz will not load
in Groovy RViz.

Views Panel
-----------

The "Views" panel shows properties of the current view controller in
use, and optionally a list of saved views:

.. image:: views-panel.png

Clicking on a saved view ("Top view" and "Side view" above) copies
it to the "Current View" entry and activates it.

The properties of the current view change as you move the viewpoint
with the mouse in the 3D display, but they can also be edited directly
via the keyboard for precise control.

There is a combobox control labelled "Type" at the top of the Views
panel.  This lets you change the type of the current view controller.

To the right of it is the "Zero" button.  This resets the current view
controller to look at the point "0, 0, 0" from a short distance away.
This is useful to get back to a known location if the viewpoint gets
"lost".  The keyboard shortcut for "Zero" is "z".

Built-in view types
...................

"Views" in RViz are view controllers.  They control both the viewpoint
and the camera projection.  There are 4 built-in types, but more can
be added via plugins.

Orbit (default)
,,,,,,,,,,,,,,,

The orbital camera simply rotates around a focal point, while always
looking at that point. The focal point is visualized as a small disc
while you're moving the camera:

.. image:: focal-point.png

Controls:

 * Left mouse button: Click and drag to rotate around the focal point.
 * Middle mouse button: Click and drag to move the focal point in the plane formed by the camera's up and right vectors. The distance moved depends on the focal point -- if there is an object on the focal point, and you click on top of it, it will stay under your mouse.
 * Right mouse button: Click and drag to zoom in/out of the focal point. Dragging up zooms in, down zooms out.
 * Scrollwheel: Zoom in/out of the focal point
 * 'f' key: move the focal point to whatever 3D object is currently under the mouse.

XYOrbit
,,,,,,,

The "XYOrbit" view controller is similar to Orbit, but the focal point
is constrained to move only in the XY plane.  Also, the focal point is
kept lower in the window and is cyan colored.

Controls:

 * Left mouse button: Click and drag to rotate around the focal point.
 * Middle mouse button: Click and drag to move the focal point in the XY plane. The distance moved depends on the focal point -- if there is an object on the focal point, and you click on top of it, it will stay under your mouse.
 * Right mouse button: Click and drag to zoom in/out of the focal point. Dragging up zooms in, down zooms out.
 * Scrollwheel: Zoom in/out of the focal point
 * 'f' key: move the focal point to whatever 3D object is currently under the mouse.

FPS (first-person shooter)
,,,,,,,,,,,,,,,,,,,,,,,,,,

The FPS camera is a first-person camera, so it rotates as if you're looking with your head.

Controls:

 * Left mouse button: Click and drag to rotate. Control-click to pick the object under the mouse and look directly at it.
 * Middle mouse button: Click and drag to move along the plane formed by the camera's up and right vectors
 * Right mouse button: Click and drag to move along the camera's forward vector. Dragging up moves forward, down moves backward.
 * Scrollwheel: Move forward/backward

Top-down Orthographic
,,,,,,,,,,,,,,,,,,,,,

The top-down orthographic camera always looks down along the Z axis (in the robot frame), and is an orthographic view which means things do not get smaller as they get farther away.

Controls:

 * Left mouse button: Click and drag to rotate around the Z axis
 * Middle mouse button: Click and drag to move the camera along the XY plane
 * Right mouse button: Click and drag to zoom the image
 * Scrollwheel: Zoom the image

Coordinate Frames
-----------------

RViz uses the tf transform system for transforming data from the
coordinate frame it arrives in into a global reference frame. There
are two coordinate frames that are important to know about in the
visualizer. Here is a `video that explains them both <http://www.youtube.com/watch?v=rZ0xyzfG-tY>`_.

.. Should really implement a youtube directive for embedding videos.

The Fixed Frame
...............

The more-important of the two frames is the fixed frame. The fixed
frame is the reference frame used to denote the "world" frame. This is
usually the "map", or "world", or something similar, but can also be,
for example, your odometry frame.

If the fixed frame is erroneously set to, say, the base of the robot,
then all the objects the robot has ever seen will appear in front of
the robot, at the position relative to the robot at which they were
detected. For correct results, the fixed frame should not be moving
relative to the world.

If you change the fixed frame, all data currently being shown is
cleared rather than re-transformed.

The Target Frame
................

Most view controllers provide a "target frame" which provides a
reference frame for the camera view. For example, if your target frame
is the map, you'll see the robot driving around the map. If your
target frame is the base of the robot, the robot will stay in the same
place while everything else moves relative to it.  The built-in view
controllers use the target frame only for position, and ignore its
orientation, so when the robot rotates, you will see it spin, but when
in drives it will stay in the same place in the view.

Tools
-----

The visualizer has a number of tools you can use on the toolbar:

Move Camera
...........

 * Keyboard shortcut: m

The Move Camera tool is the default tool. When this is selected, the current View gets to do its thing when you click inside the 3d view.

Interact
........

 * Keyboard shortcut: i

The Interact tool allows the use of Interactive Marker displays.  When
the mouse is not over an interactive element, it behaves like the Move
Camera tool.

Select
......

 * Keyboard shortcut: s

The Select tool allows you to select items being displayed in the 3D
view. It supports single-point selection as well as click/drag box
selection.

.. image:: selection-box.png

Once objects are selected, they are surrounded by cyan-colored
bounding boxes, and information about the selected objects can be
viewed in the "Selection" panel.  Here you can see the position of the
robot link "head_tilt_link" has been expanded to show the XYZ
coordinates:

.. image:: selection-properties.png

You can add to a selection with the Shift key, and remove from the
selection with the Ctrl key. If you want to move the camera around
while selecting without switching back to the Move Camera tool you can
hold down the Alt key.

The f key will focus the camera on the current selection.

2D Nav Goal
...........

 * Keyboard shortcut: g

This tool lets you set a goal sent on the "/move_base_simple/goal" ROS
topic. Click on a location on the ground plane and drag to select the
orientation.  The output topic can be changed in the "Tool Properties" panel.

This tool works with the navigation stack.

2D Pose Estimate
................

 * Keyboard shortcut: p

This tool lets you set an initial pose to seed the localization system
(sent on the "/initialpose" ROS topic). Click on a location on the
ground plane and drag to select the orientation.  The output topic can
be changed in the "Tool Properties" panel.

This tool works with the navigation stack.

Time
----

The Time panel is mostly useful when running in a simulator: it allows
you to see how much ROS Time time has passed, vs. how much "Wall
Clock" (aka real) time has passed.

The time panel also lets you reset the visualizer's internal time
state -- this causes a reset of all the displays, as well as a reset
of tf's internal cache of data.

.. image:: time-panel.png

If you are not running in simulation, the time panel is mostly
useless. In most cases it can be closed and you will probably not even
notice (other than having a bit more screen real estate for the rest
of rviz).

Plugins
-------

RViz is setup so that new displays, tools, view controllers, and
panels can be added through plugins.  Installed plugins are indexed
and made available within RViz automatically.

For information on writing your own RViz plugin, see the plugin
tutorials within `the RViz tutorials  wiki page
<http://wiki.ros.org/rviz/Tutorials>`_.