cannot launch node of type [fcm_control/control_manager]: can't locate node [control_manager] in package [fcm_control]
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
Can you also post the contents of your
CMakeLists.txt
?