Skip to content

Commit c13754c

Browse files
committed
Issue #4: Vizard documentation.
1 parent 808bc16 commit c13754c

File tree

7 files changed

+258
-109
lines changed

7 files changed

+258
-109
lines changed

docs/build/doctrees/nbsphinx/examples/aeos.ipynb

+210-103
Large diffs are not rendered by default.

docs/source/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"sphinx_rtd_theme",
4242
"nbsphinx",
4343
"sphinx.ext.mathjax",
44+
"sphinxcontrib.youtube",
4445
]
4546

4647
templates_path = ["_templates"]
@@ -234,7 +235,6 @@ def generate_index(self, index_path, file_paths, dir_paths, source_dir):
234235
f.write(lines)
235236

236237
def generate_autodoc(self, doc_path, source_file):
237-
238238
# Make header
239239
short_name = source_file.name.replace(".py", "")
240240
lines = ""

docs/source/index.rst

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ for working with these environments.
3131
A whitepaper on the design philosophy behind BSK-RL and an example use case can be
3232
:download:`downloaded here <_static/stephenson_bskrl_2024.pdf>`.
3333

34+
.. youtube:: 8qR-AGrCFQw
35+
3436
Quickstart
3537
----------
3638
Installation

docs/source/release_notes.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ Development Version
2626
* Improve performance of :class:`~bsk_rl.obs.Eclipse` observations by about 95%.
2727
* Logs a warning if the initial battery charge or buffer level is incompatible with its capacity.
2828
* Optimize communication when all satellites are communicating with each other.
29-
29+
* Enable Vizard visualization of the environment by setting the ``vizard_dir`` and ``vizard_settings``
30+
options in the environment.
3031

3132

3233
Version 1.0.1

examples/aeos.ipynb

+36
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,42 @@
366366
"for i in range(5):\n",
367367
" env.step(env.action_space.sample())"
368368
]
369+
},
370+
{
371+
"cell_type": "markdown",
372+
"metadata": {},
373+
"source": [
374+
"## Enabling Vizard\n",
375+
"\n",
376+
"Vizard visualization can be enabled by setting the ``vizard_dir`` to save the Vizard binary to. Here, it is saved to ``/tmp/vizard``, but this can be modified. Scripting settings can also be passed to Vizard."
377+
]
378+
},
379+
{
380+
"cell_type": "code",
381+
"execution_count": null,
382+
"metadata": {},
383+
"outputs": [],
384+
"source": [
385+
"env = SatelliteTasking(\n",
386+
" satellite=satellite_generator(observation=\"S3\", n_ahead=32, include_time=False)(\n",
387+
" name=\"EO1\",\n",
388+
" sat_args=SAT_ARGS,\n",
389+
" ),\n",
390+
" scenario=scene.CityTargets(100),\n",
391+
" rewarder=data.UniqueImageReward(),\n",
392+
" sim_rate=0.5,\n",
393+
" max_step_duration=300.0,\n",
394+
" time_limit=duration,\n",
395+
" failure_penalty=0.0,\n",
396+
" terminate_on_time_limit=True,\n",
397+
" log_level=\"INFO\",\n",
398+
" vizard_dir=\"/tmp/vizard\",\n",
399+
" vizard_settings=dict(showLocationLabels=1),\n",
400+
")\n",
401+
"_ = env.reset()\n",
402+
"for i in range(5):\n",
403+
" env.step(env.action_space.sample())"
404+
]
369405
}
370406
],
371407
"metadata": {

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ dependencies = [
2828
]
2929

3030
[project.optional-dependencies]
31-
docs = ["ipykernel", "ipywidgets", "nbdime", "nbsphinx", "sphinx-rtd-theme"]
31+
docs = ["ipykernel", "ipywidgets", "nbdime", "nbsphinx", "sphinx-rtd-theme", 'sphinxcontrib-youtube']
3232
rllib = ["dm_tree", "pyarrow", "ray[rllib]==2.35.0", "scikit-image", "torch", "typer"]
3333

3434
[project.scripts]

src/bsk_rl/scene/targets.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,12 @@ def visualize_target(self, target, vizSupport=None, vizInstance=None):
133133
color=vizSupport.toRGBA255("white"),
134134
range=1000.0 * 1000, # meters
135135
)
136-
vizInstance.settings.showLocationCones = -1
137-
vizInstance.settings.showLocationCommLines = -1
138-
vizInstance.settings.showLocationLabels = -1
136+
if vizInstance.settings.showLocationCones == 0:
137+
vizInstance.settings.showLocationCones = -1
138+
if vizInstance.settings.showLocationCommLines == 0:
139+
vizInstance.settings.showLocationCommLines = -1
140+
if vizInstance.settings.showLocationLabels == 0:
141+
vizInstance.settings.showLocationLabels = -1
139142

140143
def regenerate_targets(self) -> None:
141144
"""Regenerate targets uniformly.

0 commit comments

Comments
 (0)