From a4dc4ee2ff7218a86f78b2336ac62f22a344c596 Mon Sep 17 00:00:00 2001 From: Chitoku YATO Date: Sat, 26 Sep 2020 00:37:54 -0700 Subject: [PATCH] Add camera.stop() in notebooks that use camera --- .../collision_avoidance/data_collection.ipynb | 20 ++++++++++++++-- notebooks/collision_avoidance/live_demo.ipynb | 23 +++++++++++++++++++ .../live_demo_resnet18.ipynb | 16 +++++++++++++ .../live_demo_resnet18_trt.ipynb | 18 ++++++++++++++- notebooks/object_following/live_demo.ipynb | 20 ++++++++++++++-- .../road_following/data_collection.ipynb | 16 +++++++++++++ .../data_collection_gamepad.ipynb | 22 +++++++++++++++--- notebooks/road_following/live_demo.ipynb | 16 +++++++++++++ notebooks/road_following/live_demo_trt.ipynb | 16 +++++++++++++ notebooks/teleoperation/teleoperation.ipynb | 20 ++++++++++++++-- 10 files changed, 177 insertions(+), 10 deletions(-) diff --git a/notebooks/collision_avoidance/data_collection.ipynb b/notebooks/collision_avoidance/data_collection.ipynb index 5844a98e..eecc22fb 100644 --- a/notebooks/collision_avoidance/data_collection.ipynb +++ b/notebooks/collision_avoidance/data_collection.ipynb @@ -193,6 +193,22 @@ "display(widgets.HBox([blocked_count, blocked_button]))" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Again, let's close the camera conneciton properly so that we can use the camera in the later notebook." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "camera.stop()" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -245,9 +261,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.7" + "version": "3.6.9" } }, "nbformat": 4, - "nbformat_minor": 2 + "nbformat_minor": 4 } diff --git a/notebooks/collision_avoidance/live_demo.ipynb b/notebooks/collision_avoidance/live_demo.ipynb index bcf67e0b..9ed45b29 100644 --- a/notebooks/collision_avoidance/live_demo.ipynb +++ b/notebooks/collision_avoidance/live_demo.ipynb @@ -278,6 +278,22 @@ "camera_link.link() # stream to browser (wont run camera)" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Again, let's close the camera conneciton properly so that we can use the camera in other notebooks." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "camera.stop()" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -289,6 +305,13 @@ "If your robot wasn't avoiding collisions very well, try to spot where it fails. The beauty is that we can collect more data for these failure scenarios\n", "and the robot should get even better :)" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { diff --git a/notebooks/collision_avoidance/live_demo_resnet18.ipynb b/notebooks/collision_avoidance/live_demo_resnet18.ipynb index e23e29fe..98ada5eb 100644 --- a/notebooks/collision_avoidance/live_demo_resnet18.ipynb +++ b/notebooks/collision_avoidance/live_demo_resnet18.ipynb @@ -276,6 +276,22 @@ "camera_link.link() # stream to browser (wont run camera)" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Again, let's close the camera conneciton properly so that we can use the camera in other notebooks." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "camera.stop()" + ] + }, { "cell_type": "markdown", "metadata": {}, diff --git a/notebooks/collision_avoidance/live_demo_resnet18_trt.ipynb b/notebooks/collision_avoidance/live_demo_resnet18_trt.ipynb index 2065c50a..55c5766e 100644 --- a/notebooks/collision_avoidance/live_demo_resnet18_trt.ipynb +++ b/notebooks/collision_avoidance/live_demo_resnet18_trt.ipynb @@ -39,7 +39,7 @@ "metadata": {}, "outputs": [], "source": [ - "import torch\n", + "import torchvision\n", "from torch2trt import TRTModule\n", "\n", "model_trt = TRTModule()\n", @@ -260,6 +260,22 @@ "camera_link.link() # stream to browser (wont run camera)" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Again, let's close the camera conneciton properly so that we can use the camera in other notebooks." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "camera.stop()" + ] + }, { "cell_type": "markdown", "metadata": {}, diff --git a/notebooks/object_following/live_demo.ipynb b/notebooks/object_following/live_demo.ipynb index 9b080f17..a3dc9d52 100644 --- a/notebooks/object_following/live_demo.ipynb +++ b/notebooks/object_following/live_demo.ipynb @@ -363,6 +363,22 @@ "time.sleep(1.0)\n", "robot.stop()" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Again, let's close the camera conneciton properly so that we can use the camera in other notebooks." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "camera.stop()" + ] } ], "metadata": { @@ -381,9 +397,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.7" + "version": "3.6.9" } }, "nbformat": 4, - "nbformat_minor": 2 + "nbformat_minor": 4 } diff --git a/notebooks/road_following/data_collection.ipynb b/notebooks/road_following/data_collection.ipynb index 6da986b9..08ef7953 100644 --- a/notebooks/road_following/data_collection.ipynb +++ b/notebooks/road_following/data_collection.ipynb @@ -185,6 +185,22 @@ "display(data_collection_widget)" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Again, let's close the camera conneciton properly so that we can use the camera in other notebooks." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "camera.stop()" + ] + }, { "cell_type": "markdown", "metadata": {}, diff --git a/notebooks/road_following/data_collection_gamepad.ipynb b/notebooks/road_following/data_collection_gamepad.ipynb index bfe227e2..78db0991 100644 --- a/notebooks/road_following/data_collection_gamepad.ipynb +++ b/notebooks/road_following/data_collection_gamepad.ipynb @@ -253,6 +253,22 @@ "]))" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Again, let's close the camera conneciton properly so that we can use the camera in other notebooks." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "camera.stop()" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -314,9 +330,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.8" + "version": "3.6.9" } }, "nbformat": 4, - "nbformat_minor": 2 -} \ No newline at end of file + "nbformat_minor": 4 +} diff --git a/notebooks/road_following/live_demo.ipynb b/notebooks/road_following/live_demo.ipynb index dc5d094f..48c7f1d3 100644 --- a/notebooks/road_following/live_demo.ipynb +++ b/notebooks/road_following/live_demo.ipynb @@ -326,6 +326,22 @@ "robot.stop()" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Again, let's close the camera conneciton properly so that we can use the camera in other notebooks." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "camera.stop()" + ] + }, { "cell_type": "markdown", "metadata": {}, diff --git a/notebooks/road_following/live_demo_trt.ipynb b/notebooks/road_following/live_demo_trt.ipynb index 5435454e..276b5eef 100644 --- a/notebooks/road_following/live_demo_trt.ipynb +++ b/notebooks/road_following/live_demo_trt.ipynb @@ -306,6 +306,22 @@ "robot.stop()" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Again, let's close the camera conneciton properly so that we can use the camera in other notebooks." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "camera.stop()" + ] + }, { "cell_type": "markdown", "metadata": {}, diff --git a/notebooks/teleoperation/teleoperation.ipynb b/notebooks/teleoperation/teleoperation.ipynb index 9d93df5b..de282e44 100644 --- a/notebooks/teleoperation/teleoperation.ipynb +++ b/notebooks/teleoperation/teleoperation.ipynb @@ -260,6 +260,22 @@ "display(controller)" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Before closeing this notebook and shutdown the Python kernel for the notebook, we want to properly close the camera connection so that we can use the camera in other notebook." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "camera.stop()" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -286,9 +302,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.7" + "version": "3.6.9" } }, "nbformat": 4, - "nbformat_minor": 2 + "nbformat_minor": 4 }