diguyChainSimulation

Generated from diguyChainSimulation.h

DI-Guy API Version 12.5.1

This file was automatically generated from diguyChainSimulation.h. Do not edit this file directly; the changes will be lost.
Includes: declspec_diguy.h

Contents:

Alphabetical Index

class diguyChainSimulation

class BDI_DECLSPEC_diguy diguyChainSimulation
{
public:
    diguyChainSettings* get_settings();
    int update_settings(const char* settings);
    int do_stabilization_time_runoff(float time_runoff);
    void set_is_frozen(int is_frozen);
    int get_is_frozen();
    int set_chain_mass_connection_character(int chain_mass_index,
        const char* character_name,
        const char* link_name = NULL,
        float link_offset_x = 0.0f,
        float link_offset_y = 0.0f,
        float link_offset_z = 0.0f,
        float connection_smoothing_period = 0.1f);
    int set_chain_mass_position(int chain_mass_index,
        float mass_x,
        float mass_y,
        float mass_z,
        int fix_mass_position);
    int set_chain_mass_positions_along_path_shape(diguyPathShape* path_shape,
        int stretch_to_fit = 1);
    int set_chain_mass_position_is_fixed(int chain_mass_index,
        int is_fixed);
    int get_chain_mass_position_is_fixed(int mass_index);
    float get_length();

function diguyChainSimulation::get_settings

Prototype:

diguyChainSettings* get_settings();
Description:

This function returns the chain settings this chain simulation is using.

Returns:

object of type diguyChainSettings; will never be NULL

Callable From:

function diguyChainSimulation::update_settings

Prototype:

int update_settings(const char* settings);
Description:

This function sets the settings this chain simulation will use.

Arguments:

settingsname of new settings to use
Returns:

0 on success, -1 on failure

Callable From:

function diguyChainSimulation::do_stabilization_time_runoff

Prototype:

int do_stabilization_time_runoff(float time_runoff);
Description:

This function runs the simulation forward the specified number of seconds, to let the chain settle into a stable configuration.

Note that the chain will appear to achieve the new configuration instantly.

Specifying a large amount of time can result in a frame rate hitch.

Arguments:

time_runoffhow much time to run off, in seconds
Returns:

0 on success, -1 on failure

Callable From:

function diguyChainSimulation::set_is_frozen

Prototype:

void set_is_frozen(int is_frozen);
Description:

This function can 'freeze' or 'unfreeze' a chain.

If a chain is frozen, all chain masses will remain in their current positions and will not move until the chain is unfrozen.

A frozen chain requires no simulation time.

Arguments:

is_frozen pass 1 to freeze the chain; 0 to unfreeze
Callable From:

function diguyChainSimulation::get_is_frozen

Prototype:

int get_is_frozen();
Returns:

1 if chain is frozen, 0 if not

Callable From:

function diguyChainSimulation::set_chain_mass_connection_character

Prototype:

int set_chain_mass_connection_character(int chain_mass_index,
    const char* character_name,
    const char* link_name = NULL,
    float link_offset_x = 0.0f,
    float link_offset_y = 0.0f,
    float link_offset_z = 0.0f,
    float connection_smoothing_period = 0.1f);
Description:

This function connects a chain mass to a character, or disconnects a chain mass if the passed character_name is NULL.

As the character moves the chain mass will move with it, dragging adjacent masses along. This allows a firefighter to pick up one end of a hose and drag the hose to a new location, for example.

In each time-step of the scenario a new position for the specified chain mass will be computed based on the position of the character.

When the chain sim is created, and when the scenario is reset, one chain mass will be automatically connected to the chain's character. The index of the mass that will be connected is set by a call to diguyChainSettings::set_index_of_chain_mass_connected_to_character().

Chain masses can be connected to a specific link of the connection character by passing the link's name. If NULL is passed, the connection will be made to the character's "position" link. Note that a non-NULL link name must be used for the link offset arguments to have an effect.

The chain mass can gradually be shifted from its current position to the connection position using the connection_smoothing_period argument. Passing in 0.5, for example, will cause the link to shift to its new connection point within approximately 0.5 seconds, avoiding an abrupt and potentially ugly impulse to the simulation.

Arguments:

chain_mass_index index of chain mass
character_name name of character to attach to; must not be NULL
link_name name of link to attach to; can be NULL; if so, will attach to character's base position
link_offset_x link attachment offset in X
link_offset_y link attachment offset in Y
link_offset_z link attachment offset in Z
connection_smoothing_periodhow much time to take, in seconds, to gradually shift the chain mass to its new connection point
Returns:

0 on success, -1 on failure

Callable From:

function diguyChainSimulation::set_chain_mass_position

Prototype:

int set_chain_mass_position(int chain_mass_index,
    float mass_x,
    float mass_y,
    float mass_z,
    int fix_mass_position);
Description:

This function sets the position of one chain mass, and optionally fixes it there.

The passed position is always relative to the chain character's parent, if there is one.

If the fix_mass_position argument is 1, the chain mass will remain fixed in the new position, as if set_chain_mass_position_is_fixed(1) were called.

Arguments:

chain_mass_index index of chain mass; pass -1 to affect all chain masses
mass_x position x
mass_y position y
mass_z position z
fix_mass_positionpass 1 to fix chain mass in place; 0 to leave it free to move
Returns:

0 on success, -1 on failure

Callable From:

function diguyChainSimulation::set_chain_mass_positions_along_path_shape

Prototype:

int set_chain_mass_positions_along_path_shape(diguyPathShape* path_shape,
    int stretch_to_fit = 1);
Description:

This function sets the positions of all chain masses to lie along the passed path shape.

If the stretch_to_fit argument is 1, chain masses will be spaced along the entire length of the path shape. If the path shape is longer than the nominal length of the chain, the chain will be stretched out. If the path shape is shorter, the chain will be compressed.

Arguments:

path_shape path shape for new chain mass positions
stretch_to_fitpass 1 to stretch chain to take up entire length of path_shape; pass 0 to leave chain at its nominal length
Returns:

0 on success, -1 on failure

Callable From:

function diguyChainSimulation::set_chain_mass_position_is_fixed

Prototype:

int set_chain_mass_position_is_fixed(int chain_mass_index,
    int is_fixed);
Description:

This function can fix or unfix a chain mass in place. If it is fixed the chain mass will remain in its current position until it is unfixed.

Fixed chain masses do not require simulation time, so the more masses in a chain that are fixed, the lower the computational load of the chain simulation.

Arguments:

chain_mass_indexindex of chain mass; pass -1 to affect all chain masses
is_fixed pass 1 to fix chain mass position; 0 to unfix it
Returns:

0 on success, -1 on failure

Callable From:

function diguyChainSimulation::get_chain_mass_position_is_fixed

Prototype:

int get_chain_mass_position_is_fixed(int mass_index);
Returns:

1 if chain mass is fixed, 0 if not

Callable From:

function diguyChainSimulation::get_length

Prototype:

float get_length();
Returns:

length of the chain

Callable From:


Alphabetical Index




Copyright (C) 1992-2012 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/78 Fourth Avenue/Waltham MA 02451.