Universal Robot RTDE tutorial #2 (Example program from UR) - 이중 자막

Hello everybody.
So let's go quickly over what we did last time.
So last time we downloaded RTDE folder and today we will be talking about the example how to implement the first program.
So In this folder that you unpacked,
you will be able to find the folder called examples, and inside of it you will have file called example control loop dot py.
This is the file I'm talking about, so let's just go over it.
What is important to note is the file.
And if you want the program to run, you will need this file that you see right now.
All the packages that we talked about beforehand and also you are providing with file called rtv control loop dot urp.
This is a UR script.
upload on your teaching pedant,
meaning the tablet that's connected to the robot,
and in order to operate the robot,
you need to run both the programs in your Python script as well as your teaching pedant at the same time.
So after you load the program on your teaching pedant,
you are going to set the control to local, not remote, this is very important, and you are going to play the program.
You are also going to play the program that you see in the Python.
So let's analyze the Python code first.
Over here, you can see we download, we import all the necessary packages from the folders that we downloaded as well.
The robot host is an IP number of your robot, which can be found if you go to the teaching pedant.
In the right upper corner, you will see three horizontal bars.
You click on them,
and you can access settings and you go to system network and IP address and you are going to copy that IP address and type it over here.
Here, the robot is the robot port through which you communicate with the robot.
Config file name is the control loop configuration XML.
This is the file that's also inside the examples folder.
It's an XML file that has all the recipes of state and setpoint as well as a watchdog.
As a reminder, the states are...
and you can use to read values from the robot.
So in my case, I need an access to actually TCP force.
So I have to define it over here.
I more about them in the first video, but this is the main purpose.
And the set points are the values that we want to send to the robot.
So if I have a list of six values, let's say six joint values, I need six registers.
to have access to them in order to send them to the robot
and to be able to change them and to operate the robot accordingly.
So all of those are defined inside the control loop configuration.xml.
Keep running.
This is something that's going to be used later.
For now, I will just comment it out.
A locker,
it's also something that allows you to lock the,
if you have any errors,
if I have it commented out because I don't want to keep creating a new files every time I run the program.
It really, as the time goes, really makes a lot of mess on your computer.
But if it helps you later on to solve some issues, feel free to uncomment it and use it.
Over here we have the configuration files.
We basically...
reformat the state and set points and watchdogs from the control loop configuration.xml file
to the more Python friendly way so that we can access those values.
And we also start
we check that if the connection is being established those are things that
you should not change this is something that comes with the robot and just keep it
as it is the same the controller version over here set up a recipe this is
something that you should not change as well on the line 68 we see set point
one set point two those are lists with six of them
values of a point in the Cartesian space to which we want to move our robot.
If you're not familiar,
the first three values are the position in the Cartesian space,
x, y, z, and the last three values are the rotations, orientation the axis angle representation.
and those are not very intuitive to look at,
but this is what it is,
and there is an option to change them to the Euler angles and to other representations,
but this is too advanced to go into as of first video.
So we defined some set point one, set point two, meaning points to which we to get, as I mentioned beforehand.
Each list has six values, so we want to be able to send those six values to the robot.
That's why we need to initialize six registers, which will hold those values, one register per value.
So we initialize them to zero.
We also have a watchdog, which is used, and you can see how is it being used in the URP file on the teaching patent.
Usually those kind of watchdogs are being used for us flags in order to make sure that the Python code is running at the
correct speed.
and that it's being synchronized with how the code in the UR script on the teaching pattern is running.
Here, as I mentioned before, we have six registers, so that's why the value over here is
six, because we want to be able to change the list to the setpoint in order to be able to send it to the
Those are two functions that we will be using.
Actually, the value, the function that we will be using
in this case is only list to setpoint because we have a setpoint one and setpoint two, which are two points given as a list.
And we want to reformat them as setpoint.
Later on we have started data synchronization.
This something that also should not be changed.
So coming back over here, what will you change?
Robot host, if your IP address is different.
Besides that, those points, if you want to move to different points, you can also change them over here.
If you are going to use more registers to send values,
then maybe you should define over here more registers,
but you should initialize them to zero the way that they are initialized with the program that came from your.
Here you don't change anything and while keep running again I commented it out so I'm just going to do the following.
This is our main control loop.
So we run it constantly till the state is known and then we break.
So what does it do?
State equals conduct receive.
This us to receive a state from the Again,
those states are defined in the XML files,
so if you want to have an access to joint values,
and you did not define them in those recipes in XML file, you won't be able to access those.
Therefore, in our case, let's see, we want to access TCP post, so I'm just going to copy over here.
State.actualTCP post, this allows me to, read the TCP posts from the robot which is both the position and the orientation of the robot.
I don't need it for now so I'm going to delete it but this is how the code works and how this function works.
here again as I mentioned beforehand that the watchdog is very often used as
flag as is as it is in this case so we have a small program basically and we are
going to send a set point However,
if a set point that's being set was sent is set point two, then we send set point one.
If it's not set point one, yeah, if it's not set point one, then we send set point two.
So this is just a bit confusing way that the Python writes a time in.
But I hope that you understand what it says.
Basically, if the last point to which removed was 0.1, then move to 0.2.
If the last point that we moved to was 0.2, then move to 0.1.
So again,
as I mentioned before,
and just for the demonstration purposes don't run it this way but just so you can visualize
we have setpoint1 which we want to convert and using the function list to setpoint and so it takes
as an input list the setpoints which were defined at the beginning as the bunch of lines over here.
and we send it to the robot.
Then we have a thread in the robot that looks in the program and waits for us to read those register values.
If we don't have a thread then maybe using the flag we can achieve the same result and the robot is going to move to this to this value.
So at the end we are going to send a watchdog and we are also going to post sending the values and also disconnect.
So this is pretty much how it works.
and over this code and especially the code on the your script and understand how those two
programs are being semi-chronized such that one works when the other works I think this is the main point at the beginning,
it's hard to understand how to run the program in a way that one program waits for the other one to finish before a certain code is executed.
This is why watchdogs are used,
this why flags are being used,
meaning that are assigned to some register and basically tell us,
okay, now we finished certain part of the code, tell the computer that we finished, so it can execute a certain part of the code,
번역 언어
번역 언어 선택

더 많은 기능 잠금 해제

Trancy 확장 프로그램을 설치하면 AI 자막, AI 단어 정의, AI 문법 분석, AI 구술 등을 포함한 더 많은 기능을 사용할 수 있습니다.

feature cover

인기 있는 비디오 플랫폼과 호환

Trancy는 YouTube, Netflix, Udemy, Disney+, TED, edX, Kehan, Coursera 등의 플랫폼에서 이중 자막을 지원하는데 그치지 않고, 일반 웹 페이지에서 AI 단어/문장 번역, 전체 문장 번역 등의 기능도 제공하여 진정한 언어 학습 도우미가 됩니다.

다양한 플랫폼 브라우저 지원

Trancy는 iOS Safari 브라우저 확장 프로그램을 포함하여 모든 플랫폼에서 사용할 수 있습니다.

다양한 시청 모드

극장, 읽기, 혼합 등 다양한 시청 모드를 지원하여 전체적인 이중 자막 체험을 제공합니다.

다양한 연습 모드

문장 청취, 구술 평가, 선택 공백, 테스트 등 다양한 연습 방식을 지원합니다.

AI 비디오 요약

OpenAI를 사용하여 비디오 요약을 생성하여 핵심 내용을 빠르게 파악할 수 있습니다.

AI 자막

3-5분 만에 YouTube AI 자막을 생성하여 정확하고 빠른 자막을 제공합니다.

AI 단어 정의

자막에서 단어를 탭하면 정의를 검색하고 AI 단어 정의 기능을 활용할 수 있습니다.

AI 문법 분석

문장에 대한 문법 분석을 수행하여 문장의 의미를 빠르게 이해하고 어려운 문법을 습득할 수 있습니다.

더 많은 웹 기능

Trancy는 비디오 이중 자막 뿐만 아니라 웹 페이지의 단어 번역 및 전체 문장 번역 기능도 제공합니다.

시작 준비되셨나요?

Trancy를 오늘 시도하고 독특한 기능들을 직접 경험해보세요.

다운로드