Nav2 Navigation Stack - lyrical  lyrical
ROS 2 Navigation Stack
Public Member Functions | List of all members
nav2::Rate Class Reference

A sim-time-aware rate for Nav2 loops. More...

#include <nav2_ros_common/include/nav2_ros_common/rate.hpp>

Inheritance diagram for nav2::Rate:
Inheritance graph
[legend]
Collaboration diagram for nav2::Rate:
Collaboration graph
[legend]

Public Member Functions

template<typename NodeT >
 Rate (NodeT node, double rate)
 Construct a Rate from a node and frequency. More...
 

Detailed Description

A sim-time-aware rate for Nav2 loops.

When use_sim_time is true, the rate is governed by the node's ROS clock (simulation time). When use_sim_time is false, a steady (monotonic) clock is used to avoid issues with system clock jumps (e.g. NTP corrections).

Definition at line 60 of file rate.hpp.

Constructor & Destructor Documentation

◆ Rate()

template<typename NodeT >
nav2::Rate::Rate ( NodeT  node,
double  rate 
)
inlineexplicit

Construct a Rate from a node and frequency.

Parameters
nodeAny ROS node pointer or shared_ptr (used to check use_sim_time and obtain clock)
rateDesired frequency in Hz

Definition at line 69 of file rate.hpp.


The documentation for this class was generated from the following file: