Skip to content

Commit

Permalink
Add camera.stop() in notebooks that use camera
Browse files Browse the repository at this point in the history
  • Loading branch information
tokk-nv committed Sep 26, 2020
1 parent 202778d commit a4dc4ee
Show file tree
Hide file tree
Showing 10 changed files with 177 additions and 10 deletions.
20 changes: 18 additions & 2 deletions notebooks/collision_avoidance/data_collection.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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": {},
Expand Down Expand Up @@ -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
}
23 changes: 23 additions & 0 deletions notebooks/collision_avoidance/live_demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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": {},
Expand All @@ -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": {
Expand Down
16 changes: 16 additions & 0 deletions notebooks/collision_avoidance/live_demo_resnet18.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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": {},
Expand Down
18 changes: 17 additions & 1 deletion notebooks/collision_avoidance/live_demo_resnet18_trt.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"metadata": {},
"outputs": [],
"source": [
"import torch\n",
"import torchvision\n",
"from torch2trt import TRTModule\n",
"\n",
"model_trt = TRTModule()\n",
Expand Down Expand Up @@ -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": {},
Expand Down
20 changes: 18 additions & 2 deletions notebooks/object_following/live_demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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
}
16 changes: 16 additions & 0 deletions notebooks/road_following/data_collection.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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": {},
Expand Down
22 changes: 19 additions & 3 deletions notebooks/road_following/data_collection_gamepad.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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": {},
Expand Down Expand Up @@ -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
}
"nbformat_minor": 4
}
16 changes: 16 additions & 0 deletions notebooks/road_following/live_demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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": {},
Expand Down
16 changes: 16 additions & 0 deletions notebooks/road_following/live_demo_trt.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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": {},
Expand Down
20 changes: 18 additions & 2 deletions notebooks/teleoperation/teleoperation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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": {},
Expand All @@ -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
}

0 comments on commit a4dc4ee

Please sign in to comment.