An event data variant for storing data from a witness function triggering to be passed to event handlers.
A witness function isolates time to a (typically small) window during which the witness function crosses zero. The time and state at both sides of this window are passed to the event handler so that the system can precisely determine the reason that the witness function triggered.
#include <drake/systems/framework/event.h>
Public Member Functions | |
WitnessTriggeredEventData () | |
const WitnessFunction< T > * | triggered_witness () const |
Gets the witness function that triggered the event handler. More... | |
void | set_triggered_witness (const WitnessFunction< T > *triggered_witness) |
Sets the witness function that triggered the event handler. More... | |
const T & | t0 () const |
Gets the time at the left end of the window. More... | |
void | set_t0 (const T &t0) |
Sets the time at the left end of the window. More... | |
const T & | tf () const |
Gets the time at the right end of the window. More... | |
void | set_tf (const T &tf) |
Sets the time at the right end of the window. More... | |
const ContinuousState< T > * | xc0 () const |
Gets a pointer to the continuous state at the left end of the isolation window. More... | |
void | set_xc0 (const ContinuousState< T > *xc0) |
Sets a pointer to the continuous state at the left end of the isolation window. More... | |
const ContinuousState< T > * | xcf () const |
Gets a pointer to the continuous state at the right end of the isolation window. More... | |
void | set_xcf (const ContinuousState< T > *xcf) |
Sets a pointer to the continuous state at the right end of the isolation window. More... | |
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable | |
WitnessTriggeredEventData (const WitnessTriggeredEventData &)=default | |
WitnessTriggeredEventData & | operator= (const WitnessTriggeredEventData &)=default |
WitnessTriggeredEventData (WitnessTriggeredEventData &&)=default | |
WitnessTriggeredEventData & | operator= (WitnessTriggeredEventData &&)=default |
|
default |
|
default |
|
default |
|
default |
void set_t0 | ( | const T & | t0 | ) |
Sets the time at the left end of the window.
Note that t0
should be smaller than tf
after both values are set.
void set_tf | ( | const T & | tf | ) |
Sets the time at the right end of the window.
Note that tf
should be larger than t0
after both values are set.
void set_triggered_witness | ( | const WitnessFunction< T > * | triggered_witness | ) |
Sets the witness function that triggered the event handler.
void set_xc0 | ( | const ContinuousState< T > * | xc0 | ) |
Sets a pointer to the continuous state at the left end of the isolation window.
void set_xcf | ( | const ContinuousState< T > * | xcf | ) |
Sets a pointer to the continuous state at the right end of the isolation window.
const T& t0 | ( | ) | const |
Gets the time at the left end of the window.
Default is NaN (which indicates that the value is invalid).
const T& tf | ( | ) | const |
Gets the time at the right end of the window.
Default is NaN (which indicates that the value is invalid).
const WitnessFunction<T>* triggered_witness | ( | ) | const |
Gets the witness function that triggered the event handler.
const ContinuousState<T>* xc0 | ( | ) | const |
Gets a pointer to the continuous state at the left end of the isolation window.
const ContinuousState<T>* xcf | ( | ) | const |
Gets a pointer to the continuous state at the right end of the isolation window.