ERROR: Unable to load type

Hello Makers
Did one of you can help me? I always get the same error when i looked at the rosserver info (see Figure). This happens also by other exercises.


It’s hard to tell from just the error message but make sure your import ends with .srv like:
from my_custom_srv_msg_pkg.srv import CustomServiceMessage,MyCustomServiceMessageResponse

Read the CMakeLists.txt it contains all the information needed to configure both files properly. If you still can’t get it to work post your CMakeLists.txt and package.xml so I can help some more.

1 Like

In addition to what @hskramer said (thanks @hskramer), the error message is saying you are yet to build your custom service message, which could mean you are yet to run catkin_make (successfully) after creating the custom message. It could also mean that you are yet to setup the service message correctly.

Since you say this is also happening in other exercises, please ensure you are creating the required files correctly and you are modifying CMakeLists.txt and package.xml correctly. You also need to run source devel/setup.bash after catkin_make, on every shell where you want to use the custom message or service or action.

You may need to go over the examples again until you get the hang of everything.

So typically after setting everything up correctly, you need to compile the package again:

cd ~/catkin_ws/
source devel/setup.bash  # you also need to run this command on any other terminal you want to use

I have looked at the my_custom_srv_msg_pkg.srv and it ends with .srv.
Also, i had run catkin_make and additionally i tried to delete the the build directory and run catkin_make and after that i sourced the devel/setup.bash file.

Here is the CMakeLists.txt and the package.xml

CMakeLists package

I hope you can help me.

I got the problem. You must type source devel/setup.bash in every WebShell that it works.

1 Like