nt main(int argc, char **argv)
{
ros::init(argc, argv, "convert_to_mono");
ros::NodeHandle nh;
ros::Publisher image_pub = nh.advertise<sensor_msgs::Image>("image_hsv", 1000);
ros::Subscriber image_sub = nh.subscribe(image_topic, 1000, &update_image);
ros::Subscriber range_sub = nh.subscribe("sonar_height", 1000, &update_range);
ros::Publisher cmd_vel_pub=nh.advertise<geometry_msgs::Twist>("/cmd_vel",1);
ros::AsyncSpinner spinner(4); // Use 4 threads
spinner.start();
ros::Rate loop_rate(22);
while (ros::ok())
{
loop_rate.sleep();
}
ros::waitForShutdown();
return 0;
}
随笔之ros多线程
最新推荐文章于 2024-09-22 19:29:24 发布