Function cras::safeRate

Function Documentation

::rclcpp::Rate cras::safeRate(double frequency, const ::rclcpp::Clock::SharedPtr &clock = ::std::make_shared<::rclcpp::Clock>(RCL_SYSTEM_TIME))

Return a rate representing the given frequency. If the frequency is zero or too small, return min/max representable rate.

Parameters:
  • frequency[in] The frequency to convert.

  • clock[in] The clock to use.

Returns:

The corresponding Rate object.