-
-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3d12359
commit 85916b7
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
""" | ||
visualize_world.py | ||
Author: Shisato Yano | ||
""" | ||
|
||
# import path setting | ||
import numpy as np | ||
import sys | ||
from pathlib import Path | ||
|
||
abs_dir_path = str(Path(__file__).absolute().parent) | ||
relative_path = "/../../src/components/" | ||
|
||
sys.path.append(abs_dir_path + relative_path + "visualization") | ||
|
||
|
||
# import component modules | ||
from global_xy_visualizer import GlobalXYVisualizer | ||
from min_max import MinMax | ||
from time_parameters import TimeParameters | ||
|
||
|
||
# flag to show plot figure | ||
# when executed as unit test, this flag is set as false | ||
show_plot = True | ||
|
||
|
||
def main(): | ||
""" | ||
Main process function | ||
""" | ||
|
||
# set simulation parameters | ||
x_lim, y_lim = MinMax(-30, 30), MinMax(-30, 30) | ||
vis = GlobalXYVisualizer(x_lim, y_lim, TimeParameters(span_sec=20)) | ||
|
||
# add objects here | ||
|
||
# plot figure is not shown when executed as unit test | ||
if not show_plot: vis.not_show_plot() | ||
|
||
# show plot figure | ||
vis.draw() | ||
|
||
|
||
# execute main process | ||
if __name__ == "__main__": | ||
main() |