bool spin() { ros::Rate loop_rate(this->framerate_); while (node_.ok()) { if (!take_and_send_image()) ROS_WARN("USB camera did not respond in time."); ros::spinOnce(); loop_rate.sleep(); } return true; }
bool spin() { while (node_.ok()) { if (take_and_send_image()) { count_++; ros::Time now_time = ros::Time::now(); if (now_time > next_time_) { ROS_DEBUG("%d frames/sec", count_); count_ = 0; next_time_ = next_time_ + ros::Duration(1,0); } } else { ROS_ERROR("couldn't take image."); usleep(1000000); } // self_test_.checkTest(); } return true; }
bool spin() { while (ok()) { if (take_and_send_image()) { count_++; ros::Time now_time = ros::Time::now(); if (now_time > next_time) { std::cout << count_ << " frames/sec at " << now_time << std::endl; count_ = 0; next_time = next_time + ros::Duration(1,0); } } else { log(ros::ERROR,"couldn't take image."); usleep(1000000); param("~host", axis_host, string("192.168.0.90")); cam->set_host(axis_host); } self_test_.checkTest(); } return true; }
void shutter_cb() { take_and_send_image(); }