#include <Base.hpp>
|
| typedef RTT::InputPort< base::LinearAngular6DCommand > | InputPortType |
| |
| Base::Base |
( |
std::string const & |
name = "auv_control::Base" | ) |
|
TaskContext constructor for Base
- Parameters
-
| name | Name of the task. This name needs to be unique to make it identifiable via nameservices. |
| Base::Base |
( |
std::string const & |
name, |
|
|
RTT::ExecutionEngine * |
engine |
|
) |
| |
TaskContext constructor for Base
- Parameters
-
| name | Name of the task. This name needs to be unique to make it identifiable for nameservices. |
| engine | The RTT Execution engine to be used for this task, which serialises the execution of all commands, programs, state machines and incoming events for a task. |
Default deconstructor of Base
| bool Base::addCommandInput |
( |
::std::string const & |
name, |
|
|
::base::Time const & |
timeout |
|
) |
| |
|
protectedvirtual |
Creates a new input port called cmd_name of the type LinearAngular6DCommand. Once defined, this input port will be merged into the merged_command command before the controller calculates the corresponding output
Computes the output based on the value received in merged_command (command and status)
As calcOutput is defined in the derived class, the class Base can not handle the States of derived class. In that case, any state transition in DerivedClass::calcOutput should return a false. Like that there would not a interference with Base's states.
- Parameters
-
| merging_command,The | command itself and its status |
- Returns
- bool. TRUE if there is NO state transition in derived class, FALSE otherwise.
Check for connected ports
- Parameters
-
| input_ports | vector of input ports to be verified |
| connected_input_ports | vector of address of connected input_ports to be assigned |
- Returns
- bool. TRUE if at least one port is connected, FALSE otherwise
| void Base::cleanupHook |
( |
| ) |
|
This hook is called by Orocos when the state machine transitions from Stopped to PreOperational, requiring the call to configureHook() before calling start() again.
| bool Base::configureHook |
( |
| ) |
|
The following lines are template definitions for the various state machine.
This hook is called by Orocos when the state machine transitions from PreOperational to Stopped. If it returns false, then the component will stay in PreOperational. Otherwise, it goes into Stopped.
It is meaningful only if the #needs_configuration has been specified in the task context definition with (for example):
task_context "TaskName" do
needs_configuration
...
end
This hook is called by Orocos when the component is in the RunTimeError state, at each activity step. See the discussion in updateHook() about triggering options.
Call recover() to go back in the Runtime state.
Gather input from connected input ports
- Parameters
-
| merged_command,where | the commands will be safe all together with its RTT:FlowStatus |
| connected_ports | to be analyzed. |
- Returns
- States of wich it should go
| void Base::keepPosition |
( |
| ) |
|
|
protectedvirtual |
Send a "do not move" command to the next level
This is called if the keep_position_on_exception property is set and the component goes into an exception state
| Base::States Base::performOneLoop |
( |
| ) |
|
Do one loop of read inputs and computing output
It will be called in updateHook() and errorHook(), and it can transit in both states, according its return.
- Returns
- States which it should go.
| void Base::registerInput |
( |
std::string const & |
name, |
|
|
base::Time |
timeout, |
|
|
InputPortType * |
input_port |
|
) |
| |
|
protected |
This hook is called by Orocos when the state machine transitions from Stopped to Running. If it returns false, then the component will stay in Stopped. Otherwise, it goes into Running and updateHook() will be called.
This hook is called by Orocos when the state machine transitions from Running to Stopped after stop() has been called.
| void Base::updateHook |
( |
| ) |
|
This hook is called by Orocos when the component is in the Running state, at each activity step. Here, the activity gives the "ticks" when the hook should be called.
The error(), exception() and fatal() calls, when called in this hook, allow to get into the associated RunTimeError, Exception and FatalError states.
In the first case, updateHook() is still called, and recover() allows you to go back into the Running state. In the second case, the errorHook() will be called instead of updateHook(). In Exception, the component is stopped and recover() needs to be called before starting it again. Finally, FatalError cannot be recovered.
Check if all expected data field are present
In case of missing any data field, switch to INPUT_MISSING state
- Parameters
-
| expect,the | expected fields that need to present |
| command | to be verified return bool. True if there is no missing data. False in that case |
| bool Base::verifyTimeout |
( |
const base::Time & |
newest_command | ) |
|
|
protected |
Check for timeout in input ports
Check both in system time (time.now()) and sample time (newest_command) In case of Timeout, switch to exception state TIMEOUT
- Parameters
-
| newest_command. | Time of last command in all ports |
- Returns
- bool. True if there is no Timeout. False in Timeout case
| base::Time auv_control::Base::newestCommandTime |
|
protected |
The documentation for this class was generated from the following files:
- /build/rock-master-18.09-control-orogen-auv-control-0.20180621/tasks/Base.hpp
- /build/rock-master-18.09-control-orogen-auv-control-0.20180621/tasks/Base.cpp