ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

cannot launch node of type [fcm_control/control_manager]: can't locate node [control_manager] in package [fcm_control]

asked 2015-07-15 07:37:30 -0500

prrraveen gravatar image

updated 2015-07-15 09:24:42 -0500

I am getting above error when launching the launch file. I am not able to debug this issue.I went through all the ros answers with similar problem.

I have sourced the setup.bash after catkin_make

this is my launch file

<launch>
    <!-- Load joint controller configurations from YAML file to parameter server -->
    <rosparam file="$(find fcm_control)/src/JointSplineTrajectoryController.yaml" command="load" />
    <!-- <rosparam file="$(find fcm)/control/src/joint_trajectory_action.yaml" command="load" /> -->

    <!-- load the controller -->
    <node name="control_manager1" pkg="fcm_control" type="control_manager" respawn="false"
        output="screen" ns="fcm" args="linear_rail_controller" />

</launch>

This is the node file control_manager.cpp

#include <ros/ros.h>
#include <fcm_hw/fcm.h>
#include <controller_manager/controller_manager.h>

int main(int argc , char **argv)
{
    //setup
    ros::init(argc , argv , "my_robot");

    MyRobot::MyRobot robot;
    controller_manager::ControllerManager cm(&robot);

    ros::AsyncSpinner spinner(1);
    spinner.start();

    //control loop
    ros::Time prev_time = ros::Time::now();
    ros::Rate rate(10.0);

    while(ros::ok())
    {
        const ros::Time time = ros::Time::now();
        const ros::Duration period = time - prev_time;

        robot.read();
        cm.update(time , period);
        robot.write();

        rate.sleep();
    }
    return 0;
}

CMakeList.txt

cmake_minimum_required(VERSION 2.8.3)
project(fcm_control)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
  roscpp
  rospy
  std_msgs
)


###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if you package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
#  INCLUDE_DIRS include
#  LIBRARIES fcm_control
#  CATKIN_DEPENDS roscpp rospy std_msgs
#  DEPENDS system_lib
)

###########
## Build ##
###########

## Specify additional locations of header files
## Your package locations should be listed before other locations
# include_directories(include)
include_directories(
  ${catkin_INCLUDE_DIRS}
)

my package directory

.
├── CMakeLists.txt
├── include
│   └── fcm_control
├── launch
│   ├── control.launch
│   └── display.launch
├── package.xml
└── src
    ├── control_manager.cpp
    ├── fcm.cpp
    ├── JointSplineTrajectoryController.yaml
    ├── joint_trajectory_action.yaml
    ├── readme.txt
    └── temp.py
edit retag flag offensive close merge delete

Comments

Can you also post the contents of your CMakeLists.txt?

mgruhler gravatar image mgruhler  ( 2015-07-15 08:22:22 -0500 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2015-07-15 09:54:50 -0500

mgruhler gravatar image

if this is your complete CMakeLists.txt, the solution is simple.

You are not even building the node. You need to specify in the CMakeLists.txt which source files you want to compile into which node. Add the following to your CMakeLists.txt.

add_dependencies(control_manager src/control_manager.cpp)
target_link_libraries(control_manager ${catkin_LIBRARIES})

this will tell CMake to build a node called control_manager from the source file in src/control_manager.cpp and link the catkin_LIBRARIES against it.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-07-15 07:37:30 -0500

Seen: 968 times

Last updated: Jul 15 '15