# In CMakeLists configuration for saving spots to files

**URL:** <https://get-help.theconstruct.ai/t/in-cmakelists-configuration-for-saving-spots-to-files/8275>\
**Category:** Mastering with ROS - SUMMITXL\
**Created:** [February 15, 2021, 11:56pm UTC](https://get-help.theconstruct.ai/t/in-cmakelists-configuration-for-saving-spots-to-files/8275 "2021-02-15T23:56:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![adeoduye](https://get-help.theconstruct.ai/letter_avatar_proxy/v4/letter/a/e79b87/32.png) [@adeoduye](https://get-help.theconstruct.ai/u/adeoduye)\
**Post date:** [February 15, 2021, 11:56pm UTC](https://get-help.theconstruct.ai/t/in-cmakelists-configuration-for-saving-spots-to-files/8275/1 "2021-02-15T23:56:28Z")

</div>

The provided code is :

> add\_service\_files(  
> FILES  
> MyCustomServiceMessage.srv  
> )

but there is no MyCustomServiceMessage in the srv directory.

Is that supposed to be **SummitXLPose.srv**??

And . . . if it is, where do we get **SummitXLPoseResponse** and **SummitXLPoseRequest** from in the following line of the python service script ?

> from my\_summit\_xl\_tools.srv import SummitXLPose, SummitXLPoseResponse, SummitXLPoseRequest

---

<div class="post-metadata">

**Author:** ![albertoezquerro](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/albertoezquerro/32/7031_2.png) [@albertoezquerro](https://get-help.theconstruct.ai/u/albertoezquerro)\
**Post date:** [February 16, 2021, 8:55am UTC](https://get-help.theconstruct.ai/t/in-cmakelists-configuration-for-saving-spots-to-files/8275/2 "2021-02-16T08:55:07Z")

</div>

Hello @adeoduye ,

Yes, that’s an error in the notebook. The message file is **SummitXLPose.srv**. Whenever you compile a Service message (.srv), 2 extra messages are generated, which correspond to the request and response messages of a service (you can learn more about this in the **ROS Basics** course). These messages are:

`<your_service_msg>Request` - the request part of the message  
`<your_service_msg>Response` - the response part of the message

Hope this helps,

---

<div class="post-metadata">

**Author:** ![adeoduye](https://get-help.theconstruct.ai/letter_avatar_proxy/v4/letter/a/e79b87/32.png) [@adeoduye](https://get-help.theconstruct.ai/u/adeoduye)\
**Post date:** [February 16, 2021, 7:15pm UTC](https://get-help.theconstruct.ai/t/in-cmakelists-configuration-for-saving-spots-to-files/8275/3 "2021-02-16T19:15:36Z")

</div>

Grasias Alberto.

But I have a problem with the extra messages. They are not being generated.

I have this in package.xml:

> ```
> <build_depend>message_generation</build_depend>
> <build_export_depend>message_generation</build_export_depend>
> <exec_depend>message_runtime</exec_depend>
> 
> ```
> 
> \<buildtool\_depend\>catkin\</buildtool\_depend\>  
> \<build\_depend\>rospy\</build\_depend\>  
> \<build\_export\_depend\>rospy\</build\_export\_depend\>  
> \<exec\_depend\>rospy\</exec\_depend\>

And in CMakeList.txt:

> cmake\_minimum\_required(VERSION 3.0.2)  
> project(my\_summit\_xl\_tools)
> 
> find\_package(catkin REQUIRED COMPONENTS  
> rospy  
> std\_msgs  
> message\_generation  
> )
> 
> ## Generate services in the ‘srv’ folder
> 
> add\_service\_files(  
> FILES  
> SummitXLPose.srv  
> )
> 
> ## Generate added messages and services with any dependencies listed here
> 
> generate\_messages(  
> DEPENDENCIES  
> std\_msgs # Or other packages containing msgs  
> )
> 
> catkin\_package(
> 
> # INCLUDE\_DIRS include
> 
> # LIBRARIES my\_summit\_xl\_tools
> 
> CATKIN\_DEPENDS  
> rospy
> 
> # DEPENDS system\_lib
> 
> )
> 
> include\_directories(
> 
> # include
> 
> ${catkin\_INCLUDE\_DIRS}  
> )

And the script, as copied and pasted, generates an error:

**user:~/catkin\_ws$** _rosrun my\_summit\_xl\_tools spots\_to\_file.py_

> Traceback (most recent call last):  
> File “/home/user/catkin\_ws/src/my\_summit\_xl\_tools/src/spots\_to\_file.py”, line 4, in   
> from my\_summit\_xl\_tools.srv import SummitXLPose, SummitXLPoseResponse, SummitXLPoseRequest  
> ImportError: No module named my\_summit\_xl\_tools.srv

---

<div class="post-metadata">

**Author:** ![albertoezquerro](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/albertoezquerro/32/7031_2.png) [@albertoezquerro](https://get-help.theconstruct.ai/u/albertoezquerro)\
**Post date:** [February 17, 2021, 9:04am UTC](https://get-help.theconstruct.ai/t/in-cmakelists-configuration-for-saving-spots-to-files/8275/4 "2021-02-17T09:04:44Z")

</div>

Hello @adeoduye ,

Have you compiled and sourced the web shells before trying to run the program?

```
catkin_make
source ~/catkin_ws/devel/setup.bash

```

This is mandatory so that your program can find the messages. Maybe it would also be a good idea to have a look at the Services Units in the [ROS Basics in 5 Days](https://app.theconstructsim.com/#/Course/55) course so that you can better understand how services (and services messages) work.

Best,
