You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/1_world_visualization/1_world_visualization.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
# 1. World Visualization
2
-
In this chapter, I'm gonna explain about a program to define a world coordinate as an environment where a vehicle can move. The program can display a x-y world coordinates and manage each objects which exist on the world.
2
+
In this chapter, I'm going to explain a program to define a world coordinate as an environment where a vehicle can move. The program can display x-y world coordinates and manage each object that exists in the world.
3
3
4
4
## 1.1 Visualization class
5
-
All classes for world visualization is located at a directory, "src/components/visualization". Firstly, I'm gonna introduce a global x-y coordinate visualization class as follow.
5
+
All classes for world visualization are located in a directory, `src/components/visualization`. Firstly, I'm going to introduce a global x-y coordinate visualization class as follows.
This class need to import matplotlib.pyplot and animation to display data plots and an animation. In "__init__" method, an empty "objects" list is defined. Each objects which are located in the world are stored into this list.
43
+
This class needs to import `matplotlib.pyplot` and `animation` to display data plots and an animation. In `__init__` method, an empty `objects` list is defined. Objects that are located in the world are stored in this list.
44
44
45
45
### 1.1.1 MinMax class
46
-
"x_lim" and "y_lim" are objects of MinMax class. This class defines limitation of x/y axis. These objects are used to set a size of world visualization.
46
+
`x_lim` and `y_lim` are objects of `MinMax` class. This class defines the limits of the x/y axes. These objects are used to set the size of the world visualization.
"gif_name" is a string object for saving the animation's gif file. A boolean, "show_plot" is used to switch displaying or not displaying the visualization's figure window when unit test is executed. While the test is running, the figure window should not be displayed to continue the test. "show_zoom" is deciding to limit the size of visualization area until around of the vehicle or the maximum size of world.
144
+
`gif_name` is a string object for saving the animation's gif file. The boolean`show_plot` is used to toggle whether the visualization's figure window is displayed when a unit test is executed. While the test is running, the figure window should not be displayed to continue the test. `show_zoom` determines whether to limit the visualization area to the vicinity of the vehicle or to show the full world.
145
145
146
146
### 1.1.4 Member methods
147
-
A member method, "add_object()" is defined to add each objects which is located in the world. An object can be added to the objects list by calling this method.
147
+
The member method`add_object()` is defined to add objects that are located in the world. An object can be added to the `objects` list by calling this method.
148
148
```python
149
149
defadd_object(self, obj):
150
150
"""
@@ -155,7 +155,7 @@ A member method, "add_object()" is defined to add each objects which is located
155
155
self.objects.append(obj)
156
156
```
157
157
158
-
A member method, "not_show_plot()" is defined not to display the figure window of the visualization. This method can be used when the unit test is executed.
158
+
A member method, `not_show_plot()` is defined to prevent the figure window from being displayed of the visualization. This method can be used when the unit test is executed.
159
159
```python
160
160
defnot_show_plot(self):
161
161
"""
@@ -166,7 +166,7 @@ A member method, "not_show_plot()" is defined not to display the figure window o
166
166
self.show_plot =False
167
167
```
168
168
169
-
This member method, "update" is used to update each objects's data and draw the animation in the list periodically. For this process, each objects in the list must have "update" method and "draw" method.
169
+
The member method`update` is used to periodically update each object's data and draw the animation. For this process, each object in the list must have an `update` method and a `draw` method.
170
170
```python
171
171
defupdate(self, i, elems, axes):
172
172
"""
@@ -194,7 +194,7 @@ This member method, "update" is used to update each objects's data and draw the
Finally, this "draw" method is defined to execute simulation including updating and visualization. If a specific name of gif file is set to "gif_name", the simulation's gif file will be created and saved instead of visualization.
197
+
Finally, this `draw` method is defined to execute simulation including updating and visualization. If a specific GIF filename is assigned to `gif_name`, the simulationwill be saved as a GIF file instead of being displayed.
198
198
```python
199
199
defdraw(self):
200
200
"""
@@ -231,7 +231,7 @@ Finally, this "draw" method is defined to execute simulation including updating
231
231
```
232
232
233
233
## 1.2 Visualize empty world
234
-
I prepared for [a sample progoram to visualize an empty world](/doc/1_world_visualization/visualize_world.py).
234
+
I have prepared [a sample program to visualize an empty world](/doc/1_world_visualization/visualize_world.py).
235
235
```python
236
236
"""
237
237
visualize_world.py
@@ -283,5 +283,5 @@ def main():
283
283
if__name__=="__main__":
284
284
main()
285
285
```
286
-
You will be able to understand how to use the above world visualization class by reading the code. By executing this, you can see that an empty world simulation is visualized as follow.
286
+
You will be able to understand how to use the above world visualization class by reading the code. By executing this, you can see that an empty world simulation is visualized as follows.
0 commit comments