Services's Course(C++) Error

Although, i gave permission to the code file but I still get this error “ERROR: cannot launch node of type [service_server_pkg/simple_service_server]: Cannot locate node of type [simple_service_server] in package [service_server_pkg]. Make sure file exists in package path and permission is set to executable (chmod +x)”
i cant move on in course cause it.
any help please

1 Like

Ensure the “chmod +x” of the file and chek any misspelling.

1 Like

Every thing is ok and I checked it again and again , but its not working.

3
@u1802520
@rosjects
@bayodesegun
@albertoezquerro

Hi, have you checked that you have added the executable in CMakeLists.txt and the corresponding changes in package.xml that the instructions specify with the correct names? I can’t tell with the information you’ve provided.

Sometimes the system doesn’t find the node until you compile and source your environment:

cd catkin_ws/
rm -rf build/ devel/
catkin_make
source devel/setup.bash
rospack profile
1 Like

Thank you so much .You solved my problem, After i execute < rm -rf build /devel >it worked.
could you explain How this command solved the problem.

It’s because sometimes after making to modifications to your packages, the build/ and devel/ folders that were compiled in the past aren’t compatible anymore. I wouldn’t be able to point to your case, but removing those folders is a good check since they are generated every time you run catkin_make

2 Likes

Hello all!
I get the same error for some weird reason, only i follow (and in fact copy) the solution for exercise 3.4 at unit 6 (

ERROR: cannot launch node of type [unit_3_services/bb8_move_in_circle_service_server]: Cannot locate node of type [bb8_move_in_circle_service_server] in package [unit_3_services]. Make sure file exists in package path and permission is set to executable (chmod +x))

I copied exactly the solution (in case i was doing something wrong), also deleted the build devel and sourced again but I still get the same error. I don’t undestand why…

Hi, I just went into your account and tried to launch the server and everything worked fine after compiling:

user:~/catkin_ws$ roslaunch unit_3_services start_bb8_move_in_circle_service_server.launch
... logging to /home/user/.ros/log/024706ee-e2dd-11eb-b9ca-0242ac160008/roslaunch-5_xterm-1871.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://5_xterm:36021/

SUMMARY
========

PARAMETERS
 * /rosdistro: noetic
 * /rosversion: 1.15.9

NODES
  /
    service_move_bb8_in_circle_server (unit_3_services/bb8_move_in_circle_service_server)

ROS_MASTER_URI=http://5_simulation:11311

process[service_move_bb8_in_circle_server-1]: started with pid [1879]
[ INFO] [1626072739.039150990]: Service /move_bb8_in_circle_custom Ready