1

00:00:06,420  -->  00:00:11,743
Now we are going to learn about the very lightweight simulator turtlesim

2

00:00:11,743  -->  00:00:17,715
it provide all the basic functionalities of ros2 that a bigginer needs to learn

3

00:00:17,715  -->  00:00:19,716
so open up your terminal

4

00:00:28,740  -->  00:00:33,300
in order to install the turtlesim
 you first need to update

5

00:00:42,000  -->  00:00:56,520
so now you can install this package using sudo
apt install ROS its distro foxy and turtlesim

6

00:00:58,980  -->  00:01:09,480
so this is the command to download or to
install a package in ros base workspace first

7

00:01:09,480  -->  00:01:17,880
we type sudo apt install and then the ros distro
if its foxy then we will write foxy if

8

00:01:17,880  -->  00:01:22,432
it's humble then we will write humble and then the pakage name so

9

00:01:22,533  -->  00:01:43,560
let's give it a try it is installed and now we can find out the executable files
in this package ros2 package executable turtlesim

10

00:01:46,140  -->  00:01:51,420
so it has given us a list of
the Node that we can utilize

11

00:01:52,320  -->  00:02:01,380
so let first write ros2
run turtlesim

12

00:02:04,620  -->  00:02:14,280
Node so a window appears so this is the first
simulator that we utilize to learn the basic

13

00:02:14,280  -->  00:02:22,980
ros Concepts we can move our Turtle around
play with the several parameters and services

14

00:02:24,420  -->  00:02:34,800
so open another terminal and we are
going to control it ros2 run

15

00:02:37,140  -->  00:02:43,860
turtlesim  turtle underscore

16

00:02:44,460  -->  00:02:51,780
teleop keys okay so it has created a Node
that can move the turtle around so you can

17

00:02:52,380  -->  00:03:01,080
press forward backward key right to rotate it to
right left to rotate it to left right and left

18

00:03:02,220  -->  00:03:09,240
so  you can play with it as it moves it
draws a line it's pretty fun to play with it

19

00:03:09,240  -->  00:03:11,530
and you can also choose these letters to

20

00:03:11,530  -->  00:03:19,800
rotate to absolute orientation so let's press G

21

00:03:22,440  -->  00:03:31,560
G and P C and D you can play with
it and F to cancel the rotation

22

00:03:32,940  -->  00:03:41,640
so if I press like G and then suddenly I
press F it will stop right there

23

00:03:41,640  -->  00:03:52,680
To quit this node we can press Q and we are going to see the
Node list ros2 Node list so we currently

24

00:03:52,680  -->  00:04:03,060
have one node that is turtlesim and we can also see
the topics ros2  topic list so these are

25

00:04:03,060  -->  00:04:11,220
the topic currently I know you do not understand
the topic and nodes and services parameters but

26

00:04:11,220  -->  00:04:19,920
 you will learn them in the next lectures
uh you just get an idea and ros2 service

27

00:04:22,260  -->  00:04:37,380
list and these are a bunch of services that
this node contains and ros2 action list so it

28

00:04:37,380  -->  00:04:45,600
has also an action now we will install the rqt.rqt
is a tool that will allow you to monitor

29

00:04:45,600  -->  00:04:53,460
subscribe or publish onto a topic and it will even
allow you to call services to install this tool

30

00:04:53,460  -->  00:05:03,960
we will just copy this command and paste it here
enter your password to just update the system and now

31

00:05:22,020  -->  00:05:28,020
so now the tool is installed we can type rqt and

32

00:05:33,060  -->  00:05:40,980
appeared so it is showing me the topics we
can monitor them and the message type of

33

00:05:40,980  -->  00:05:48,840
the topic and the value So currently we are
not monitoring any of the topic. Let's

34

00:05:49,500  -->  00:05:55,620
click here so this command velocity
topic has several values in it currently

35

00:05:55,620  -->  00:05:59,880
there is no data being published on this
topic I will just open another terminal

36

00:06:01,260  -->  00:06:13,740
Okay ros2  run turtlesim
turtle_teleop_key yes

37

00:06:18,660  -->  00:06:21,960
drag it down and move the turtle around

38

00:06:26,280  -->  00:06:30,720
so here you can see it get
the data and the frequency

39

00:06:31,920  -->  00:06:38,760
this is how you can monitor the topic
on rqt now no data is being published on

40

00:06:38,760  -->  00:06:46,020
this topic so it is giving us no frequency but
if I move the robot around it will give us

41

00:06:46,020  -->  00:06:57,720
some value of frequency it also shows the X and
linear X and rotational z that we give it using

42

00:06:57,720  -->  00:07:04,620
the tally operation let's just uncheck this
topic and let's check the pose of the turtle

43

00:07:06,480  -->  00:07:12,900
move the turtle around it is giving us the
value of the pose of the turtle in the

44

00:07:12,900  -->  00:07:20,520
turtlesim window this is the frequency more than
62 and the value of x and the theta

45

00:07:21,120  -->  00:07:28,320
let's just play a little bit more so
 you can see it is changing it's pose

46

00:07:30,420  -->  00:07:37,860
as I move it around in the window so now we will
try to call some services and check the topic and

47

00:07:37,860  -->  00:07:48,780
go to the plugin and select service caller
so here we have the service caller okay here

48

00:07:48,780  -->  00:07:55,980
it is the service that is clear we have a list of
other services that we can utilize but let's just

49

00:07:56,640  -->  00:08:04,140
select clear and call so it has finished
all the lines that were on on the window

50

00:08:05,160  -->  00:08:07,080
that's again move it around

51

00:08:08,580  -->  00:08:17,640
and we will see the line select the service
reset and call so it will just reset our window

52

00:08:20,460  -->  00:08:26,280
turtle one set pen here are a bunch
of arguments that it needs to know

53

00:08:26,280  -->  00:08:36,540
and we will like set it to 255
give it any random value less than 255

54

00:08:38,280  -->  00:08:44,340
this is RGB value and width
let's increase it to four

55

00:08:46,500  -->  00:08:54,420
and call so the service is called and
yeah here you can see the difference

56

00:08:58,860  -->  00:09:07,740
so now let's call another service that is spawn I
will I selected the service spawn and it is asking

57

00:09:08,520  -->  00:09:16,620
what is the value of X Y theta and the name
of our new turtle that will be spawn in

58

00:09:16,620  -->  00:09:29,820
the window let's say two and four and the
name call here is our the second turtle

59

00:09:31,260  -->  00:09:38,040
but if I try to move I can only
move one turtle that was turtle one

60

00:09:40,260  -->  00:09:48,240
I cannot move to Turtle 2 with this
teleop now let's check the topics

61

00:09:51,000  -->  00:09:54,840
now we have turtle one and turtle two topics

62

00:09:56,220  -->  00:10:05,040
and we can also see some extra services that are
related to Turtle 2 and turtle one so here

63

00:10:05,040  -->  00:10:14,640
is the command to move the second Turtle as well
okay this is the command to move so ros2 run

64

00:10:15,540  -->  00:10:25,020
Turtle Sim turtle_teleop_key -- or dash dash

65

00:10:26,880  -->  00:10:34,980
Ros minus args these keyword will let
the ros know that the user

66

00:10:34,980  -->  00:10:40,980
want to specify an argument and what is
the argument the argument is the remap

67

00:10:43,260  -->  00:10:46,380
and remap what I want to remap turtle

68

00:10:49,860  -->  00:10:54,540
1 CMD vel

69

00:10:57,000  -->  00:10:58,800
to turtle

70

00:11:01,560  -->  00:11:02,280
2

71

00:11:04,740  -->  00:11:14,520
CMD underscore vel so why am I doing this
the default topic for this node is turtle one

72

00:11:14,520  -->  00:11:21,540
slash CMD vel but we have another
turtle that has Turtle 2 cmd vel

73

00:11:21,540  -->  00:11:27,000
topic so I will just hit enter and
try to move and here you can see

74

00:11:28,140  -->  00:11:32,340
the turtle 2 is also moving and we
can also move turtle one as well

75

00:11:34,920  -->  00:11:38,040
that must be a very exciting experience for you

76

00:11:38,040  -->  00:11:44,340
so you have learned to use the turtlesim you have monitored a topic on rqt

77

00:11:44,340  -->  00:11:50,880
and you also called several Services
related to turtlesim so that was it
