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

Image_proc fails with segmentation fault on ros::spin()

$
0
0
Hi, I'm trying to run this node: #include #include #include int main(int argc, char **argv) { ros::init(argc, argv, "image_proc"); // Check for common user errors if (ros::names::remap("camera") != "camera") { ROS_WARN("Remapping 'camera' has no effect! Start image_proc in the " "camera namespace instead.\nExample command-line usage:\n" "\t$ ROS_NAMESPACE=%s rosrun image_proc image_proc", ros::names::remap("camera").c_str()); } if (ros::this_node::getNamespace() == "/") { ROS_WARN("Started in the global namespace! This is probably wrong. Start image_proc " "in the camera namespace.\nExample command-line usage:\n" "\t$ ROS_NAMESPACE=my_camera rosrun image_proc image_proc"); } // Shared parameters to be propagated to nodelet private namespaces ros::NodeHandle private_nh("~"); ROS_INFO("Step1"); XmlRpc::XmlRpcValue shared_params; int queue_size; if (private_nh.getParam("queue_size", queue_size)) shared_params["queue_size"] = queue_size; nodelet::Loader manager(false); // Don't bring up the manager ROS API nodelet::M_string remappings; nodelet::V_string my_argv; ROS_INFO("Step2"); // Debayer nodelet, image_raw -> image_mono, image_color std::string debayer_name = ros::this_node::getName() + "_debayer"; manager.load(debayer_name, "image_proc/debayer", remappings, my_argv); // Rectify nodelet, image_mono -> image_rect std::string rectify_mono_name = ros::this_node::getName() + "_rectify_mono"; if (shared_params.valid()) ros::param::set(rectify_mono_name, shared_params); manager.load(rectify_mono_name, "image_proc/rectify", remappings, my_argv); ROS_INFO("Step3"); // Rectify nodelet, image_color -> image_rect_color // NOTE: Explicitly resolve any global remappings here, so they don't get hidden. remappings["image_mono"] = ros::names::resolve("image_color"); remappings["image_rect"] = ros::names::resolve("image_rect_color"); ROS_INFO("Step4"); std::string rectify_color_name = ros::this_node::getName() + "_rectify_color"; if (shared_params.valid()) ros::param::set(rectify_color_name, shared_params); ROS_INFO("Step5"); manager.load(rectify_color_name, "image_proc/rectify", remappings, my_argv); ROS_INFO("Step6"); // Check for only the original camera topics ros::V_string topics; ROS_INFO("Step7"); topics.push_back(ros::names::resolve("image_raw")); topics.push_back(ros::names::resolve("camera_info")); ROS_INFO("Step8"); image_proc::AdvertisementChecker check_inputs(ros::NodeHandle(), ros::this_node::getName()); ROS_INFO("Step9"); check_inputs.start(topics, 60.0); ros::spin(); ROS_INFO("Step10"); return 0; } However, every time I run it, it goes through it's lines (look at the ROS_INFO(StepX)) and then when it reaches the end, it just fails. peter@peter:~/brokenGlasses$ ROS_NAMESPACE=camera rosrun image_proc image_proc [ INFO] [1436016564.924762943]: Step1 [ INFO] [1436016564.940809151]: Step2 [ INFO] [1436016565.444694821]: Step3 [ INFO] [1436016565.444757917]: Step4 [ INFO] [1436016565.444783119]: Step5 [ INFO] [1436016565.671524024]: Step6 [ INFO] [1436016565.671576133]: Step7 [ INFO] [1436016565.671605069]: Step8 [ INFO] [1436016565.671639400]: Step9 Segmentation fault (core dumped) I'm assuming the namespace is correct since I didn't get the yellow warnings, however there is really nothing to work on here and I'm at an impasse on what to do. If anyone ahs some good ideas, I would really appreciate it!

Viewing all articles
Browse latest Browse all 57

Trending Articles



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