void StereoNode::AcquireOnce() { if (is_acquire() && ros::ok()) { left_ros_->RequestSingle(); right_ros_->RequestSingle(); const auto expose_us = left_ros_->camera().GetExposeUs(); const auto expose_duration = ros::Duration(expose_us * 1e-6 / 2); const auto time = ros::Time::now() + expose_duration; left_ros_->PublishCamera(time); right_ros_->PublishCamera(time); } }
void SingleNode::Acquire() { while (is_acquire() && ros::ok()) { // In external trigger mode, this request function does not have any effect. // Hence using the time at which this function is called is not the right approach for // the multi-cam synch. purpose. if (flea3_ros_.RequestSingle()) { const auto image_msg = boost::make_shared<sensor_msgs::Image>(); flea3_ros_.Grab(image_msg, nullptr); flea3_ros_.Publish(image_msg); Sleep(); } } }
void StereoNode::Acquire() { while (is_acquire() && ros::ok()) { if (right_ros_.RequestSingle() && left_ros_.RequestSingle()) { const auto right_image_msg = boost::make_shared<sensor_msgs::Image>(); const auto left_image_msg = boost::make_shared<sensor_msgs::Image>(); left_ros_.Grab(left_image_msg, nullptr); right_ros_.Grab(right_image_msg, nullptr); right_ros_.Publish(right_image_msg); left_ros_.Publish(left_image_msg); Sleep(); } } }