Exercise 5.1 Ros Services: Clients - ERROR: cannot launch node of type

When I try to launch the service client node, I get an error as mentioned below.

I have already tried to add execution persmistions for the c++ node file by this command in terminal:
user:~/catkin_ws/src/service_client_pkg/src$ chmod 777 simple_service_client.cpp

Still same error.

I made sure of launching the Start_service.launch in another terminal and it launched fine everytime, but the client file is having issues.

cmake_minimum_required(VERSION 3.0.2)

find_package(catkin REQUIRED COMPONENTS




add_executable(simple_service_client src/simple_service_client.cpp)

add_dependencies(simple_service_client ${simple_service_client_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})



<?xml version="1.0"?> service_client_pkg 0.0.0 The service_client_pkg package




Hello @mchauhan,

what is the output of running:
cd ~/catkin_ws
and then
does the package compile without errors?

After compiling did you source the workspace, like this:
source devel/setup.bash

Do you get the same error after compiling, sourcing and then launching the service client?

If so, what is the content of the launch file for the service client?

Please add these additional details that will help me to understand what might be causing this issue.



hello @rzegers

I just repeated the process to well explain it well.
It seems weird when i do catkin_make, the ws compiles way too quickly, so i have doubts that client node doesn’t compile at all.

Answers to your questions-
what is the output of running:
cd ~/catkin_ws

does the package compile without errors? - Yes the project compiles with no errors. The error is only when i launch client node. Source setup.bash after catkin_make (in all terminals).

Here I launch the Service (service provider node) start_launch.launch

Once I know it is waiting for a service to call it , I call the service by launching the client node in a new terminal with Service running in first terminal as shown below:

Here is the launch file:

By the way thanks for taking time and helping me out. :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.