RUVIDEO
Поделитесь видео 🙏

Lesson 30 JetBot Teleop Python Code Explanation

Lesson 30: JetBot Teleop Python Code Explanation
Lesson 30A:
import ipywidgets.widgets as widgets
controller = widgets.Controller(index=1) # replace with index of your controller
display(controller)
In this section of code we are creating an instance of your PS3 Controller widget in order to drive the JetBot motors in different directions and speed by using ipywidgets
ipywidgets, also known as jupyter-widgets or simply widgets, are interactive HTML widgets for Jupyter notebooks and the IPython kernel. Notebooks come alive when interactive widgets are used. Users gain control of their data and can visualize changes in the data. Learning becomes an immersive, fun experience
Once you run the code and press any buttons on your PS3, you can see the controller like soft widgets appearing on the notebook browser.
Lesson 30B:
from jetbot import Robot
import traitlets
robot = Robot()
left_link = traitlets.dlink((controller.axes[1], 'value'), (robot.left_motor, 'value'), transform=lambda x: -x)
right_link = traitlets.dlink((controller.axes[3], 'value'), (robot.right_motor, 'value'), transform=lambda x: -x)
Here we are importing a Python library called Trailets which is nothing but a framework that lets Python classes have attributes with type checking, dynamically calculated default values, and 'on change' callbacks. The package also includes a mechanism to use traitlets for configuration, loading values from files or from command line arguments.
In case of JetBot, traitlets allows us to attach the control mechanism to JetBot motors and then we are using a Python Dlink function for both left and right motors to be controlled
Lesson 30C:
image = widgets.Image(format='jpeg', width=300, height=300)
display(image)
In this code we are using the widgets from ipywidgets library to build a camera video pipe, There are many widgets distributed with ipywidgets that are designed to display numeric values. Widgets exist for displaying integers and floats, both bounded and unbounded within a image.
Lesson 30D:
from jetbot import Camera
camera = Camera.instance()
Here we are importing a Python library called Camera. This library package provides a pure Python interface to the Raspberry Pi camera module for Python 3.2 and above version. In JetBot kit we are using Raspberry Pi CSI camera which needs to be detected using this library. In this particular code we are creating the camera instance and then we set the call function to call the instance method which will create a new camera
Lesson 30E:
from jetbot import bgr8_to_jpeg
camera_link = traitlets.dlink((camera, 'value'), (image, 'value'), transform=bgr8_to_jpeg)

In this Python code we are converting the blue green red frame captures into jpeg image format using the Python inbuilt library and attaching that to traitlet widget link

More Detailed Explanation and Steps are documented in CodingScientist Manual :

Reach out to me for 1 o 1 coaching, manuals and source code at the following contact details :
email : [email protected]
WhatsApp: +91-99725-77735
eLearning Platform: www.CodingScientist.com

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Lesson 30 JetBot Teleop Python Code Explanation», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.