Exercise 3.2 - Error: cannot launch node can't locate node

Hi,

I am having some trouble doing Exercise 3.2. I ended up copying over the provided solution and testing it. The package built successfully. But when running the launch file I am getting the following error:

ERROR: cannot launch node of type [service_32/execute_trajectory]: can’t locate node [execute_trajectory] in package [service_32]

The setup I have is the exact same as the one provided in the solution.

I also keep getting IDE error highlights but the package builds successfully:

Any help would be appreciated.

Thank you.

Hi @tuf01133,

Thanks for contacting us and welcome to the Community!

This error indicates that your C++ file has not been built, and this is most likely because the changes that need to be made in CMakeLists.txt have not been made. When you create a C++ source file, you need to make some changes in CMakeLists.txt so that an executable file can be build for it.

It could also be that the name specified in the launch file is different from the one specified in CMakeLists.txt.

Please check these points and let us know.

Hi,

Thank you for your response. I have built the package successfully

My launch file contains:

< launch>
< include file="$(find iri_wam_reproduce_trajectory)/launch/start_service.launch"/>

<node pkg ="service_32"
    type="execute_trajectory"
    name="execute_trajectory_node"
    output="screen">

< /node>
launch>

My CMakeLists contains:

cmake_minimum_required(VERSION 2.8.3)
project(service_32)

find_package(catkin REQUIRED COMPONENTS
roscpp
iri_wam_reproduce_trajectory
std_msgs
roslib
)

include_directories(
${catkin_INCLUDE_DIRS}
)

add_executable(service_32 src/execute_trajectory.cpp)
add_dependencies(service_32 ${execute_trajectory_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(service_32
${catkin_LIBRARIES}
)

I am not able to see how this differs from the given solution for the exercise.

Thank you!

Ok, I see it now. I used the package name instead of the executable name in CMakeLists. I rebuilt and it worked.

Thank you.

1 Like