Skip to content

Commit f72a3d4

Browse files
ErickKrameralex-mitrevski
authored andcommitted
Update patterns.md
I instruct them to create a new rospackage and to copy the nodes from the repository.
1 parent 8dcd03d commit f72a3d4

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

content/ros/patterns.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,39 @@ This is an introduction practice for service and client
88
```
99
$ git pull origin master
1010
```
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".
1218
```
1319
$ mkdir srv
1420
$ nano srv/two_int.srv
1521
```
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
1723

18-
4. Modify CMakeLists.txt file
24+
6. Modify CMakeLists.txt file
1925
```
2026
4.1 Inside find_package{catkin REQUIRED COMPONENTS} add message_generation,
2127
4.2 Uncomment add_service_files(Files ) and add the name of the service file <two_ints.srv>. PS: < > not required.
2228
4.3 Uncomment generate_messages(DEPENDENCIES std_msgs).
2329
```
24-
5. Modify package.xml file
30+
7. Modify package.xml file
2531
```
2632
5.1 Uncomment the line <build_depend>message_generation</build_depend>.
2733
5.2 Uncommet the line <exec_depend>message_runtime</exec_depend>
2834
NOTE: To uncomment delete the <!-- -->.
2935
```
30-
6. Complete the nodes inside src/ by following the instructions.
36+
8. Complete the nodes inside src/ by following the instructions.
3137
```
3238
Do not forget to make the nodes executable
3339
$ chmod +x server_demo.py
3440
$ chmod +x client_demo.py
3541
```
3642

37-
7. Build the workspace
43+
9. Build the workspace
3844
```
3945
$ catkin build
4046
Alternatively

0 commit comments

Comments
 (0)