The task context provides and requires services. It uses an ExecutionEngine to perform its functions. Essential interfaces are operations, data flow ports and properties. These interfaces have been defined using the oroGen specification. In order to modify the interfaces you should (re)use oroGen and rely on the associated workflow. using_library "north_seeker" import_types_from "north_seeker/CustomType.hpp" If this project uses data types that are defined in other oroGen projects, these projects should be imported there as well. import_types_from "base" Declare a new task context (i.e., a component)
More...
The task context provides and requires services. It uses an ExecutionEngine to perform its functions. Essential interfaces are operations, data flow ports and properties. These interfaces have been defined using the oroGen specification. In order to modify the interfaces you should (re)use oroGen and rely on the associated workflow. using_library "north_seeker" import_types_from "north_seeker/CustomType.hpp" If this project uses data types that are defined in other oroGen projects, these projects should be imported there as well. import_types_from "base" Declare a new task context (i.e., a component)
The corresponding C++ class can be edited in tasks/Task.hpp and tasks/Task.cpp, and will be put in the north_seeker namespace.
The name of a TaskContext is primarily defined via:
deployment 'deployment_name'
task('custom_task_name','north_seeker::Task')
end It can be dynamically adapted when the deployment is called with a prefix argument.
| bool Task::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
| void Task::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.