diguyCharacterGesture Class Declaration

diguyCharacterGesture.h

DI-Guy API Version 5.1.26

This file was automatically generated from comments in the C/C++ header file diguyCharacterGesture.h. Do not edit this file directly; the changes will be lost. Please mail suggestions or corrections to diguy@bdi.com

Alphabetical Index

Includes: declspec_diguy.h

class diguyCharacterGesture

class BDI_DECLSPEC_diguy diguyCharacterGesture
{
public:
    const char* get_name();
    int begin_now();
    int get_has_begun_flag();
    int get_has_completed_flag();
    int abort_now(float max_rampdown_interval);
    int set_automatic_destroy_flag(int automatic_destroy_flag);
    int set_interpolation_flag(int flag);
    int get_interpolation_flag();
    int set_max_reps(int max_reps,
        int derive_duration_flag = 1);
    int get_max_reps();
    int set_overall_duration(float overall_duration,
        int derive_max_reps_flag = 1);
    float get_overall_duration();
    int get_num_stages();
    int get_num_channels();
    int set_stage_duration(int stage, float duration);
    float get_stage_duration(int stage);
    float get_stage_optimal_duration(int stage);
    int set_channel_weight(char channel, float channel_weight);
    float get_channel_weight(char channel);
    int set_channel_weight_target(char channel,
        float channel_weight_target,
        float blend_tin,
        float blend_tout,
        const char* blend_function_name = 0);
    int add_channel_weight_target(char channel,
        float channel_weight_target,
        float blend_tin,
        float blend_tout,
        const char* blend_function_name = 0);
#ifdef CPLUSPLUS_ONLY
    bdiGestureArcInstance* get_scripted_object() {return m_scripted_object;}
};

function diguyCharacterGesture::get_name

Prototype:

const char* get_name();
Callable From:

Returns:

name of the gesture

function diguyCharacterGesture::begin_now

Prototype:

int begin_now();
Description:

This function causes the gesture to begin immediately. The gesture will continue until it has completed.

The overall duration of the gesture can be set by calling set_overall_duration(). The durations of each stage will be set proportionately over the overall duration.

Alternatively, the durations of individual stages of the gesture can be set by calling set_stage_duration().

The number of repetitions of the gesture can be set by calling set_max_reps().

Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacterGesture::get_has_begun_flag

Prototype:

int get_has_begun_flag();
Callable From:

Returns:

1 if the gesture has begun; 0 if not

function diguyCharacterGesture::get_has_completed_flag

Prototype:

int get_has_completed_flag();
Callable From:

Returns:

1 if the gesture has completed; 0 if not

function diguyCharacterGesture::abort_now

Prototype:

int abort_now(float max_rampdown_interval);
Description:

This function causes this gesture to abort. Aborting a gesture doesn't destroy it. The gesture can be begun again if desired.

Arguments:

max_rampdown_intervalmax amount of time spent trying to smooth over any motion seams; set to 0.5 for a smooth transition, set to 0 for an immediate abort
Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacterGesture::set_automatic_destroy_flag

Prototype:

int set_automatic_destroy_flag(int automatic_destroy_flag);
Description:

This function causes the gesture object to be automatically deleted when the gesture has completed. No further calls through the diguyCharacterGesture object can or should be made, so this function should only be called once all durations, reps, etc. have been set.

Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacterGesture::set_interpolation_flag

Prototype:

int set_interpolation_flag(int flag);
Description:

This function sets whether joint angles in the gesture will be interpolated. This takes more time, but results in smoother motion at high frame rates.

Arguments:

flagpass 1 to turn on interpolation, pass 0 to turn off interpolation
Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacterGesture::get_interpolation_flag

Prototype:

int get_interpolation_flag();
Returns:

the most recent setting of set_interpolation_flag()

Callable From:

function diguyCharacterGesture::set_max_reps

Prototype:

int set_max_reps(int max_reps,
		int derive_duration_flag = 1);
Description:

This function sets the number of times the gesture will be repeated. The optimal overall duration can be optionally computed based on the number of repetitions specified.

Arguments:

max_reps number of times gesture will be repeated
derive_duration_flagpass 1 to derive optimal overall duration from passed max_reps
Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacterGesture::get_max_reps

Prototype:

int get_max_reps();
Returns:

the number of times the gesture will be repeated

Callable From:

function diguyCharacterGesture::set_overall_duration

Prototype:

int set_overall_duration(float overall_duration,
		int derive_max_reps_flag = 1);
Description:

This function sets the overall duration the gesture will have. The optimal number of repetitions can be optionally computed based on the specified duration.

Calling this function will override any previous calls that set specific stage durations (e.g., as set by a call to set_stage_duration()).

Arguments:

overall_duration duration of all stages of the gesture, in seconds
derive_duration_flagpass 1 to derive optimal number of reps for the given duration
Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacterGesture::get_overall_duration

Prototype:

float get_overall_duration();
Returns:

the overall duration in seconds of the gesture

Callable From:

function diguyCharacterGesture::get_num_stages

Prototype:

int get_num_stages();
Returns:

the number of stages in the gesture

Callable From:

function diguyCharacterGesture::get_num_channels

Prototype:

int get_num_channels();
Returns:

how many channels are in the gesture

Callable From:

function diguyCharacterGesture::set_stage_duration

Prototype:

int set_stage_duration(int stage, float duration);
Description:

This function sets the exact duration of the specified stage of the gesture.

Arguments:

durationduration of stage, in seconds
Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacterGesture::get_stage_duration

Prototype:

float get_stage_duration(int stage);
Returns:

the duration in seconds of specified stage of the gesture

Callable From:

function diguyCharacterGesture::get_stage_optimal_duration

Prototype:

float get_stage_optimal_duration(int stage);
Returns:

the optimal duration in seconds of specified stage of the gesture

function diguyCharacterGesture::set_channel_weight

Prototype:

int set_channel_weight(char channel, float channel_weight);
Description:

This function sets the weight of the specified channel. The other channel weights in a multi-channel gesture will be affected by this call so that all channel weight add to 1.

If the gesture does not have the channel, this function has no effect.

Arguments:

channel which channel to affect; pass a single upper case character (e.g., 'A')
channel_weightvalue between 0 and 1; 1 means gesture is entirely driven by specified channel, 0 means specified channel has no effect on gesture
Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacterGesture::get_channel_weight

Prototype:

float get_channel_weight(char channel);
Returns:

the current weight of the specified channel; see set_channel_weight()

Callable From:

function diguyCharacterGesture::set_channel_weight_target

Prototype:

int set_channel_weight_target(char channel,
		float channel_weight_target,
		float blend_tin,
		float blend_tout,
		const char* blend_function_name = 0);
Description:

This function schedules a smooth ramp of the channel weight from its current value to the specified target value.

This function is equivalent to calling set_channel_weight() many times over the course of a gesture.

Calling this function removes any pending channel weight targets added by calls to either set_channel_weight_target() or add_channel_weight_target().

Arguments:

channel which channel to affect; pass a single upper case character (e.g., 'A')
channel_weight_targettarget channel weight; a value between 0 and 1
blend_tin when, relative to the start of the gesture, the channel weight should begin moving toward channel_weight_target
blend_tout when, relative to the start of the gesture, the channel weight should arrive at channel_weight_target
blend_function_name name of the curve to use to move between current channel weight and target channel weight
The possible blend function names are:

"HalfSine"half of a sine curve going from 0 to 1; good blend function for smooth entry and exit
"Linear" linear line from 0 to 1
Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacterGesture::add_channel_weight_target

Prototype:

int add_channel_weight_target(char channel,
		float channel_weight_target,
		float blend_tin,
		float blend_tout,
		const char* blend_function_name = 0);
Description:

This function is similar to set_channel_weight_target(), but adds the channel weight target to a queue of pending targets. The gesture will not begin moving the current channel weight to the specified target until all pending channel weight targets from previous calls to set_channel_weight_target() and add_channel_weight_target() have been reached.

Arguments:

channel which channel to affect; pass a single upper case character (e.g., 'A')
channel_weight_targettarget channel weight; a value between 0 and 1
blend_tin when, relative to the start of the gesture, the channel weight should begin moving toward channel_weight_target
blend_tout when, relative to the start of the gesture, the channel weight should arrive at channel_weight_target
blend_function_name name of the curve to use to move between current channel weight and target channel weight
Perl Example:

        #
        #  Create a gesture.
        #
        $gesture1 = $ch1->create_gesture("example_gesture");

        #
        #  Set the starting channel weight of channel 'A' to 0.2.
        #
        $gesture1->set_channel_weight('A', 0.2);
    
        #
        #  Set a channel weight target.  This call essentially does this:
        #
        #  Smoothly change the channel A weight of the gesture from its
        #  current value (0.2) to 0, starting at 1.5 seconds into the
        #  gesture, finishing 3.5 seconds into the gesture.
        #
        $gesture1->set_channel_weight_target(
            'A',                # channel to change
            0.0,                # target weight
            1.5,                # when to start changing
            3.5,                # when to stop changing
            "HalfSine");        # curve to use for blend
        
        #
        #  Add another channel weight target.  This call essentially does this:
        #
        #  Smoothly change the channel A weight of the gesture from its
        #  last set channel weight (0) to 0.8, starting at 3.5 seconds into
        #  the gesture, finishing 5.5 seconds into the gesture.
        #
        $gesture1->add_channel_weight_target(
            'A',
            0.8,
            3.5,
            5.5,
            "HalfSine");
        
        #
        #  We're done tweaking the gesture.  Set its automatic destroy flag
        #  so that it will be deleted when the gesture has completed.
        #
        $gesture1->set_automatic_destroy_flag(1);
Returns:

0 on success, -1 on failure

Callable From:

function diguyCharacterGesture::get_scripted_object

Prototype:

bdiGestureArcInstance* get_scripted_object();

Alphabetical Index


Copyright (C) 1992-2003

Boston Dynamics

ALL RIGHTS RESERVED.

These coded instructions, statements, and computer programs contain unpublished proprietary information of Boston Dynamics and are protected by Copyright Laws of the United States. They may not be used, duplicated, or disclosed in any form, in whole or in part, without the prior written consent from Boston Dynamics.

RESTRICTED RIGHTS LEGEND

Use, duplication, or disclosure by the government is subject to restrictions as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Sofware clause at DFARS 252.227-7013 and/or in similar or successor clauses in the FAR, or the DOD or NASA FAR Supplement, or to subparagraphs (c)(1) and (c)(2) of the Commercial Computer Software--Restricted Rights at 48 CFR 52.227-19, as applicable. Unpublished-rights reserved under the Copyright Laws of the United States.

Contractor/Manufacturer is:

Boston Dynamics/515 Massachusetts Avenue/Cambridge MA 02139.