Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 417

Message filter errors

$
0
0
I have tried to to solve the error in my code by going through the suggestions on previous answers on the message_filter topic but it hasn't solved the error. This is my first time trying to run a message_filter based code, which i took from an example on ros answers. The code is as follows #include #include "std_msgs/String.h" #include #include using namespace message_filters; void callback(const std_msgs::String::ConstPtr& msg,const std_msgs::String::ConstPtr& msg2) { ROS_INFO("IT WORKS"); } int main(int argc, char** argv) { ros::init(argc, argv, "db_creator_node"); ros::NodeHandle nh; message_filters::Subscriber rgb_sub(nh,"/camera/rgb/image_rect",1); message_filters::Subscriber dpt_sub(nh,"/camera/depth/image_rect_raw",1); TimeSynchronizer sync(rgb_sub,dpt_sub,10); sync.registerCallback(boost::bind(&callback, _1, _2)); ros::spin(); return 0; } My CMakeLists.txt is as follows cmake_minimum_required(VERSION 2.8.3) project(functionblocks) find_package(catkin REQUIRED COMPONENTS pluginlib roscpp std_msgs message_generation message_filters ) ## System dependencies are found with CMake's conventions find_package(Boost REQUIRED COMPONENTS system) generate_messages( DEPENDENCIES std_msgs ) include_directories( ${catkin_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ) include_directories(include ${catkin_INCLUDE_DIRS} ${Boost_LIBRARIES}) add_executable(testing_filter src/testing_filter.cpp) target_link_libraries(testing_filter ${catkin_LIBRARIES} ${Boost_LIBRARIES}) add_dependencies(testing_filter functionblocks_generate_messages_cpp) Catkin_make does gives a lot of errors and also states that cc1plus: warning: /usr/lib/i386-linux-gnu/libboost_system.so: not a directory I do not what should be added to the CMakeLists.txt or the error in the code. Thanks!

Viewing all articles
Browse latest Browse all 417

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>