From f3d3d606cb37cda8ff58d0715e497010c4e0bdd9 Mon Sep 17 00:00:00 2001 From: Johannes Wienke Date: Tue, 5 Jan 2016 14:46:04 +0100 Subject: [PATCH] New types to describe animations for Flobi refs #2483 --- .../sandbox/rst/animation/BinocularHeadGaze.proto | 55 ++++++++++++ .../sandbox/rst/animation/EmotionExpression.proto | 59 +++++++++++++ proto/sandbox/rst/animation/HeadAnimation.proto | 98 ++++++++++++++++++++++ proto/sandbox/rst/animation/__package.proto | 5 ++ 4 files changed, 217 insertions(+) create mode 100644 proto/sandbox/rst/animation/BinocularHeadGaze.proto create mode 100644 proto/sandbox/rst/animation/EmotionExpression.proto create mode 100644 proto/sandbox/rst/animation/HeadAnimation.proto create mode 100644 proto/sandbox/rst/animation/__package.proto diff --git a/proto/sandbox/rst/animation/BinocularHeadGaze.proto b/proto/sandbox/rst/animation/BinocularHeadGaze.proto new file mode 100644 index 0000000..54e4345 --- /dev/null +++ b/proto/sandbox/rst/animation/BinocularHeadGaze.proto @@ -0,0 +1,55 @@ +package rst.animation; + +option java_outer_classname = "BinocularHeadGazeType"; + +import "rst/geometry/SphericalDirectionFloat.proto"; + +/** + * Description of a gaze configuration of a system having tow eyes + * mounted on a pan-tilt joint (something like a human or robot + * head). + * + * @author Simon Schulz + */ +message BinocularHeadGaze { + + /** + * Spherical direction of the target to gaze at with respect to a + * neutral "straight-ahead" direction of the described "head". The + * direction originates from the center point between both eyes. The + * underlying Cartesian coordinate system of the spherical + * coordinates is as follows: + * + * * The positive X axis points towards the "straight-ahead" + * direction. + * + * * The positive Y axis points to the head's left direction. + * + * * The positive Z axis points up with respect to the + * "straight-ahead" direction of the head. + */ + required .rst.geometry.SphericalDirectionFloat target = 1; + + /** + * Vergence angle of both eyes. This describes how both eyes deviate + * from a parallel configuration. The default of 0.0 describes a + * straight, parallel gaze. The angles are expressed as a rotation + * around the normal vector of a plane defined by the connecting + * line between both eyes and a ray that points into the neutral + * "straight-ahead" direction of the eyes. Each eye's adjustment + * angle is 0.5 times the given value where positive values + * correspond to the eyes moving inwards. + */ + // @unit(radian) + required float eye_vergence = 2 [default = 0.0]; + + /** + * Offset angles describing how much the head direction deviates + * from @ref .target. The overall gaze (head + eyes) will still + * point to the requested target + * + * [0, 0] corresponds to no offset. + */ + required .rst.geometry.SphericalDirectionFloat offset = 3; + +} diff --git a/proto/sandbox/rst/animation/EmotionExpression.proto b/proto/sandbox/rst/animation/EmotionExpression.proto new file mode 100644 index 0000000..ee6c8c4 --- /dev/null +++ b/proto/sandbox/rst/animation/EmotionExpression.proto @@ -0,0 +1,59 @@ +package rst.animation; + +option java_outer_classname = "EmotionExpressionType"; + +/** + * Description of one of a set of predefined emotions to express by a + * robot for a certain time. + * + * @author Simon Schulz + */ +message EmotionExpression { + + /** + * The available emotions to express. Apart from being neutral, + * these relate to Ekman's basic emotions. + */ + enum Emotion { + /** + * Neutral expression. + */ + NEUTRAL = 0; + /** + * Happiness. + */ + HAPPY = 1; + /** + * Sadness. + */ + SAD = 2; + /** + * Being angry. + */ + ANGRY = 3; + /** + * Being surprised. + */ + SURPRISED = 4; + /** + * Being feared. + */ + FEAR = 5; + } + + /** + * Indicates which emotion to express. + */ + required Emotion emotion = 1; + + /** + * The duration how long this emotion should be displayed. + * + * The duration is given in milliseconds. + * + * TODO: zero? Constraint or description + */ + // @unit(millisecond) + required uint32 duration = 2; + +} diff --git a/proto/sandbox/rst/animation/HeadAnimation.proto b/proto/sandbox/rst/animation/HeadAnimation.proto new file mode 100644 index 0000000..5d93083 --- /dev/null +++ b/proto/sandbox/rst/animation/HeadAnimation.proto @@ -0,0 +1,98 @@ +package rst.animation; + +option java_outer_classname = "HeadAnimationType"; + +/** + * This type describes a set of simple (predefined) animations to be + * executed on a humanoid robotic head. + * + * @author Simon Schulz + */ +message HeadAnimation { + + /** + * Predefined animation to execute by the head. + */ + enum Animation { + /** + * No animation, idle. + */ + IDLE = 0; + /** + * Nodding. + */ + HEAD_NOD = 1; + /** + * Shake. + */ + HEAD_SHAKE = 2; + /** + * Blink with the left eye. + */ + EYEBLINK_LEFT = 3; + /** + * Blink with the right eye. + */ + EYEBLINK_RIGHT = 4; + /** + * Blink with both eyes. + */ + EYEBLINK_BOTH = 5; + /** + * Raise both eyebrows + */ + EYEBROWS_RAISE = 6; + /** + * Lower the eyebrows. + */ + EYEBROWS_LOWER = 7; + /** + * Shift the head orientation to the left. + */ + ENGAGEMENT_LEFT = 8; + /** + * Shift the head orientation to the right. + */ + ENGAGEMENT_RIGHT = 9; + } + + /** + * Requested animation to perform. + */ + required Animation animation = 1; + + /** + * Number of repetitions. + * + * Defaults to one repetition + * + * TODO: is 0 valid? What happens if so? Otherwise add a constraint. + */ + required uint32 repetitions = 2 [default = 1]; + + /** + * The duration of each execution of the defined animation. + * + * The duration is given in milliseconds. + * + * TODO: as above zero... + */ + // @unit(millisecond) + required uint32 duration_each = 3; + + /** + * How to scale the animation with respect to the expressed emphasis. + * + * Given as a float value. Different value ranges express the + * following meanings: + * + * * ``]0, 1[``: less pronounced + * + * * ``[1, 1]``: as designed, no special emphasis + * + * * ``]1, n]``: over pronounced + */ + // @constraint(value > 0) + required float emphasis_scale = 4 [default = 1.0]; + +} diff --git a/proto/sandbox/rst/animation/__package.proto b/proto/sandbox/rst/animation/__package.proto new file mode 100644 index 0000000..e34f9f6 --- /dev/null +++ b/proto/sandbox/rst/animation/__package.proto @@ -0,0 +1,5 @@ +/** + * Contains types to describe animations to be performed. Character + * animation is a specific application. + */ +package rst.animation; -- 1.9.1