Easy Navigation
Loading...
Searching...
No Matches
SafetyChannelMonitor Class Reference

Turns the safety channel's SafetyStatus messages into what EasyNav applies. More...

#include <SafetyChannelMonitor.hpp>

Classes

struct  Evaluation

Public Types

using Clock = std::chrono::steady_clock
enum class  Condition : uint8_t { VALID , NO_STATUS , STALE , INVALID }
 Why the state is what it is. More...
using Status = easynav_interfaces::msg::SafetyStatus

Public Member Functions

void configure (double timeout)
 Sets the timeout (s, > 0) and forgets any status.
Evaluation evaluate (Clock::time_point now) const
 The state to apply at now.
std::optional< Status > last_status () const
 The last status received, if any.
void received (const Status &msg, Clock::time_point now)
 A status msg was received at now.

Static Public Member Functions

static std::string invalid_reason (const Status &msg)
 Why msg is invalid, or "".

Detailed Description

Turns the safety channel's SafetyStatus messages into what EasyNav applies.

With no valid status received within the last timeout seconds, the status is lost, and that is treated as a protective stop. Times are reception times on the monotonic clock, so they do not depend on the publisher's clock. received() and evaluate() may run in different threads.

Member Typedef Documentation

◆ Clock

using Clock = std::chrono::steady_clock

◆ Status

using Status = easynav_interfaces::msg::SafetyStatus

Member Enumeration Documentation

◆ Condition

enum class Condition : uint8_t
strong

Why the state is what it is.

Enumerator
VALID 
NO_STATUS 
STALE 
INVALID 

Member Function Documentation

◆ configure()

void configure ( double timeout)

Sets the timeout (s, > 0) and forgets any status.

◆ evaluate()

SafetyChannelMonitor::Evaluation evaluate ( Clock::time_point now) const

The state to apply at now.

◆ invalid_reason()

std::string invalid_reason ( const Status & msg)
static

Why msg is invalid, or "".

◆ last_status()

std::optional< SafetyChannelMonitor::Status > last_status ( ) const

The last status received, if any.

◆ received()

void received ( const Status & msg,
Clock::time_point now )

A status msg was received at now.


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