Ejemplo n.º 1
0
	bool wait_ack_for(CommandTransaction &tr) {
		unique_lock lock(tr.cond_mutex);
		if (tr.ack.wait_for(lock, std::chrono::nanoseconds(ACK_TIMEOUT_DT.toNSec())) == std::cv_status::timeout) {
			ROS_WARN_NAMED("cmd", "CMD: Command %u -- wait ack timeout", tr.expected_command);
			return false;
		} else {
			return true;
		}
	}
Ejemplo n.º 2
0
	bool wait_ack_for(CommandTransaction *tr) {
		std::unique_lock<std::mutex> lock(tr->cond_mutex);

		return tr->ack.wait_for(lock, std::chrono::nanoseconds(ACK_TIMEOUT_DT.toNSec()))
			== std::cv_status::no_timeout;
	}