gaze_residual.h
Go to the documentation of this file.
1#pragma once
2
3#include <Eigen/Core>
4
6{
7
8 /**
9 * @brief How far the gaze currently is from a target.
10 */
12 {
13 /// Angle between the gaze ray and the direction to the target [rad].
14 float angularError = 0.F;
15
16 /// Lateral miss distance at target range [mm].
17 float lateralError = 0.F;
18 };
19
20 /**
21 * @brief The gaze residual, in a form that means the same thing for every controller variant.
22 *
23 * Taking two directions rather than a robot node keeps the optical axis convention out of here:
24 * each variant supplies its gaze ray using the convention it already works in -- `atan2` rebuilds
25 * it from its own yaw/pitch parametrization, `gaze_ik` takes the axis of the virtual prismatic
26 * joint that *is* its gaze ray. Thresholds set on the result are therefore portable between them.
27 *
28 * Degenerate input (a target at the gaze origin, or a zero-length direction) yields a zero
29 * residual rather than NaN.
30 *
31 * @param currentGazeDirection Where the robot is looking. Need not be normalized.
32 * @param targetDirection Where the target is. Need not be normalized.
33 * @param targetDistance Distance to the target [mm].
34 */
35 GazeResidual computeGazeResidual(const Eigen::Vector3f& currentGazeDirection,
36 const Eigen::Vector3f& targetDirection,
37 float targetDistance);
38
39} // namespace armarx::view_selection::gaze_controller
GazeResidual computeGazeResidual(const Eigen::Vector3f &currentGazeDirection, const Eigen::Vector3f &targetDirection, const float targetDistance)
The gaze residual, in a form that means the same thing for every controller variant.
How far the gaze currently is from a target.
float lateralError
Lateral miss distance at target range [mm].
float angularError
Angle between the gaze ray and the direction to the target [rad].