7#include <Eigen/Geometry>
40 SetCustomGazeTarget::init(
const Base::SpecializedInitInput& in)
43 std::string frame = in.parameters.frame;
44 std::string agent = in.parameters.agent;
46 Eigen::Vector3f{in.parameters.x, in.parameters.y, in.parameters.z}, frame, agent};
48 in.parameters.priority};
51 gaze_targets::GazeTarget target{
52 in.parameters.gazeTargetName, targetPos, priority, duration,
false};
53 gazeTarget.emplace(target);
57 return ::armarx::skills::Skill::InitResult{
61 ::armarx::skills::Skill::MainResult
62 SetCustomGazeTarget::main(
const Base::SpecializedMainInput& in)
66 ARMARX_INFO <<
"Committing gaze target " << gazeTarget.value();
67 srv_->viewSelectionClient.commitGazeTarget(gazeTarget.value());
69 if (in.parameters.waitUntilFinished)
71 ARMARX_IMPORTANT <<
"NYI! Waiting for head to reach target (waitUntilFinished) "
72 "parameter is not yet implemented.";
75 return ::armarx::skills::Skill::MainResult{
80 SetCustomGazeTarget::onStopRequested()
82 if (gazeTarget.has_value())
84 srv_->viewSelectionClient.commitGazeTarget(gazeTarget.value());
88 armarx::skills::SkillDescription
92 defaultParameters.frame =
"root";
93 defaultParameters.agent =
"Armar7";
94 defaultParameters.gazeTargetName =
"SetCustomGazeTarget";
95 defaultParameters.priority = 1;
96 defaultParameters.duration_ms = 1000;
97 defaultParameters.x = 0;
98 defaultParameters.y = 1500;
99 defaultParameters.z = 1500;
102 defaultParameters.waitUntilFinished =
false;
106 .description =
"Set a gaze target by coordinate, agent and frame. Supported frames "
107 "include the Global frame and the robot root frames. Please note that "
108 "the waitUntilFinished parameter is not yet implemented.",
109 .rootProfileDefaults = defaultParameters.toAron(),
111 .parametersType = Params::ToAronType(),
The FramedPosition class.
static Duration MilliSeconds(std::int64_t milliSeconds)
Constructs a duration in milliseconds.
arondto::SetCustomGazeTargetParams ParamType
::armarx::skills::SimpleSpecializedSkill< Params > Base
static armarx::skills::SkillDescription DefaultSkillDescription()
SetCustomGazeTarget(const Context &services)
void connect(const Context &srv)
#define ARMARX_CHECK(expression)
Shortcut for ARMARX_CHECK_EXPRESSION.
#define ARMARX_INFO
The normal logging level.
#define ARMARX_IMPORTANT
The logging level for always important information, but expected behaviour (in contrast to ARMARX_WAR...
@ TaskDriven
Task-Driven attention has highest priority.
const std::string SetCustomGazeTarget
This file is part of ArmarX.
A result struct for skill initialization.