1
00:00:00,300 --> 00:00:04,020
So we have discussed about workspace and the package.

2
00:00:04,140 --> 00:00:12,060
It is a very basic thing and I assume that you understand it deeply through any Wikipedia page of Ross

3
00:00:12,060 --> 00:00:13,950
or any course that you have taken.

4
00:00:13,960 --> 00:00:16,600
I'm not going into deep detail how that works.

5
00:00:16,620 --> 00:00:19,740
We are just going to create workspace and package in it.

6
00:00:19,740 --> 00:00:28,320
So let's write the commands and I want you to be very comfortable with these commands by practice and

7
00:00:28,320 --> 00:00:28,860
let's start.

8
00:00:29,370 --> 00:00:34,590
So we are currently in our home folder and I'm going to create a directory.

9
00:00:35,970 --> 00:00:39,570
Within argument minus V because we need a subdirectory as well.

10
00:00:40,110 --> 00:00:47,130
The workspace name is going to be part planning workspace and a subdirectory inside of this workspace

11
00:00:47,130 --> 00:00:49,710
is going to be source just for now.

12
00:00:50,280 --> 00:00:54,630
Then we will move into this workspace and the source.

13
00:00:55,590 --> 00:00:59,340
Packages are going to be created in this for sauce for you too.

14
00:00:59,670 --> 00:01:00,970
So let's create a package.

15
00:01:00,990 --> 00:01:02,970
I have written the command here.

16
00:01:02,970 --> 00:01:06,780
We have it across to package create.

17
00:01:07,290 --> 00:01:13,950
Then the name of the package will type by type dependencies are sealed by any standard messages.

18
00:01:13,950 --> 00:01:17,730
Let me added just this command is hard to memorize.

19
00:01:18,360 --> 00:01:24,690
So I have written it in your repository and it will be very easy for you and for me it's but so let's

20
00:01:24,690 --> 00:01:32,700
created in the source folder package has been created and let's say the workspace call you can build.

21
00:01:34,110 --> 00:01:36,270
I'm not going to create Simulink.

22
00:01:36,300 --> 00:01:41,790
We are just going to create a simple called can build that will copy all the files into the shareholders.

23
00:01:41,790 --> 00:01:45,120
So package has been created and workspace has been built.

24
00:01:45,630 --> 00:01:49,320
So far things are working fine if there is an error with the call confining.

25
00:01:49,620 --> 00:01:53,040
You can cancel the wiki page that I have opened here for you.

26
00:01:53,910 --> 00:01:59,370
Docs not rostered or do foxy tutorials and they are in depth about all of these things.

27
00:01:59,670 --> 00:02:01,980
What I am going to do is create.

28
00:02:03,320 --> 00:02:07,250
A note of publisher subscriber to Tester workspace and package.

29
00:02:07,350 --> 00:02:11,630
Okay, so let's open the folder that we just created.

30
00:02:12,230 --> 00:02:18,830
That was part planning workspace, but planning workspace and the source folder, the maze board.

31
00:02:19,790 --> 00:02:27,650
Let's add it into our voice code so our life becomes very easy as it also gives us the capability of

32
00:02:27,650 --> 00:02:28,550
file managing.

33
00:02:29,030 --> 00:02:36,800
Here we have baseboard resources and other stuff and I assume that you know all about this stuff through

34
00:02:36,800 --> 00:02:40,190
my previous course or through Ros Vicky you can understand them.

35
00:02:40,700 --> 00:02:42,110
They are very easy, by the way.

36
00:02:42,110 --> 00:02:46,970
Or if you are not compatible, you will get after this course at the end of this course.

37
00:02:48,250 --> 00:02:53,400
Now let's create a folder named as source folder or know its roster.

38
00:02:53,410 --> 00:02:54,400
So we have this.

39
00:02:54,400 --> 00:03:00,040
Ms. but we have to write all Python related scripts inside of it, so it works like a Python package.

40
00:03:00,610 --> 00:03:08,040
What I am interested in is creating a publisher and subscriber to get started with What is this publisher?

41
00:03:08,080 --> 00:03:16,690
Note I'm going to copy the code here and you can run the Gate Command as well to obtain the file, but

42
00:03:16,690 --> 00:03:17,830
I will write the command.

43
00:03:18,580 --> 00:03:20,560
Okay, let's create a new file.

44
00:03:20,830 --> 00:03:22,930
I think its name was Docker Dot by.

45
00:03:23,930 --> 00:03:24,790
Base the game on.

46
00:03:25,220 --> 00:03:26,180
Was it a talker?

47
00:03:26,540 --> 00:03:28,850
Yes, it's a publisher, so it would be a target.

48
00:03:29,390 --> 00:03:32,900
And the next file is going to be a subscriber.

49
00:03:33,740 --> 00:03:34,610
Where is the code?

50
00:03:35,000 --> 00:03:35,780
Here is it.

51
00:03:36,140 --> 00:03:36,650
I'm going.

52
00:03:36,650 --> 00:03:38,510
Do not perform the second option.

53
00:03:39,680 --> 00:03:47,630
And let's open up the terminal control P to bring in this command pilot terminal or sorry, we have

54
00:03:47,630 --> 00:03:52,490
to press control shift B to bring the action panic dominant.

55
00:03:55,230 --> 00:03:56,340
Um.

56
00:03:57,150 --> 00:03:57,960
Create a terminal.

57
00:03:58,110 --> 00:04:00,420
It is in the maze, Bart.

58
00:04:00,450 --> 00:04:04,410
We have to bring it into another named Mes.

59
00:04:04,410 --> 00:04:08,160
But name folder inside of this means to me is what?

60
00:04:10,040 --> 00:04:15,710
If we list it, you can see we have the talker by and by these two, four years, I am going to be stuck

61
00:04:15,820 --> 00:04:21,380
on the blue grid and it is going to download the file subscriber member function.

62
00:04:21,380 --> 00:04:25,040
I'm going to rename it to be less net.

63
00:04:26,480 --> 00:04:26,800
Okay.

64
00:04:27,110 --> 00:04:29,630
I think the spellings are wrong, but I don't get.

65
00:04:31,000 --> 00:04:36,820
We have two files, and what we need to do now is to build the package.

66
00:04:37,660 --> 00:04:42,010
What executables of Python does this package needs to create?

67
00:04:42,400 --> 00:04:45,130
That thing is going to be happening in the set of five.

68
00:04:45,670 --> 00:04:49,380
I'm doing it fast because I want you to get started with the maze.

69
00:04:49,390 --> 00:04:56,050
Solving this is just basics, but I am giving you a refresher for that and I'm going to just copy and

70
00:04:56,050 --> 00:05:02,920
paste the commands from the wiki so you can get a deeper understanding from this wiki, not this lecture.

71
00:05:03,370 --> 00:05:13,960
And this is the process of adding entry point into your python based package so your package can understand

72
00:05:13,960 --> 00:05:20,320
what executable files to show to the ROS system and produce name is going to be Docker.

73
00:05:20,320 --> 00:05:22,510
I'm going to add it to be Docker node.

74
00:05:22,780 --> 00:05:27,490
This is the name that we will use to call this executable.

75
00:05:29,780 --> 00:05:32,300
The name of our package is Baseboard Board.

76
00:05:32,300 --> 00:05:34,430
So here we have the Mays bought.

77
00:05:35,460 --> 00:05:42,090
Package name, publisher, member function and the file name which is Docker Anarchy.

78
00:05:42,100 --> 00:05:44,370
So I am going to copy and paste Docker.

79
00:05:45,510 --> 00:05:47,280
Docker, just docker, not the BI.

80
00:05:47,550 --> 00:05:52,770
So I'm going to copy and paste it again because we have a subscriber as well.

81
00:05:53,670 --> 00:05:55,260
I just need to confirm one thing.

82
00:05:55,260 --> 00:05:55,650
Okay.

83
00:05:57,480 --> 00:06:01,170
The name is going to be subscriber?

84
00:06:01,650 --> 00:06:02,070
No.

85
00:06:03,080 --> 00:06:03,890
And.

86
00:06:04,880 --> 00:06:06,800
The name of the file is Listener.

87
00:06:07,400 --> 00:06:14,430
The basic syntax is you give the name of the package, you give the name of the code containing file

88
00:06:14,450 --> 00:06:15,080
the script.

89
00:06:15,440 --> 00:06:19,970
And what function do we need to call when we run your main function?

90
00:06:19,970 --> 00:06:26,600
In both of these files, we have this main function which we are calling now in setup goodbye file.

91
00:06:26,870 --> 00:06:33,380
These names are actually the names we will be using to call these functions, to call these files.

92
00:06:33,860 --> 00:06:35,600
So everything is fine.

93
00:06:35,600 --> 00:06:36,980
Let's perform calls.

94
00:06:37,730 --> 00:06:40,300
So these files get copied into the shared food.

95
00:06:40,850 --> 00:06:51,950
Now let's run it across to run and the name of the files word listener dot by and they are not available.

96
00:06:52,850 --> 00:07:02,810
The reason that I wanted to bring you here was we have to source our package with this source install.

97
00:07:05,100 --> 00:07:06,690
In store develop.

98
00:07:08,270 --> 00:07:08,670
Uh.

99
00:07:08,930 --> 00:07:10,130
What was it installed?

100
00:07:10,130 --> 00:07:10,490
Set up.

101
00:07:10,700 --> 00:07:11,100
Bash.

102
00:07:11,900 --> 00:07:13,640
What is happening here?

103
00:07:13,670 --> 00:07:14,600
Let me show you.

104
00:07:15,200 --> 00:07:16,790
So we have our package here.

105
00:07:16,790 --> 00:07:22,610
Part planning workspace in which we have these folders automatically created.

106
00:07:22,610 --> 00:07:24,260
We created just the source folder.

107
00:07:24,680 --> 00:07:32,870
But to make this workspace available to all of the ROS installation in this system or a virtual environment,

108
00:07:33,230 --> 00:07:39,080
we need to source a file of this workspace and that is this setup dot bash file.

109
00:07:39,560 --> 00:07:44,420
So I am writing this command inside of this folder, which is what folder?

110
00:07:44,420 --> 00:07:47,960
Go inside of the install folder and source this file.

111
00:07:48,320 --> 00:07:50,570
Let's source it.

112
00:07:50,720 --> 00:07:52,020
It has been source.

113
00:07:52,040 --> 00:07:52,430
Okay.

114
00:07:52,940 --> 00:07:58,460
Now we need to run those nodes that we created for us to run.

115
00:07:59,240 --> 00:08:06,560
And the name of the package is the name of the package was RMS bought previously?

116
00:08:06,560 --> 00:08:09,590
If I would have written me as but it should not appear.

117
00:08:09,590 --> 00:08:12,320
And I give you an example of listener directly.

118
00:08:12,590 --> 00:08:18,020
First, we need to write the name of the package and then name of the nodes.

119
00:08:18,020 --> 00:08:20,150
I'm double pressing the tab button.

120
00:08:20,150 --> 00:08:22,820
It is providing me all of the available options.

121
00:08:23,210 --> 00:08:26,660
So subscriber node and let's run it.

122
00:08:28,120 --> 00:08:31,490
There will be no output for one reason there is no listener.

123
00:08:31,840 --> 00:08:33,880
So let's open up a new terminal.

124
00:08:34,510 --> 00:08:35,830
And then.

125
00:08:36,870 --> 00:08:38,230
Execute the same thing.

126
00:08:38,250 --> 00:08:38,670
Me?

127
00:08:38,730 --> 00:08:41,400
What I'm pressing, Gavin, is not completing.

128
00:08:41,850 --> 00:08:49,470
And the reason is, whenever you open up a new terminal, you need to source the workspace you want

129
00:08:49,470 --> 00:08:50,160
to access.

130
00:08:50,760 --> 00:08:55,020
I know it is dieting, but I have a solution for that and.

131
00:08:56,170 --> 00:08:59,500
I'll show you the solution after this video.

132
00:08:59,920 --> 00:09:07,490
Ross to run maze pressing tap, I press step to confirm that it is automatically picking up the names

133
00:09:07,840 --> 00:09:13,090
Maze Board and the name of the file was Docker dot by right.

134
00:09:13,900 --> 00:09:21,040
If I now press enter and see the output of the subscriber, you can see both of these things are communicating

135
00:09:21,040 --> 00:09:22,900
with each other that how do I know that?

136
00:09:22,900 --> 00:09:23,890
Let's confirm it.

137
00:09:23,890 --> 00:09:31,030
With the help of our cute graph, which is the last thing that gives us information about nodes communicating

138
00:09:31,030 --> 00:09:31,720
with each other.

139
00:09:31,720 --> 00:09:35,140
Okay, you just need to write it up.

140
00:09:35,230 --> 00:09:36,380
No, Ross, do it on all.

141
00:09:36,390 --> 00:09:42,730
Although you get so minimum publisher is publishing and subscriber is subscribing on the name of the

142
00:09:42,730 --> 00:09:44,260
topic is topic.

143
00:09:44,260 --> 00:09:46,030
Let's take a look on the code now.

144
00:09:47,150 --> 00:09:49,070
So we have these two things.

145
00:09:49,820 --> 00:09:52,790
If I try to enlarge it now, they are fine.

146
00:09:53,600 --> 00:09:57,020
If I delete the command and see it in one video.

147
00:09:58,160 --> 00:09:59,210
In one window.

148
00:10:01,070 --> 00:10:06,200
This is the docket the talker is publishing on this topic.

149
00:10:06,440 --> 00:10:10,100
And then messages are sent into the buffer.

150
00:10:10,110 --> 00:10:19,730
The data type, as this time period is 0.00.5, meaning every second two packets are sent.

151
00:10:20,450 --> 00:10:26,810
The data is of string data type and this is going to be stored in the data and then it is going to be

152
00:10:26,810 --> 00:10:34,710
published and printed on this dominant on which this talk is coming to the next site whenever we run

153
00:10:34,710 --> 00:10:35,630
the subscriber.

154
00:10:36,700 --> 00:10:38,260
In an object oriented way.

155
00:10:38,260 --> 00:10:40,150
It has created a subscriber.

156
00:10:40,510 --> 00:10:47,500
And whenever the subscriber on this specific topic obtains any information, it is going to be calling

157
00:10:47,860 --> 00:10:49,210
this function.

158
00:10:49,300 --> 00:10:50,530
Listener callback.

159
00:10:50,740 --> 00:10:54,580
The listener callback is just printing what it has received from.

160
00:10:54,820 --> 00:10:59,050
I heard the this string and message data.

161
00:10:59,290 --> 00:11:01,480
So it is giving information.

162
00:11:02,110 --> 00:11:04,240
This publisher is giving information.

163
00:11:04,720 --> 00:11:06,280
Hello, world two, two, two.

164
00:11:06,550 --> 00:11:09,280
And this subscriber is getting information.

165
00:11:09,280 --> 00:11:09,880
I heard.

166
00:11:09,880 --> 00:11:10,470
Hello World.

167
00:11:10,710 --> 00:11:17,620
So this was the basic publisher subscriber and our workspace and package is set.

168
00:11:18,040 --> 00:11:23,710
Now we need to move towards making of the report and I am assuming that you have basic understanding

169
00:11:23,710 --> 00:11:24,760
of ROS workflow.
