# Jupyter notebook tutorials

**URL:** <https://forum.hello-robot.com/t/jupyter-notebook-tutorials/298>\
**Category:** Share\
**Created:** [September 20, 2021, 9:10pm UTC](https://forum.hello-robot.com/t/jupyter-notebook-tutorials/298 "2021-09-20T21:10:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aarju](https://avatars.discourse-cdn.com/v4/letter/a/3ab097/32.png) [@Aarju](https://forum.hello-robot.com/u/Aarju)\
**Post date:** [September 20, 2021, 9:10pm UTC](https://forum.hello-robot.com/t/jupyter-notebook-tutorials/298/1 "2021-09-20T21:10:45Z")

</div>

Hello Stretch Community!

My name is Aarju Goyal, I recently graduated from University Of Southern California with my Master’s degree in Computer Science and I’ve had the amazing opportunity to intern at Hello Robot this Summer.

I’ve been working on a couple of projects this summer and I would like to share one of them here- [Jupyter notebook](https://jupyter-notebook.readthedocs.io/en/stable/) tutorials. The tutorials are meant to provide the Stretch community with detailed explanations and insights on the functions and API of Stretch body. The Python Jupyter notebooks run in a browser and allow the reader to interact with Stretch easily and efficiently.

There are currently two new tutorials available; both are available in [Stretch Tutorial](https://github.com/hello-robot/stretch_tutorials).

- [Stretch Body: Commanding Motions:](https://github.com/hello-robot/stretch_tutorials/blob/master/stretch_body/jupyter/stretch_body_commanding_motions.ipynb) This tutorial is written by @bshah, and explains how to use the `stretch_body.robot.Robot` class to interact with Stretch (e.g. starting, homing, stowing, retrieving status, & stopping). The notebook continues to use other classes within Stretch Body to command motion to Stretch’s lift, arm, base, and other joints.
- [Stretch Body PIMU (Power and IMU)](https://github.com/hello-robot/stretch_tutorials/blob/master/stretch_body/jupyter/stretch_base_body_pimu.ipynb): This tutorial is written by me, and goes into more detail of the PIMU (Power and IMU board in Stretch’s mobile base). The PIMU board is accessed through the `stretch_body.pimu.Pimu` class, and the tutorial goes into detail about the Utility functions that would be helpful during the development/factory stage of a Stretch based project. The tutorial then provides new functions to visualize the status values from the PIMU board. The functions can also take any transformation functions that should be applied to the status values. Visualizing the status values can provide insight into if the IMU sensors are responding in the expected way.

* * *

Here are some snippets:

As shown below, the tutorial follows the format of a brief description of a value/function followed by a code cell on how to use it.

 ![](https://canada1.discourse-cdn.com/flex030/uploads/hello_robot2/original/1X/7d96ea76d473ef0eab7fa5fdd0198938a16d62af.png)

The PIMU tutorial shows how to visualize status values. The visualization functions - `plot_values` and `plot_values_4` can take arguments like `run_time`, `num_points`, `yrange` and `functions`. Details about the arguments are given in the tutorial. Following is an example of why the PIMU voltage is important followed by it’s visualization.

 ![](https://canada1.discourse-cdn.com/flex030/uploads/hello_robot2/original/1X/6f8ef49dde68e839f41715883b623eda22250f99.png)

I would like to sincerely thank @aedsinger and @bshah or their guidance on designing the tutorial as well as helping me understand Stretch Body better so that I could make a helpful tutorial. I hope the tutorials prove to be helpful to the Stretch community.

Best  
Aarju Goyal

---

<div class="post-metadata">

**Author:** ![anant](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.hello-robot.com/anant/32/205_2.png) [@anant](https://forum.hello-robot.com/u/anant)\
**Post date:** [October 26, 2021, 6:11am UTC](https://forum.hello-robot.com/t/jupyter-notebook-tutorials/298/3 "2021-10-26T06:11:21Z")

</div>

Hi @Aarju,

Thank you for sharing this fantastic resource. Since `stretch_body` package directly interacts with the stretch hardware, did you run these notebooks after ssh-ing into the stretch robot server?

Is there a way where by using [ROS Remote master](https://docs.hello-robot.com/untethered_operation/#ros-remote-master) or by some other approach, we can run jupyter notebooks on a computer (fyi which is already connected to Stretch RE1 using ROS Remote master)?

---

<div class="post-metadata">

**Author:** ![bshah](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.hello-robot.com/bshah/32/55_2.png) [@bshah](https://forum.hello-robot.com/u/bshah)\
**Post date:** [October 26, 2021, 8:38pm UTC](https://forum.hello-robot.com/t/jupyter-notebook-tutorials/298/4 "2021-10-26T20:38:36Z")

</div>

Hello, welcome to the forum @anant! When Aarju and I were collaborating on these notebooks, we would use SSH tunnels to run the notebooks remotely. A SSH tunnel connects the Jupyter server running on the robot to a port on your computer, allowing you to open the notebook in your own browser. These [instructions](https://docs.anaconda.com/anaconda/user-guide/tasks/remote-jupyter-notebook/) from the Jupyter docs show the steps needed to set up a SSH tunnel.

---

<div class="post-metadata">

**Author:** ![humberto](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.hello-robot.com/humberto/32/601_2.png) [@humberto](https://forum.hello-robot.com/u/humberto)\
**Post date:** [April 19, 2023, 8:59pm UTC](https://forum.hello-robot.com/t/jupyter-notebook-tutorials/298/5 "2023-04-19T20:59:37Z")

</div>

Hi, I student and I am using the stertch for my tesis, but i am a bit lost could you tell I can see that tutorials.  
Thanks

---

<div class="post-metadata">

**Author:** ![bshah](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.hello-robot.com/bshah/32/55_2.png) [@bshah](https://forum.hello-robot.com/u/bshah)\
**Post date:** [April 20, 2023, 1:55am UTC](https://forum.hello-robot.com/t/jupyter-notebook-tutorials/298/6 "2023-04-20T01:55:26Z")

</div>

Hi @humberto, check out my reply to your other question here:

> [@Could you help to start?](https://forum.hello-robot.com/t/could-you-help-to-start/682/2):
>
> Hello @humberto, welcome to the forum! It’s great that you’re using Stretch in your thesis. I would recommend starting with the [Getting to Know Stretch](https://docs.hello-robot.com/0.2/stretch-tutorials/getting_started/) tutorials. The series includes: A [safety guide](https://docs.hello-robot.com/0.2/stretch-tutorials/getting_started/safety_guide/) - highly recommend starting with this guide for your own safety! [Quick start](https://docs.hello-robot.com/0.2/stretch-tutorials/getting_started/quick_start_guide_re2/) - get a feel for what you can do with Stretch by using the xbox controller to teleop Stretch around. Also, this guide introduces the Python library, Stretch Body. [Best Practices](https://docs.hello-robot.com/0.2/stretch-tutorials/getting_started/best_practices/) - info about keeping the battery healthy, …
