Add the installation prefix to CMAKE_PREFIX_PATH
Hi, I am trying to make a subscriber program that listens to an installed package called roscopter. I know the topic and package name. In the CMakeLists i have included the package "roscopter"
find_package(catkin REQUIRED COMPONENTS roscpp roscopter)
However, when i run catkin_make it could not find the package. If tried manually changing the CMAKE_PREFIX_PATH however the error continues.
Here is the cpp that i have:
#include <ros/ros.h>
#include <roscopter/Attitude.h>
#include <iomanip> // for std::setprecision and std::fixed
// A callback function. Executed each time a new pose
// message arrives.
void attMessageReceived(const roscopter::Attitude& msg) {
ROS_INFO_STREAM(std::setprecision(2) << std::fixed
<< "roll" << msg.roll;
}
int main(int argc, char **argv) {
// Initialize the ROS system and become a node.
ros::init(argc, argv, "subscribe_to_atttiude");
ros::NodeHandle nh;
// Create a subscriber object.
ros::Subscriber sub = nh.subscribe("Attitude", 1000,
&attMessageReceived);
// Let ROS take over.
ros::spin();
}
And the CMakeLists.txt is as follows:
# What version of CMake is needed?
cmake_minimum_required(VERSION 2.8.3)
# The name of this package.
project(agitr)
# Find the catkin build system, and any other packages on which we depend.
find_package(catkin REQUIRED COMPONENTS roscpp roscopter)
# Declare our catkin package.
catkin_package()
# Specify locations of header files.
include_directories(include ${catkin_INCLUDE_DIRS})
include_directories(include ${~/home/CATWorkspaces})
# Declare the executable, along with its source files.
add_executable(subatt subatt.cpp)
# Specify libraries against which to link.
target_link_libraries(subatt ${catkin_LIBRARIES})
Any help is highly appreciated. Thanks!
Which ROS distro are you using? I can't see roscopter as being a released catkin package anywhere.
I am using hydro on ubuntu 13.10. I was able to locate the required config files manually in the workspace. If it truly doesnt have catkin package, how should i go about doing this? Thanks for your response!
If roscopter is a rosbuild package you can not use it from a catkin package. The only option would be to also use rosbuild for your package. If there is a catkin-based version you could use that from your catkin package.
Noted. But i used catkin_make with roscopter. I followed the following steps: https://github.com/cberzan/roscopter To be exact: "catkin_make --pkg roscopter". So theoretically it should be possible right?
Noted. Thanks for assistance!