|
visp
|
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. More...
#include <Task.hpp>
Public Member Functions | |
| Task (std::string const &name="visp::Task") | |
| Task (std::string const &name, RTT::ExecutionEngine *engine) | |
| ~Task () | |
| bool | configureHook () |
| The following lines are template definitions for the various state machine. More... | |
| bool | startHook () |
| void | updateHook () |
| void | errorHook () |
| void | stopHook () |
| void | cleanupHook () |
Protected Member Functions | |
| void | updateFeaturesHVS (Points const &corners, vpHomogeneousMatrix const &cdMo) |
| vpHomogeneousMatrix | updateDesiredPose (base::LinearAngular6DCommand setpoint) |
| void | setGain (double gain, visp::adaptiveGains const &adaptive_gains, bool use_adaptive) |
| void | writeVelocities (vpColVector const &v) |
| base::samples::RigidBodyState | convertToRbs (vpHomogeneousMatrix pose) const |
| vpMatrix | jacobianFromExpectedInputs (const visp::expectedInputs &expected_inputs) const |
| bool | readSetpoint (base::LinearAngular6DCommand &setpoint) |
| bool | readCorners (Points &corners, std::string const &desired_target) |
| void | updateTargetParameters (std::string const &desired_target) |
| void | setObjectSize (double object_width, double object_height) |
| virtual bool | setDesired_target (std::string const &value) |
Protected Attributes | |
| visp::expectedInputs | expected_inputs |
| visp::controllerState | ctrl_state |
| base::LinearAngular6DCommand | setpoint |
| vpCameraParameters | cam_cal |
| vpServo | task |
| vpPoint | point [4] |
| vpPoint | P |
| vpHomogeneousMatrix | cMb |
| vpFeatureDepth | depth |
| vpFeaturePoint | p |
| vpFeaturePoint | pd |
| vpFeatureThetaU | tu |
| vpFeatureTranslation | t |
| double | Zd |
| std::string | desired_target |
| double | rotation_around_z |
| std::vector< visp::targetObjectParameters > | target_list |
| vpMatrix | eJe |
| vpVelocityTwistMatrix | cVb |
Friends | |
| class | TaskBase |
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.
The name of a TaskContext is primarily defined via:
deployment 'deployment_name'
task('custom_task_name','visp::Task')
end
It can be dynamically adapted when the deployment is called with a prefix argument.
| Task::Task | ( | std::string const & | name = "visp::Task" | ) |
TaskContext constructor for Task
| name | Name of the task. This name needs to be unique to make it identifiable via nameservices. |
| initial_state | The initial TaskState of the TaskContext. Default is Stopped state. |
| Task::Task | ( | std::string const & | name, |
| RTT::ExecutionEngine * | engine | ||
| ) |
TaskContext constructor for Task
| 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. |
| Task::~Task | ( | ) |
Default deconstructor of Task
| void Task::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 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
|
protected |
Convert a visp homogeneus matrix in to a RigidBodyState
| Homogeneus | matrix representing a pose |
| void Task::errorHook | ( | ) |
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.
|
protected |
Take the expected inputs and set the jacobian matrix for the controller
| Expected | inputs for the setpoint with wrt body frame |
|
protected |
Read the input port and select among the VisualFeaturePoint vector the one who was the same identifier as "desired_target". Then update it features and return the corners of the desired target.
| vector | of corners |
| desired | target identifier |
|
protected |
Read the setpoint input port.
| Setpoint. | Body position in the object frame |
|
protectedvirtual |
Update the dynamic property "desired_target"
| string | containing the desired target's identifier |
|
protected |
Set the controller gain
| static | gain |
| adaptive | gains value |
| set | the adaptive gains if true. If false, use the static gain instead. |
|
protected |
Set the objetc size
| target | width |
| target | height |
| bool Task::startHook | ( | ) |
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.
| void Task::stopHook | ( | ) |
This hook is called by Orocos when the state machine transitions from Running to Stopped after stop() has been called.
|
protected |
Update the desired pose according to a setpoint. The setpoint is the desired object pose in the vehicle's frame.
| Desired | body position with resepct to the visual feature |
|
protected |
Update the visual features of a hibrid visual controller.
| detected | corners |
| desired | object pose in the camera frame |
Update Feature 1 - p
Update Feature 2 - depth
Update Feature 3 - t, tu
| 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.
|
protected |
Look for the parameters of a target in a given target list and update it. An exception is raised if there is no desired_target in the target list.
| target's | name |
|
protected |
Write the computed velocities to the output port
| computed | velocities |
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
1.8.11