OpenRTM-aist IDL
1.2
|
import"RTC.idl";
Public Member Functions | |
Mode | get_default_mode () |
get_default_mode More... | |
Mode | get_current_mode () |
get_current_mode More... | |
Mode | get_current_mode_in_context (in ExecutionContext exec_context) |
get_current_mode_in_context More... | |
Mode | get_pending_mode () |
get_pending_mode More... | |
Mode | get_pending_mode_in_context (in ExecutionContext exec_context) |
get_pending_mode_in_context More... | |
ReturnCode_t | set_mode (in Mode new_mode, in boolean immediate) |
set_mode More... | |
The ModeCapable interface provides access to an object’s modes and a means to set the current mode.
A given RTC may support multiple modes as well as multiple execution contexts. In such a case, a request for a mode change (e.g., from "cruise control on" to "cruise control off") may come asynchronously with respect to one or more of those execution contexts. The mode of an RTC may therefore be observed to be different from one execution context to another. - A mode is pending in a given execution context when a mode change has been requested but the new mode has not yet been observed by that context.
Figure 5.26 depicts a state machine that describes mode changes. Each parallel region in the composite state Mode Pending represents an execution context. The trigger "sample" within that state is considered to have occurred: - …just before the next call to on_execute (see Section 5.3.1.2.1) in the case where immediate is false and the execution kind is PERIODIC, …
Mode RTC::ModeCapable::get_current_mode | ( | ) |
Mode RTC::ModeCapable::get_current_mode_in_context | ( | in ExecutionContext | exec_context | ) |
Mode RTC::ModeCapable::get_default_mode | ( | ) |
get_default_mode
This operation shall return the mode in which the RTC shall be when no other mode has been set.
Mode RTC::ModeCapable::get_pending_mode | ( | ) |
Mode RTC::ModeCapable::get_pending_mode_in_context | ( | in ExecutionContext | exec_context | ) |
get_pending_mode_in_context
If the last mode to be requested by a call to set_mode is different than the current mode as seen by the indicated execution context (see get_current_mode_in_context), this operation returns the former. If the requested mode has already been seen in that context, it returns nil.
See Figure 5.26 for a description of how the pending mode relates to the current mode within a given execution context.
ReturnCode_t RTC::ModeCapable::set_mode | ( | in Mode | new_mode, |
in boolean | immediate | ||
) |
set_mode
This operation shall request that the RTC change to the indicated mode.
Usually, the new mode will be pending in each execution context in which the component executes until the next sample period (if the execution kind is PERIODIC); at that point it will become the current mode in that context and there will no longer be a pending mode. However, in some cases it is important for a mode change to take place immediately; for example, a serious fault has occurred and the component must enter an emergency mode to ensure fail-safe behavior in a safety-critical system. In such a case, immediate should be true and the mode change will take place in all contexts without waiting for the next sample period.