Gazebo Transport

API Reference

15.0.2
WaitHelpers.hh File Reference
#include <chrono>
#include <string>
#include <thread>
#include "gz/transport/config.hh"
#include "gz/transport/Export.hh"

Go to the source code of this file.

Namespaces

namespace  gz
 
namespace  gz::transport
 

Functions

bool waitForService (const Node &_node, const std::string &_service, std::chrono::milliseconds _timeout=std::chrono::milliseconds(10000))
 Block until a service is discovered or a timeout expires.
 
void waitForShutdown ()
 Block the current thread until a SIGINT or SIGTERM is received. Note that this function registers a signal handler. Do not use this function if you want to manage yourself SIGINT/SIGTERM.
 
bool waitForTopic (const Node &_node, const std::string &_topic, std::chrono::milliseconds _timeout=std::chrono::milliseconds(10000))
 Block until a topic is discovered or a timeout expires.
 
template<typename Pred >
bool waitUntil (Pred _pred, std::chrono::milliseconds _timeout=std::chrono::milliseconds(10000), std::chrono::milliseconds _interval=std::chrono::milliseconds(10))
 Block until a predicate becomes true or a timeout expires. Polls by calling _pred() repeatedly with _interval sleep between checks. Uses steady_clock for monotonic timing.