Classes | Functions | Variables
pilz_utils Namespace Reference

Classes

class  GetParamException
 Exception used by the getParam function. More...
 

Functions

template<class T >
getParam (const ros::NodeHandle &nh, const std::string &param_name)
 
static bool sleep (const ros::Duration &sleep_duration)
 Replace the sim-time part of ros::Duration::sleep() by a progressing in time. More...
 
template<class T >
static void waitForMessage (const std::string topic_name, const double retry_timeout=DEFAULT_RETRY_TIMEOUT, const double msg_output_period=DEFAULT_MSG_OUTPUT_PERIOD)
 Waits (infinitely) until a message arrives on the specified topic. More...
 
static void waitForService (const std::string service_name, const double retry_timeout=DEFAULT_RETRY_TIMEOUT, const double msg_output_period=DEFAULT_MSG_OUTPUT_PERIOD)
 Waits until the specified service starts. More...
 

Variables

static constexpr double DEFAULT_MSG_OUTPUT_PERIOD {5.0}
 
static constexpr double DEFAULT_RETRY_TIMEOUT {0.2}
 

Function Documentation

template<class T >
T pilz_utils::getParam ( const ros::NodeHandle nh,
const std::string &  param_name 
)

Definition at line 45 of file get_param.h.

static bool pilz_utils::sleep ( const ros::Duration sleep_duration)
static

Replace the sim-time part of ros::Duration::sleep() by a progressing in time.

Use this in production code in order to facilitate tests with simulated time.

When using simulated time, ros::Duration::sleep() has to be synchronized with calls to ros::Time::setNow(), else it will block. This sleep function simply performs the progressing in time itself, such that it never blocks.

Note
Simulated time is valid, if it is non-zero. Otherwise no sleep is performed.
Modifying the simulated time in parallel to this function will lead to unpredictable results.
Returns
Returns true if sleep was performed and false if not.

Definition at line 38 of file sleep.h.

template<class T >
static void pilz_utils::waitForMessage ( const std::string  topic_name,
const double  retry_timeout = DEFAULT_RETRY_TIMEOUT,
const double  msg_output_period = DEFAULT_MSG_OUTPUT_PERIOD 
)
static

Waits (infinitely) until a message arrives on the specified topic.

Definition at line 34 of file wait_for_message.h.

static void pilz_utils::waitForService ( const std::string  service_name,
const double  retry_timeout = DEFAULT_RETRY_TIMEOUT,
const double  msg_output_period = DEFAULT_MSG_OUTPUT_PERIOD 
)
inlinestatic

Waits until the specified service starts.

Definition at line 33 of file wait_for_service.h.

Variable Documentation

constexpr double pilz_utils::DEFAULT_MSG_OUTPUT_PERIOD {5.0}
static

Definition at line 24 of file wait_for_timeouts.h.

constexpr double pilz_utils::DEFAULT_RETRY_TIMEOUT {0.2}
static

Definition at line 23 of file wait_for_timeouts.h.



pilz_utils
Author(s):
autogenerated on Tue Feb 2 2021 03:50:14