File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -8,33 +8,39 @@ This is an introduction practice for service and client
8
8
```
9
9
$ git pull origin master
10
10
```
11
- 2 . Create a folder called srv. Inside the folder create a file called "two_ints.srv".
11
+ 2 . Create a ros_package
12
+ ```
13
+ $ catkin_create_pkg service_demo std_msgs rospy
14
+ ```
15
+ 3 . Copy the nodes from the nodes from foundations_course/exercises/ros/services/src/ into the src folder of the package created
16
+
17
+ 4 . Create a folder called srv. Inside the folder create a file called "two_ints.srv".
12
18
```
13
19
$ mkdir srv
14
20
$ nano srv/two_int.srv
15
21
```
16
- 3 . In the service file create two int64 variables for the request and a int64 variable for the response
22
+ 5 . In the service file create two int64 variables for the request and a int64 variable for the response
17
23
18
- 4 . Modify CMakeLists.txt file
24
+ 6 . Modify CMakeLists.txt file
19
25
```
20
26
4.1 Inside find_package{catkin REQUIRED COMPONENTS} add message_generation,
21
27
4.2 Uncomment add_service_files(Files ) and add the name of the service file <two_ints.srv>. PS: < > not required.
22
28
4.3 Uncomment generate_messages(DEPENDENCIES std_msgs).
23
29
```
24
- 5 . Modify package.xml file
30
+ 7 . Modify package.xml file
25
31
```
26
32
5.1 Uncomment the line <build_depend>message_generation</build_depend>.
27
33
5.2 Uncommet the line <exec_depend>message_runtime</exec_depend>
28
34
NOTE: To uncomment delete the <!-- -->.
29
35
```
30
- 6 . Complete the nodes inside src/ by following the instructions.
36
+ 8 . Complete the nodes inside src/ by following the instructions.
31
37
```
32
38
Do not forget to make the nodes executable
33
39
$ chmod +x server_demo.py
34
40
$ chmod +x client_demo.py
35
41
```
36
42
37
- 7 . Build the workspace
43
+ 9 . Build the workspace
38
44
```
39
45
$ catkin build
40
46
Alternatively
You can’t perform that action at this time.
0 commit comments