[Solved] Issue with action_controller_node in Tutorial 4

I have been following the Husarion ROS tutorials for the ROSBot 2.0 Pro, specifically this tutorial (Visual object recognition | Husarion). I noticed I was getting an error when trying to run the code that makes decisions when recognizing an object. Specifically when I create the action_controller.cpp code and edit the CMakeLists.txt file in order for the launch file to run that code.

The error I get is:

Error: cannot launch node of type [tutorial_pkg/action_controller_node]: Cannot locate node of type [action_controller_node] in package [tutorial_pkg]. Make sure file exists in package path and permissions is set to executable 

I followed the tutorial as closely as possible. I think the error is when I have to edit CMakeLists.txt:

Last thing to do is editting the CMakeLists.txt file. Find line:

add_executable(tutorial_pkg_node src/tutorial_pkg_node.cpp)

Copy

and add below code after it:

add_executable(action_controller_node src/action_controller.cpp)

Copy

Find also:

target_link_libraries(tutorial_pkg_node    ${catkin_LIBRARIES})

Copy

and add below code after it:

target_link_libraries(action_controller_node    ${catkin_LIBRARIES})

I am confused on how to proceed. I am copying all of the code on the tutorial and I am using the launch file they provide, specifically this line for the action controller node:

I am working on Noetic version 1.15.14., but I will like to upgrade to the panther whenever I can get all of my code working on this rosbot.

Thank you all in advance

Hi musicboy,

It looks like you forgot to build your node. You should always build cpp nodes using catkin_make after creating or modifying them. If you built it and it still does not work try cleaning catkin workspace with catkin clean and building it again.

Regards,
Dawid

Hello Dawid,

Thanks for your reply, you were right it seems like I did forget to build my node. Running catkin_make seems to fix the problem, but I don’t think my version of ROS recognizes catkin clean as a command, but I don’t think that will be an issue.

Thanks again!