182

Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

  • Upload
    others

  • View
    17

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding
Page 2: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

Digital Biomechanics 1.0 User Guide Physics-based Virtual Prototyping Software

Part No. Digital Biomechanics 1.1.1 User Guide

Copyright © 2005, Boston Dynamics

Digital Biomechanics is a trademark of Boston Dynamics

Boston Dynamics 515 Massachusetts Avenue

Cambridge, MA 02139 Telephone: 617-868-5600

Fax: 617-868-5907

Page 3: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

Digital Biomechanics Software License Agreement This is a legally binding agreement between you (“LICENSEE”) and Boston Dynamics, with its principal place of business at 515 Massachusetts Avenue, Cambridge, MA (“Boston Dynamics”). By breaking the seal on the package containing the Digital Biomechanics software product, and/or by installing and/or using the enclosed software, data, models, documentation, or related recorded information, regardless of its form or the method of the recording (the “SOFTWARE”), LICENSEE is agreeing to be bound by the terms and conditions of this agreement, including the software license and disclaimer of software warranty below. Please read this document carefully before opening the package and using the SOFTWARE. If LICENSEE does not agree with the terms and conditions of this agreement, LICENSEE should promptly return the unopened package and the SOFTWARE to the place where it was obtained, and LICENSEE will be given a full refund of any license fee that LICENSEE paid. 1. Grant of License: Subject to the terms and conditions of this Agreement, Boston Dynamics hereby grants to LICENSEE a non-transferable and non-exclusive right to use and execute the SOFTWARE on a single computer system at one time. LICENSEE agrees that it will not reverse engineer, decompile or disassemble any portion of the SOFTWARE, nor extract data of any kind from the SOFTWARE, including but not limited to motion data, 3D models, textures, texture movies, image sequences, terrain databases and the like. If LICENSEE disposes of any media or apparatus containing SOFTWARE, LICENSEE will ensure that it has completely erased or otherwise destroyed any SOFTWARE contained on such media or stored in such apparatus. LICENSEE may not distribute, lease, transfer, export, loan or otherwise convey the SOFTWARE or any portion thereof to anyone. 2. Copying Restrictions: In order to effect LICENSEE's license rights hereunder, it may install the SOFTWARE by copying it onto the hard disk drive or into the CPU memory of a computer system for use thereon, and may make full or partial copies of the SOFTWARE, but only as necessary for backup or archival purposes. LICENSEE agrees that (i) LICENSEE's use and possession of such copies shall be solely under the terms and conditions of this Agreement, and (ii) LICENSEE shall place the same proprietary and copyright notices and legends on all such copies as included by Boston Dynamics on the media containing the authorized copy of the SOFTWARE originally provided by Boston Dynamics. 3. Ownership: LICENSEE agrees and acknowledges that Boston Dynamics transfers no ownership interest in the SOFTWARE, in the intellectual property in SOFTWARE, nor in any SOFTWARE copy to LICENSEE under this Agreement or otherwise, and that Boston Dynamics and its licensors reserve all rights not expressly granted hereunder. After LICENSEE pays any applicable license fees, LICENSEE will own the media on which the SOFTWARE was originally provided hereunder and on which LICENSEE subsequently copies the SOFTWARE, but Boston Dynamics and its licensors shall retain ownership of all SOFTWARE and copies of the SOFTWARE or portions thereof embodied in or on any media.

4. Transfer Restrictions: LICENSEE may not sublicense, transfer, or assign this Agreement or any rights or obligations under this Agreement, in whole or in part. 5. Export Restrictions: LICENSEE agrees not to export or re-export, directly or indirectly, from the United States through any country or to any country of ultimate destination defined by the United States Government or any agency thereof as an “Excluded Territory”. LICENSEE will not export, directly or indirectly, the Licensed Programs or Documentation to any country from which the United States Government or any agency thereof requires an export license or other governmental approval at the time of export without first obtaining such license or approval. The U.S. Government's list of “Excluded Territories” is subject to change without notice and is therefore not included herein. 6. Confidentiality: By accepting this license, you acknowledge that the SOFTWARE and accompanying materials, and any proprietary information contained in the media, are proprietary in nature and contain valuable confidential information developed or acquired at great expense. You agree not to disclose to others or utilize such trade secrets or proprietary information except as provide herein. 7. Enforcement of Terms: If LICENSEE fails to fulfill any of its obligations under this Agreement, Boston Dynamics and/or its licensors may pursue all available legal remedies to enforce this Agreement, and Boston Dynamics may, at any time after LICENSEE's default of this Agreement, terminate this Agreement and all licenses and rights granted under this Agreement. LICENSEE agrees that Boston Dynamics's licensors referenced in the SOFTWARE are third-party beneficiaries of this Agreement, and may enforce this Agreement as it relates to their intellectual property. LICENSEE further agrees that, if Boston Dynamics terminates this Agreement for default, LICENSEE will, within ten (10) days after any such termination, deliver to Boston Dynamics or render unusable all SOFTWARE originally provided hereunder and any copies thereof embodied in any medium.

Page 4: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

8. Governing Law: This Agreement shall be governed by and interpreted in accordance with the laws of the Commonwealth of Massachusetts, excluding its choice of law rules. 9. U.S. GOVERNMENT PURCHASES: If SOFTWARE is acquired for or on behalf of the U.S. Government, then: a. It is recognized and agreed that the SOFTWARE: (i) was developed at private expense; (ii) was not required to be originated or developed under a Government contract; (iii) was not generated as a necessary part of performing a Government contract; and (iv) was not accomplished during and necessary for the performance of a Government contract. b. It is recognized and agreed that SOFTWARE is commercial computer software, as that term is used in FAR Parts 12 and 27.4 (and any applicable agency supplements thereto), and DFARS Parts 211.70, 227.4 (OCT 1988), 227.71 (JUN 1995) and 227.72 (JUN 1995). c. If this purchase is subject to FAR Part 27, and FAR 52.227-19 has been incorporated into the terms of this purchase, the Government's rights in the SOFTWARE are no greater than RESTRICTED RIGHTS as specified in FAR 52.227-19. d. If this purchase is subject to DFARS Part 227 (OCT 1988), the Government's rights in the SOFTWARE are no greater than RESTRICTED RIGHTS as specified in DFARS 252.227-7013(c)(1)(i). e. The Government's rights in the SOFTWARE are no greater than the rights expressly stated in the body of this Standard Licensing Agreement, if this purchase is subject to (i) FAR Part 12; (ii) FAR Part 27, and FAR 52.227-19 has not been incorporated into the terms of this purchase; (iii) DFARS Part 211.70; (iv) DFARS Parts 227.71 and 227.72 (JUN 1995); or (v) any other regulation or clause permitting the contractor to deliver commercial computer software under the contractor's standard commercial license. f. Any related technical data shall be delivered to the Government with no more than limited rights. 10. DISCLAIMER OF SOFTWARE WARRANTY: Boston Dynamics PROVIDES THE SOFTWARE TO LICENSEE “AS IS” AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION ANY WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR WITH RESPECT TO INTELLECTUAL PROPERTY OWNERSHIP, NO ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY ANY Boston Dynamics EMPLOYEE, REPRESENTATIVE OR DISTRIBUTOR WILL CREATE A WARRANTY FOR THE SOFTWARE, AND LICENSEE MAY NOT RELY ON ANY SUCH INFORMATION OR ADVICE. 11. Limited Warranty on Media: Boston Dynamics warrants the media on which SOFTWARE is recorded and provided to LICENSEE under this Agreement to be free from defects in materials and workmanship under normal use for a period of ninety (90) days after the date of the

original delivery of SOFTWARE to LICENSEE. Such warranty is solely for LICENSEE's benefit and LICENSEE has no authority to assign, pass through or transfer this warranty to any other person or entity. If LICENSEE returns any defective media to Boston Dynamics or an authorized Boston Dynamics representative during the warranty period with proof of purchase, Boston Dynamics will, at its sole option, either replace such defective media or refund the purchase price for such media. This warranty will not apply to any media that has been damaged by abuse, accident or misuse. The foregoing warranty sets forth Boston Dynamics's entire liability and LICENSEE's exclusive remedy for any defects in any media and is in lieu of, and Boston Dynamics disclaims, all other warranties, express, implied, or otherwise, including without limitation any warranty of merchantability or fitness for a particular purpose. 12. LIMITATION OF LIABILITY: IN NO EVENT SHALL Boston Dynamics OR ITS LICENSORS BE LIABLE TO LICENSEE FOR ANY SPECIAL, CONSEQUENTIAL, INCIDENTAL OR INDIRECT DAMAGES OF ANY KIND (INCLUDING WITHOUT LIMITATION THE COST OF COVER, DAMAGES ARISING FROM LOSS OF DATA, USE, PROFITS OR GOODWILL, OR PROPERTY DAMAGE), WHETHER OR NOT BOSTON DYNAMICS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY ARISING OUT OF THIS AGREEMENT. THESE LIMITATIONS SHALL APPLY NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY LIMITED REMEDY. BOSTON DYNAMICS's LIABILITY ARISING OUT OF THIS SOFTWARE LICENSE AGREEMENT AND/OR LICENSEE'S USE OR POSSESSION OF THE SOFTWARE, INCLUDING WITHOUT LIMITATION ANY AND ALL CLAIMS COMBINED, WILL NOT EXCEED THE AMOUNT OF THE LICENSE FEE LICENSEE PAID FOR THE SOFTWARE PROVIDED UNDER THIS AGREEMENT. 13. Laws Governing Warranties and Liability: The law(s) of a jurisdiction may define the scope of warranty to be provided for products or the manner in which a supplier's liability may be limited, and such law(s) shall govern this Agreement only to the extent a party protected by such law(s) cannot waive the protection thereof by contract. In the U.S. and other countries, some states, territories or other principalities do not allow the limitation or exclusion of liability for incidental or consequential damages, or allow the exclusion of implied warranties, so the limitation and exclusion above may not apply to LICENSEE, and LICENSEE may have other rights that vary from state, territory or principality to state, territory or principality

Page 5: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

1

Table of Contents 1 INTRODUCING DIGITAL BIOMECHANICS ......................................................................7

1.1 INSTALLING DIGITAL BIOMECHANICS..............................................................................9 1.2 USING DIGITAL BIOMECHANICS WINDOWS .....................................................................9

1.2.1 3D View Window.................................................................................................11 1.2.2 Scenario Explorer ...............................................................................................11 1.2.3 Camera Window .................................................................................................12 1.2.4 Log Window ........................................................................................................12

1.3 SIMULATION PROCESS: DIGITAL BIOMECHANICS MODES ..............................................13 1.3.1 Working in Setup Mode ......................................................................................14 1.3.2 Working in Simulation Mode ...............................................................................15 1.3.3 Working in Playback Mode. ................................................................................15 1.3.4 Working with BDIPlot ..........................................................................................15

1.4 TYPE CONVENTIONS USED IN THIS BOOK ....................................................................16 1.5 FILE FORMATS ...........................................................................................................17 1.6 MAIN WINDOW MENUS ...............................................................................................18

2 QUICK START TUTORIAL...............................................................................................23 2.1 SET UP A SCENARIO...................................................................................................23 2.2 SET A VARIABLE TO BE RECORDED .............................................................................27 2.3 RUN AND RECORD A SIMULATION................................................................................28 2.4 PLAY A RECORDED SIMULATION..................................................................................29 2.5 RUN AND RECORD A SECOND SIMULATION ..................................................................31 2.6 COMPARE TWO SIMULATIONS .....................................................................................32 2.7 VIEW PLOTS OF VARIABLES IN BDIPLOT......................................................................35 2.8 ADD CONTACT POINTS TO THE BRICK..........................................................................40

3 USING CAMERAS IN THE 3D VIEW WINDOW ..............................................................50 3.1 DIGITAL BIOMECHANICS SPACE...................................................................................51 3.2 UNDERSTANDING THE CAMERA ...................................................................................51 3.3 USING THE CAMERA WINDOW.....................................................................................54

3.3.1 Cameras .............................................................................................................55

Page 6: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

2

3.3.2 Camera Settings .................................................................................................55 3.3.3 Camera Movers ..................................................................................................57

3.4 CHANGING THE CURRENT CAMERA SETTINGS .............................................................62 3.4.1 Changing to a Default Camera ...........................................................................63 3.4.2 Renaming a Default Camera ..............................................................................63 3.4.3 Changing a Camera to Reuse in this Session....................................................63 3.4.4 Saving and Reusing Your Cameras for Other Sessions ....................................64

4 WORKING IN SETUP MODE ...........................................................................................65 4.1 TO ENTER SETUP MODE.............................................................................................65 4.2 ADDING OBJECTS WITH THE SCENARIO EXPLORER ......................................................65

4.2.1 To Create a New Scenario .................................................................................67 4.2.2 To Add a Character ............................................................................................70 4.2.3 To Add Static Equipment to a Character ............................................................79 4.2.4 To Add Custom Static Equipment.......................................................................81 4.2.5 To Add a Sensor.................................................................................................83 4.2.6 To Add a New Pose............................................................................................86 4.2.7 To Add a Prop.....................................................................................................87 4.2.8 To Add a Visual Material.....................................................................................88

4.3 COPYING, CUTTING, AND PASTING OBJECTS ...............................................................91 4.4 ADDING A CONTACT PAIR ...........................................................................................92

4.4.2 To Add a Collision Property ................................................................................97 4.4.3 To Add a Vector Type.........................................................................................98

4.5 POSING OBJECTS IN THE 3D VIEW WINDOW ..............................................................100 4.5.1 To Activate the Posing Tool..............................................................................100 4.5.2 Base Joint with Six DOF ...................................................................................101 4.5.3 To Select a Joint ...............................................................................................102 4.5.4 To Select a DOF ...............................................................................................103 4.5.5 To Pose an Object ............................................................................................104 4.5.6 To Adjust a Joint ...............................................................................................104 4.5.7 To Change the Camera in the Posing Tool, Press Alt......................................104 4.5.8 To Undo and Redo Pose Edit ...........................................................................105

Page 7: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

3

4.5.9 To Save a Pose ................................................................................................105 4.5.10 To Copy and Paste a Pose...............................................................................105 4.5.11 To Pose Equipment and Props.........................................................................105

5 WORKING IN SIMULATION MODE...............................................................................107 5.1 TO ENTER SIMULATION MODE ..................................................................................107 5.2 TO RUN A SIMULATION .............................................................................................107 5.3 SIMUI WINDOW........................................................................................................108

5.3.1 To Create a Group............................................................................................110 5.4 SIMULATION COMMANDS ..........................................................................................112 5.5 GOAL FILE COMMANDS.............................................................................................114 5.6 MISCELLANEOUS COMMANDS ...................................................................................114 5.7 USING THE END STATE OF A SIMULATION AS INITIAL CONDITIONS FOR ANOTHER SIMULATION........................................................................................................................115

6 WORKING IN PLAYBACK MODE .................................................................................117 6.1 TO ENTER PLAYBACK MODE.....................................................................................117 6.2 PLAYBACK CONTROLS ..............................................................................................117

7 WORKING WITH BDIPLOT............................................................................................119 7.1 TO ENTER BDIPLOT.................................................................................................119

7.1.1 Variable List Window ........................................................................................121 7.1.2 Data Window.....................................................................................................121 7.1.3 Command Window ...........................................................................................122 7.1.4 Using BDIPlot with Matlab ................................................................................126

8 CHARACTER SIMULATIONS........................................................................................129 8.1 SEQUENCE OF CALCULATIONS ..................................................................................129

8.1.1 Time ..................................................................................................................130 8.2 CREATING SIMULATION SCRIPTS...............................................................................131 8.3 STANDARDIZED CHARACTER VARIABLES ...................................................................131

8.3.1 All characters have a base joint, which was introduced in the section To Activate the Posing Tool .............................................................................................................131 8.3.2 Position, Velocity, Acceleration.........................................................................132 8.3.3 Zero Configuration ............................................................................................132

Page 8: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

4

8.3.4 Mass Properties................................................................................................133 8.3.5 Gravity...............................................................................................................133 8.3.6 Joint Servos ......................................................................................................134 8.3.7 Joint Limits ........................................................................................................135 8.3.8 External Forces.................................................................................................136 8.3.9 Integrators.........................................................................................................136 8.3.10 Integrals of Motion ............................................................................................137

8.4 NOTES ON SIMULATION SPEED .................................................................................138 9 BATCH MODE PROCESSING.......................................................................................139 10 LITTLEDOG MODEL ......................................................................................................142

10.1.1 Model Structure ................................................................................................142 10.2 EXAMPLE BEHAVIOR.................................................................................................144

10.2.1 Walking .............................................................................................................144 11 FREEBODY MODEL.......................................................................................................145 12 MODELING DYNAMIC EQUIPMENT.............................................................................146 13 COLLISION PROPERTY METHODS AND PARAMETERS..........................................147

13.1 WHAT MAKES A GOOD COLLISION PROPERTY? .........................................................147 13.2 LSPRING_LDAMPER METHOD....................................................................................148 13.3 NLSPRING_LDAMPER METHOD .................................................................................149 13.4 NLSPRING_NLDAMPER METHOD ..............................................................................150 13.5 NLSPRING WITH HYSTERESIS METHOD......................................................................152 13.6 LSPRING_LDAMPER_STRAP METHOD ........................................................................153 13.7 CHOOSING STABLE COLLISION PROPERTY PARAMETERS ...........................................154

13.7.1 Choosing Parameters for the Lspring_Ldamper Method .................................155 13.7.2 Quick Ground Contact Parameter Choices for LittleDog..................................161 13.7.3 Choosing Parameters for the NL-L Method......................................................162 13.7.4 Choosing Parameters for the NL-NL Method ...................................................162

14 WRITING CUSTOM CONTROL CODE..........................................................................164 14.1 CHECK YOUR SETUP ................................................................................................164

14.1.1 Class Hierarchy Overview ................................................................................165 14.2 SIMULATION VARIABLES............................................................................................167

Page 9: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

5

14.2.1 Declaring the Variable ......................................................................................167 14.2.2 Initializing and Adding the Variable to the Simulation ......................................167

14.3 CREATING A CUSTOM CONTROLLER..........................................................................168 14.4 FORWARD KINEMATICS.............................................................................................169 14.5 READING SENSORS ..................................................................................................170 14.6 READING INTERACTION FORCES ...............................................................................172

14.6.1 Reading Forces on Equipment .........................................................................172 14.6.2 Reading All Forces on a Link............................................................................173

14.7 RECOMMENDED BEST PRACTICES.............................................................................173

Page 10: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

6

Page 11: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

7

1 Introducing Digital Biomechanics Digital Biomechanics is a new tool for physics-based human simulation. Unlike previous human simulators, Digital Biomechanics uses control systems to regulate behavior as the simulated humans perform tasks and respond to events in their environment. Digital Biomechanics is used by scientists, engineers, analysts, and equipment designers for virtual prototyping of equipment for human use.

You use Digital Biomechanics by selecting a human to simulate from the anthropometry library, importing an equipment design, attaching it to the simulated human, selecting a behavior and control system, running a set of simulations, and collecting and analyzing the data — all before physical prototypes are built. Digital Biomechanics provides sophisticated, physics-based simulation, validated anthropometry, and advanced human control. It reduces design and test cycles, minimizes the risks of testing on live subjects, and enables you to get more effective equipment to the field in a shorter period of time.

Simulate Humans Engaged in Tasks

Digital Biomechanics is physics-based human simulation software. It models humans and equipment using forward dynamics models that include the effects of gravity, mass loading, and collision with the environment. It also uses robot-control technology so that each simulated human can regulate their movements to perform tasks and adapt to changes in the environment or equipment. Simulated humans run, walk, crawl and perform other specific tasks. The simulations obey laws of locomotion, balance, and dynamic loading like real people in the physical world. Digital Biomechanics allows you to design and add your own control systems to increase the repertoire of simulated behavior.

Human Models

In Digital Biomechanics, you can study humans with different sizes and shapes. A range of human models derived from validated anthropometry datasets are included. They include models that range from 14 degrees of freedom (DOF) for a human restricted to movement in the sagittal plane to 33 and 46 DOF models for fully articulated motion in 3D space.

Equipment Models You can attach pieces of equipment to the simulated humans to study the impact of the equipment on performance. Digital Biomechanics allows the user to import equipment models using a standard graphics format (.obj) with mass properties defined by the user. The equipment can be attached to the human model with various methods ranging from rigid attachment to fully dynamic suspension systems with cushioning pads and straps wrapping over body parts.

Advanced Visualization

View your simulated experiments using real-time 3D graphics displays. Control camera position to view the experiment from any angle, track a human or focus on a particular point of interest. Visualize contact forces between simulated humans and the equipment or the environment.

Page 12: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

8

Analysis

Comprehensive simulated biomechanical data allows users to evaluate equipment designs in the context of the task. Digital Biomechanics plots movement and force data directly. You can export data to Matlab for further analysis. The combination of 3D visualization and numerical analysis communicates simulation results in a powerful and intuitive way.

Digital Biomechanics improves the development process by allowing designers to:

• Accelerate development Immediate performance feedback enables designers to test, refine, and retest prototype designs quickly, earlier than physical prototypes can be built.

• Reduce cost Precise modeling in the design phase exposes design flaws before money is spent on physical prototyping and field testing.

• Predict performance Accurate, validated simulations of active human behavior allow performance to be measured across a range of situations.

• Reduce risk Reveal serious design issues during testing on simulated humans—not live ones.

• Analyze impact Trace the effects of equipment design changes on performance through controlled test environments and virtual obstacle courses.

In the next section, this manual tells you how to get started using Digital Biomechanics and applying it to your simulation needs. In the rest of this chapter, we provide an overview of the functionality of Digital Biomechanics. If you want to jump right in and start using it though, skip to Chapter 2, Quick Start Tutorial.

Page 13: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

9

1.1 Installing Digital Biomechanics Install Digital Biomechanics on a computer running Windows 2000 / XP as follows.

1. Close any open programs. (You will have to restart your computer at the end of the installation.)

2. If you are upgrading from a previous version of Digital Biomechanics, new files, scenarios, poses, and cameras that you have created will be preserved.

3. Insert the CD in your CDROM drive.

If the installation does not start automatically, find and click Setup.exe on the provided Digital Biomechanics CD. The installation will guide you through the remaining steps.

4. Make sure you restart your computer before running Digital Biomechanics.

1.2 Using Digital Biomechanics Windows When you start Digital Biomechanics, the main window is displayed.

Main Window

The main window displays four windows in which you can create and manipulate your scenarios. A scenario is a collection of simulated humans, equipment, environments, and tasks that comprise your simulation project.

Page 14: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

10

These windows are described in detail in later chapters of this book.They are introduced here.

3D View Window Scenario Explorer

Camera Window Log Window

Page 15: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

11

1.2.1 3D View Window The 3D View window diplays your project using 3D graphics. Here you can view your simulated characters with their equipment, pose these objects, and review data from previously-run simulations.

3D View Window

1.2.2 Scenario Explorer The Scenario Explorer displays your objects in a hierarchy. In the Scenario Explorer window, you can add, define properties of, edit, delete, cut, copy, paste, and examine objects, such as simulated characters, equipment, and props.

Page 16: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

12

1.2.3 Camera Window A camera controls the parameters of the 3D view into the simulated world. The Camera window displays properties of the current camera. A camera has a number of properties, such as camera position, where it is pointing, its orientation (whether it is right side up or tilted, for example), and how the camera moves with mouse motion.

1.2.4 Log Window The Log window provides useful feedback during scenario creation and simulation. Any errors or messages are displayed in the log window.

Page 17: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

13

1.3 Simulation Process: Digital Biomechanics Modes Simulation-based analysis is a cyclic process where results from one simulation are compared to those of another. This method allows us to understand the effect of changes in equipment design on performance of the simulated human. For example, Digital Biomechanics has been used to study how changes in the loading of a backpack affect body posture during walking (see the example below). The design parameter in this case was backpack center of mass location and the analysis parameter was the lean angle of the human during steady state walking. The analysis cycle consisted of setting the backpack center of mass, running the simulation, then reviewing the results. This cycle was repeated for various levels of the design parameter (backpack COM location). During each run of the simulation, data was gathered on the analysis parameter (lean angle). After several runs, the lean angle resulting from the various backpack COM locations could be compared. In general, the simulation process boils down to repetition of these three basic steps with the user making adjustments to the design parameter between runs.

The backpack COM was moved to one of nine locations (upper left). Walking simulations of the human were performed for each case, including one for no backpack. Note how body posture changes with each case (upper right). Simulation data for the lean angle of the human for all ten cases were compared to each other and to data from live human subject experiments (lower right). Live subject data courtesy of United States Army Research Institute for Environmental Medicine.

EXAMPLE:

Page 18: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

14

Digital Biomechanics is created with these three basic steps of simulation in mind. The Digital Biomechanics user interface has three modes:

• Setup Mode: Configure your simulation, choose or edit humans, equipment, tasks, and design parameters

• Simulation Mode: Run the simulation. Equations of motion are used to compute how humans move as a result of your chosen inputs.

• Playback Mode: Review the results using 3D graphics and time history plots.

1.3.1 Working in Setup Mode

Access Setup mode with this icon in the main window tool bar:

You use Setup mode to choose elements in your simulation scenario, assign their properties and establish their starting configuration or initial condition. In Setup mode, you can

• Add and edit objects (humans, equipment, props, and poses) to your scenario

• Use the posing tool to pose your characters, equipment, or props.

• Set parameters of the dynamic models used in simulations.

Posing tool toolbar is displayed in 3D View window when you are in the Setup Mode:

Setup Mode

Choose or edit character, equipment

& tasks

Simulation Mode

Compute motion of simulation elements

Playback Mode BDIPlot

Review and compare simulation data

Page 19: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

15

1.3.2 Working in Simulation Mode

Access Simulation mode with this icon in the main window tool bar:

You use Simulation mode to run dynamic simulations of your characters in action. Simulation mode advances time and calculates motions and forces according to physics-based models of the elements in your scenario. In Simulation mode, you can

• Run simulations for a desired length of time.

• Change or adjust simulation parameters on the fly

• Collect data for subsequent analysis and review.

Simulation toolbar is displayed in the 3D View window when you are in the Simulation Mode.

1.3.3 Working in Playback Mode.

Access Playback mode with this icon in the main window tool bar:

You use Playback mode to review and analyze simulation data, compare simulation experiments, or create a movie by recording whatever is played.

In Playback mode, you can play a simulation or play multiple simulations simultaneously:

• Forwards or backwards

• Frame-by-frame

• In a continuous loop

• By selected segment of the simulation

Playback toolbar is displayed in the 3D View window when you are in the Playback Mode:

1.3.4 Working with BDIPlot In addition to the 3 basic steps of performing a simulation, Digital Biomechanics includes a tool to help you plot the data that was collected.

Access BDIPlot with this icon in the main window tool bar:

Page 20: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

16

Accessing BDI plot will launch several windows which will be explained in later chapters. You can use BDIPlot to plot recorded data from one or more simulations to analyze numeric differences.

1.4 Type Conventions Used in this Book This book uses the following type conventions:

Convention Meaning

italics Shows variables; for example, where you replace filename with the name of an actual file. Also shows terms introduced and defined for the first time.

Lucida Console Shows computer input, computer output, and commands. In syntax statements shows what you enter exactly as is. Shows screen text, menu items, buttons, and titles of dialogs. Shows directory and file names.

{ } curly braces In syntax statements, shows a series of items from which you must pick one. Example: {x,y,z}

[ ] square brackets In syntax statements, shows optional items. Example: [x,y,z]

Enter Run 5. Type Run 5 and press the Enter key.

Page 21: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

17

1.5 File Formats As you use Digital Biomechanics, you will at times need to know the meanings of file extensions. The table below lists file types used by the software.

File Type Function

Digital Biomechanics Scenario Files (.dbs)

Contains setup information for your scenario. It may be associated with recorded data. It contains both the beginning and end states of a simulation, including a value for every variable, the list of variables to record in the buffer, and the list of variables to send through open pipes. Each time that you open your simulation, it starts where you last left off.

Configuration Files (.cfg) Contains information about character size and shape, and mass properties (mass, center of mass and inertia matrix).

Digital Biomechanics Equipment Files (.dbe)

An equipment file describes the shape, size, and mass properties of static equipment.

Script Files (.script)

Script files are used to perform a sequence of commands in simulation mode. These files normally assign values to only a subset of the simulation’s variables. Script files can be used to perform a series of simulations with minimal operator attention. Any command that can be entered at the SimUI command line may be included in the .script file.

Directory with a name: basename_date_time,

such as floortilt_20030307_150955.

Each result file has an associated directory that contains data files for the simulation

Data Files (.data)

Data files hold recorded simulation data. These files have an ASCII header followed by data in either an ASCII or binary format. BDIConvert can be used to convert data files from ASCII to binary or back. BDIPlot can be used to view and plot data files. Data files have a .data extension. Each scenario has a .data file for the scenario, as well as one for each character.

Goal Files (.goal)

Goal files specify input trajectory for controllers. The goal file format is the same as a simulation data file. These files have a .goal extension.

Page 22: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

18

1.6 Main Window Menus Glance through the menus in the Digital Biomechanics main window, defined in the table below.

File Menu Function New Creates a new scenario. Open Opens an existing scenario. Close Closes the open and currently active scenario. Close All Closes all open scenarios. Save Saves the active scenario under the existing name. Save As Saves the active scenario under a new name. Export Geometry Exports the bounding box off the selected piece of equipment to a file.

Export formats supported: *.obj, *.stl, *.iges, *.wrl Load Camera Settings Loads a previously saved camera properties file. Save Camera Settings Saves a camera properties file for future use. Exit Exits Digital Biomechanics.

Edit Menu Configure Views Modifies the appearance of the 3D window view (i.e. sky color, etc.)

Displays the View Configuration window. (See description below.). Movie Maker Sets movie export properties.

Window Menu Cascade Displays open windows as descending and overlapping. Scenario, 3D View, Log, Camera

Check to display. Uncheck to remove from display

Help About Provides Digital Biomechanics version and copyright information

Page 23: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

19

Button Bar

Button Function

Creates a new scenario.

Opens an existing scenario.

Saves the active scenario under the existing name.

Toggles display of Scenario Window

Toggles display of 3D Window

Toggles display of Camera Window

Toggles display of Log Window

Place application in “Setup Mode”

Place application in “Simulation Mode”

Place application in “Playback Mode”

Launch BDIPlot

View Configuration Dialog

Using the View Configuration dialog properties of the 3D environment can be specified.

Access View Configuration Dialog by selecting Configure View… under the Edit menu.

Page 24: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

20

Control Function Sky

Show [file] Hide/Show the sky. If the sky is not displayed, the background will be a solid color.

Background Specify red, green, blue components of background color.

Floor Shows the current grid/floor width/height and allows the user to change these values.

Grid Hide/Show the system grid. The grid shows the XY plane. Move slider to change the size of the grid squares.

Coordinate System Hide/Show the system coordinate system at the origin. The coordinate system shows the three axes, red (X), green (Y), blue (Z). The slider can be used to change the coordinate system graphics’ size

Movie Maker Preferences

Digital Biomechanics can output a series of TIFF image files of the 3D View Window, which can be assembled into a movie (AVI or Quicktime ) using a separate program such as Adobe PremierTM.

Movie export Preferences can be set using the Movie Maker Preferences dialog.

Access Movie Maker Preferences by selecting Movie Maker… under the Edit menu. Note you must be in Playback Mode to access the movie maker preferences.

Page 25: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

21

Control Function Output Directory Directory for the produced image files. Filename Prefix The prefix automatically added to all exported TIFF files. Frame dt Elapsed time between exported TIFF frames. Frame Size Exported TIFF size (width x height) in pixels. The 3D View

window is resized to match the requested size. Do not make these numbers larger than your graphics frame buffer width or height or the results will be unpredictable. To use the current window size press the “Grab Current” button.

TIFF Compression None Image is exported without compression. JPEG Image is exported using lossy JPEG compression. Deflate Image is exported using deflate algorithm

TIFF Output Format Single Image TIFF Files Produces many single image files.

Page 26: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

22

Multi Image TIFF Files Produces a single file containing all the individual movie frames. This type of TIFF file may not be supported by your TIF viewer or movie generation program.

Frames Recorded The number of image files created, with the count beginning at 0, (so that the number shown will be used to name the next file created).

Example: If the prefix is frame and the number shown is 68, the next file produced is named frame.068.

Reset If you click Reset, the number suffix appended to the exported filename will restart at 0, overwriting existing files with the same name in the output directory.

Remove Files Deletes all files in the specified directory that start with the specified prefix.

Page 27: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

23

2 Quick Start Tutorial Follow the steps in this chapter to learn to use Digital Biomechanics’ basic features. This tutorial leads you to create two scenarios and visually compare their simulations. Each scenario contains a brick and a tilted floor. The two floors in the scenarios have different coefficients of friction (degrees of slipperiness). You will watch the two bricks slide down the floor and see effect of changing the coefficient of friction.

This tutorial shows you to how to:

• Set up and save a scenario.

• Use the posing tool.

• Change the camera.

• View and change properties in the Scenario Explorer.

• Run and record a simulation.

• Play a recorded simulation.

• Compare two simulations side-by-side.

• View plots in BDIPlot.

• Add contact points to the brick.

2.1 Set Up a Scenario 1. Open Digital Biomechanics with Start > Programs > Digital Biomechanics > Digital

Biomechanics.

2. Click File > Open

3. In the browser, open the file Examples\brick\brick_polygon.dbs.

In the 3D View window, a cube, here called brick, is displayed against a navy blue floor.

Page 28: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

24

First you are going to move the camera so you can see the flat floor in relation to the brick. Next, you are going to tilt the floor.

4. Click the left mouse button and drag the mouse. Notice that your view of the brick changes.

The camera position is changing with the mouse movement.

5. Shift-click the left mouse button and move the mouse up and down. Notice that your view of the brick changes from closer to further.

6. Move the camera till you can see the flat floor in relation to the brick. The brick starting location is slightly above the floor.

You need to elevate the brick for this tutorial.

7. Click the posing tool in the lower right corner of the 3D View window

By default the floor is selected. The posing tool displays graphic handles corresponding to each DOF (Degree of Freedom) on the base joint on the floor. You want to select the brick.

8. To select the brick, Shift-click the brick.

Page 29: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

25

The orange circular graphic handle is selected by default.

The first time that you work through this tutorial, it is better if you do not experiment with the graphic handles, so that your brick looks like the one in these pictures.

9. Pressing the spacebar will cycle through the graphics handles; press the space bar until the vertical blue graphic handle is highlighted.

10. Move your mouse up to move the brick further away from the floor till the height approximately

matches the height shown below.

11. Click the posing tool to turn the posing tool off

Page 30: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

26

12. In the Scenario View window left pane, expand brick_polygon and Props by double-clicking the

plus signs.

13. In the left pane, highlight prop. This prop represents the floor in the simulation.

14. In the right pane, change Pitch to 0.2 and press Tab.

15. You see the floor tilt. And you see a brick, a floor, and a grid.

You may have to move the camera so that the orientation matches the picture below.

The grid shows the XY plane. In Digital Biomechanics space, the vertical axis is the Z axis.

Page 31: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

27

16. Click File > Save As and save your file with the name floortilt.

An extension of .dbs (Digital Biomechanics scenario) is automatically appended. Your new file floortilt.dbs is saved in the brick\examples directory.

2.2 Set a Variable to be Recorded 1. In the Scenario Explorer, open the characters group and highlight brick.

2. In the right pane, click the Commands tab and the Variable View tab.

3. Expand the right pane and the Key column by clicking and sliding the line between ‘key’ and

‘value’

4. Expand the qd’s group by clicking on the plus sign next to qd’s.

Page 32: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

28

5. Click in the Record column of the qd.x variable (velocity).

An R is displayed in the Record column to show that (if saved) this variable will be recorded during a simulation. We will use this variable later in this tutorial while using BDIPlot.

6. Click Apply.

7. Click Save Configuration.

8. The log window will display a message confirming completion of the save operation.

9. Click File>Save to save the scenario. This step will also save the changes made to the configuration.

2.3 Run and Record a Simulation 1. In the main toolbar, click the Simulation Mode icon.

A small window (SimUI) with information about the simulation is displayed.

2. Move the SimUI window out of the way or minimize it.

3. Notice that the bottom of the 3D View window changes to display Simulation mode controls.

Page 33: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

29

4. Select 10 from the drop-down menu, asking the simulation to run for 10 seconds.

5. Click Run.

The brick falls to the ground and slides or tumbles. Red force vectors show where the brick is contacting the floor.

6. The brick comes to a rest.

7. Click Save at the bottom of the 3D View window.

The Save As window opens with a default name filled in. The default name is composed of the current date and time (mmddyy_hhmmss.dbs), followed by a .dbs extension.

8. A window will appear asking if you want to load the saved simulation, click No

2.4 Play a Recorded Simulation In this section, you will play a recorded simulation.

1. Return to the Set-Up mode by clicking the button.

2. Right click on an open area on the left side of the Scenario Explorer, click on ‘Open Scenario…’

Page 34: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

30

Alternatively, you can click File > Open. If you are asked to close the open scenario before

opening a new one. answer No. By having more than one scenario open; they are readily accessible for modification and inspection. You can also save yourself some work by copying/pasting items between scenarios when you are in the Setup Mode.

3. Double-click the dbs file you just saved in the browser.

For example, we select floortilt_20030307_150955.dbs.

Notice that, in addition to a .dbs file, a directory with the same base name will also exist. This directory contains data files for the simulation and should not be deleted.

4. Once the file has been loaded, click the main window toolbar’s Playback Mode icon.

The bottom of the 3D View window changes to display Playback Mode controls.

5. Click the play button . The simulation replays and you again see the brick fall to the ground.

6. Notice that the Max field reflects 9.999, the length of the data file. At the end of the playback, the Current field also says 9.999. The slider moved from left to right during the playback.

Page 35: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

31

7. Move the slider to the left to watch the simulation occur in reverse.

8. Double-click the rectangle above the slider till it highlights in green.

9. Move the right triangle to the left till the Max number is approximately 3.

10. Move the slider to the left till Current is 0.

11. Click the loop control .

The simulation plays the first three seconds of the data file over and over again (looping).

12. Click stop to end the playback

13. Look at the Scenario Explorer.

There are two scenarios listed now, Floortilt and Floortilt0. Floortilt0 is shaded yellow indicating that, in addition to the scenario file used to set up the simulation, this scenario also includes data from a recorded simulation.

2.5 Run and Record a Second Simulation In this section, you are going to create a second simulation with less contact friction, simulating a more slippery floor.

1. In the Scenario Explorer, return to your original scenario by clicking Floortilt (no yellow highlighting).

2. In the main toolbar, click the Setup Mode icon .

The bottom of the 3D View window changes to display Setup Mode controls.

3. In the Scenario Explorer, expand Floortilt and expand Contact by clicking the plus signs.

4. Highlight default Collision Property.

Page 36: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

32

5. In the right pane, change mu, the coefficient of friction, to 0.2 and press Tab.

6. Save this scenario as floortilt_mu2.dbs using File > Save As.

7. Click Simulation Mode

8. Select 10 from the dropdown menu of times and click Run.

This time the brick slides much further.

9. Click Save. Make a note of the default file name. Ours is floortilt_mu2_20030307_174636.

10. Click Save in the browser to save your second simulation. When asked if you want to load the simulation, click Yes. This can be done in Simulation Mode

2.6 Compare Two Simulations In this section, you will view your two scenarios side-by-side and watch the brick slide further on the more slippery floor.

1. If you did not load the simulation in the previous section, enter the setup mode, open the new .dbs file using File > Open.

2. When it asks if you want to close the other open scenarios, say No.

You now have two scenarios with data open, superimposed on each other.

Page 37: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

33

Next you will close the initial scenario.

3. In the Scenario Explorer left pane, right click on the initial scenario, it will be the scenario that does not have a yellow highlight. Choose Close

Next you will offset one brick so that you can see them side by side.

4. In the Scenario Explorer left pane, highlight the scenario that you just opened.

In the Scenario Explorer right pane is a Scenario properties page. Although you cannot edit object properties in Playback mode, you can edit Scenario properties in Playback mode.

5. In the main toolbar, click Playback Mode .

6. In the scenario window, click the Visibility Settings tab.

7. In the Playback Offsets section, enter 1.5 for the Y axis and press Tab.

Page 38: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

34

In the 3D View window shown below, one brick is right behind the other.

8. Move the camera till you can see both bricks easily.

Page 39: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

35

9. You can change the focal distance by pressing Shift and either mouse button and dragging the mouse up and down (Shift + any mouse button + Drag up and down).

10. Slide the slider to the left to start at the beginning till Current is 0. Leave the 3 second limit.

11. Click play .

You see the two bricks slide at different rates.

12. Turn on looping by clicking loop .

13. Experiment with the Speed setting to slow down or speed up the action.

14. Experiment with the slider by clicking and dragging it to different locations to stop the action in the middle, move the action frame-by-frame, or move the action in reverse.

15. Experiment with the camera to view the action at different angles.

2.7 View Plots of Variables in BDIPlot In this section, you will view four plots for your two recorded simulations. You will compare plots of velocity and acceleration for the two simulations.

1. Click the BDIPlot icon .

On your desktop, three BDIPlot windows are displayed.

Page 40: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

36

The Variable List window may be displaying two files from your active scenario, a motion file (yourfilename_brick.data), and a contact file (yourfilename_db.data).

2. Close the file on the right, the db.data file, by clicking the Close File button at the bottom of the list.

3. In the Scenario Explorer, select the second scenario and click the BDIPlot button again. A dialog

box will appear asking you how to proceed. Select “connect to existing bdiPlot” and click Ok.

Page 41: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

37

Data for the new scenario will be added to the variable list. Once again, close the right most list of variables by clicking Close File.

You now have two motion files open in the Variable List window.

4. Scroll down and click qd.x (velocity) in the left window and click the top plot window in the

Data window. Recall that you set this variable to be recorded earlier in this tutorial in “Set a Variable to be Recorded”).

You can see that the velocity for the scenario with the higher friction setting begin swiftly and then slows. The name of the variable is in the title of the plot. (The jagged line at the end is caused by the way the contact force is defined for the brick. The force moves from corner to corner causing the brick to rock gently. We’ll show how to eliminate this later.)

5. Scroll down and click qd.x in the right window and click the second plot window in the Data window.

Page 42: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

38

You can see that the velocity of this scenario gets steadily faster to the end of the scenario.

Now view the two plots for position.

6. Click q.x for the first simulation and click a plot.

7. Click q.x for the second simulation and click a plot and notice the difference with the first

position plot.

8. Now plot both positions in the same window. Click q.x for the second simulation and click the

plot that contains q.x for the first simulation.

We will use Smallscale to view the start of this plot where the difference is noticeable.

9. Click this plot opposite .5 on the x axis. The red line moves to this position. The right-hand plot barely shows anything as the two lines are so close together with this vertical scale.

10. Click Smallscale in the Command window.

Page 43: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

39

The vertical axis is scaled so that you can more closely view the plot at this location.

You can see that the two simulations begin at the same position and then diverge as the simulations continue.

Next, we will integrate velocity to get position and check that the plot of the integral of velocity is the same as the plot of position.

Then we will differentiate position to get velocity and check that the plot of the differential of position is the same as the plot of velocity.

11. Click Deriv/Int in the Command window and click qd.x (velocity). Click Integrate in the popup dialog. Click OK in the Integration Bounds dialog, accepting the defaults. Accept the default of name of Integral of qd.x.

12. Scroll to the bottom of the Variable List. Click the new variable Integral of qd.x and click the position plot for the first simulation to plot the new variable.

Observe that a black line for the Integral of qd.x has been drawn on the plot and it, indeed, exactly matches the plot of position.

Perform steps 13 and 14 to create an Integral of qd.x for the second simulation and plot it on the position plot of the second simulation.

13. Click Deriv/Int in the Command window and click q.x (position). Click Differentiate in the popup dialog. Accept the default name of d(q.x)/dt.

14. Scroll to the bottom of the Variable List. Click the new variable d(q.x)/dt and click the velocity plot for the first simulation to plot the new variable.

Page 44: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

40

They exactly coincide as they should.

Perform steps 15 and 16 to create a d(q.x)/dt variable for the second simulation and plot it on the position plot of the second simulation.

When you are done, close BDIplot

2.8 Add Contact Points to the Brick Contact detection can be a computationally expensive process. Therefore, by default, the software does not calculate collision between objects until you explicitly tell it to. In this section, you see how to set up collision properties between objects in the scenario. In this tutorial, you add four contact points (we call them pieces of equipment) to the corners of the brick. Since collision is always calculated on a pair-wise basis, we designate that each contact point can collide with the floor. We designate what properties these collision pairs should have and associate different colored force vectors with each pair. Then we watch the brick slide. The colored force vectors show the strength of the force at each corner where the corner collides with the floor.

1. Close all the scenarios you have open.

1. Open brick_polygon.dbs.

2. Click File > Save As and name this scenario Brick-Dots.dbs.

3. Arrange the camera so you can see the bottom of the brick, or go to the Cameras window and selecting Bottom from the pull down menu.

You will see:

Page 45: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

41

You are going to add four contact points to the corners of the bottom of the brick.

4. In the Scenario Explorer, right-click the brick Character and select New Equipment Kit.

5. Right-click the new entry, Equipment Kit and select New Equipment Entry.

6. In the Equipment Properties page, rename the piece of equipment as dot.

7. Select Type as point.

8. Set the size of the point with scale settings of .05 for x, y, and z. Everything else stays at zero. (The collision software treats the point as a point, i.e. for collision purposes the size of the object is ignored and only the location of the point is used for determining contact. Scaling is used to make point objects easier to see.)

9. Click Suspension tab.

10. Set the location of this point on the x, y , and z axes as -.5, .5, and -.5 respectively.

Page 46: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

42

Your new contact point is at one corner of the brick. We exaggerated the size for clarity. In actual simulations, you can make your contact points much smaller.

Now you will copy this dot three times.

11. Right-click the word dot and select Copy.

12. Move the cursor to the kit – Equipment Kit entry, right-click, and select Paste.

13. Repeat the last step two times till you have four dots listed, dot, dot0, dot1, and dot2.

Page 47: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

43

Next move the last three dots to the other corners of the bricks.

14. On the Suspension page of each of the last three dots, enter the values shown in the table below for the Pose.

Dot x y z dot -.5 .5 -.5

dot0 .5 -.5 -.5

dot1 .5 .5 -.5

dot2 -.5 -.5 -.5

When you are done, the brick has four contact points, one on each corner.

15. Select File > Save to save your work.

2.8.1.1 Add Four New Colored Vector Types Next you will add four vector properties of different colors.

1. Right-click Vector Types and select New Vector Property.

A new vector property is added called red 0.

2. Create three more new vector properties, which are called red1, red2, and red3 by default.

Page 48: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

44

3. Click on any of the new vector properties you created. On the Vector property page of any of the new vector properties, change the name to Blue with an R value of 102, G of 102, B of 204.

4. Name a second Gold, with a color of R 255, G 204, B 102.

5. Name a third Green, with a color of R 102, G 255, B 51.

6. Name the fourth Purple, with a color of R 153, G 51, B 204

Naturally you can name these vectors with any colors you want and choose your own RGB values. We have shown the colors used in the tutorial for convenience.

7. Check that your floor is tilted with a pitch of .2 by clicking Props > Floor. .

8. Select File > Save to save your work.

2.8.1.2 Add Contact Pairs

Next you will add contact pairs which designate the newly added points as participants in a collision pair with the floor.

2.8.1.2.1 There are 3 ways to add contact pairs: 1. Select via pull-down menu 2. Select via mouse clicking 3. Edit Text

For the example we are constructing, we need to define 4 contact pairs.

2.8.1.2.2 To add a pair via pull-down menu: 1. Click Contact on the left side of the Scenario Explorer window. If there are any contact

entries in the contact table, click clear table, so we can start fresh for this example.

2. Click ‘Add a pair’ on the left side of the Scenario Explorer window

3. A contact pair is defined. This pair is defined based on the logic in the software. We will

assume for this example that this is not the contact pair you want defined. 4. Right click on the highlighted item under ‘Contact Piece 1’ 5. Select ‘Select Via Pull Down Menu’

Page 49: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

45

6. From the pull down menu, select a contact piece. As you highlight pieces of equipment, they

will be highlighted in the 3D window. Select prop:base_f. 7. Right click on the highlighted item under ‘Contact Piece 2’ 8. Select ‘Select Via Pull Down Menu’ 9. From the pull down menu, select a contact piece. As you highlight pieces of equipment, they

will be highlighted in the 3D window. Select brick:kit_dot. 10. The first contact pair is defined. All the contact pairs can be defined this way. However, for

this example, we will define the other contact pairs in various other ways.

2.8.1.2.3 To add a pair via mouse click: 1. Click ‘Add a pair’ 2. Right click on the highlighted item under ‘Contact Piece 1’ 3. Select ‘Select Via Mouse clicking’ 4. A window pops up:

Piece: indicates the contact piece that is selected.

There are three ways to define a contact piece via mouse clicking: a. Shift + Click in the 3D View Window b. Click on the piece of Equipment in the Scenario Explorer

Page 50: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

46

c. Click on a Contact Table Entry. 5. To define a contact piece by Shift + Click in the 3D window

a. Push the Shift button b. Select one of the dots on the corner of the block. Keeping choosing points until you

click on floor:base_f. c. As you click, the name of the point you selected appears in the Piece field. When

floor:base_f appears in the piece field, click ‘Ok’. This function is useful if there are few objects in the 3D window, and the contact piece can be easily identified.

6. We will define the second piece of this contact pair by clicking on the equipment in the Scenario Explorer. To define a contact piece by clicking on the equipment in the Scenario Explorer

a. Right click on the highlighted item under ‘Contact Piece 2’ b. Select ‘Select Via Mouse clicking’ c. When the window pops up, select the contact piece in the Scenario Explorer. Select

brick:kit_dot0. d. The name of the contact piece should appear in the ‘Piece:’ textbox, the floor

should become highlighted in the 3D View Window and the Scenario Explorer will display information about that contact piece.

e. Click ‘Ok’ This function may be useful if the contact piece is not easily seen in the 3D window.

7. We need to define a total of 4 contact pairs for this example simulation, we have defined 2 pairs so far:

8. We will now define another contact pair. The first piece will be defined by mouse clicking

in the Scenario Explorer; the second piece will be defined by clicking on a contact table entry. Click ‘Add a pair’ To define the first piece, repeat #7 a-e, selecting brick:kit_dot1.

9. To define a contact piece by Clicking on a contact table entry a. Right click on the highlighted item under ‘Contact Piece 2’ b. Select ‘Select Via Mouse clicking’ c. When the window pops up, select floor:base_f from the previous contact pair. d. The name of the contact piece should appear in the ‘Piece:’ textbox and the floor

should become highlighted in the 3D View Window. The contact table will not be updated until you click ‘Ok’

e. Click ‘Ok’ This function may be useful if the same contact piece is used repeatedly in different contact pairs (i.e., for defining contact between the floor and several parts of the body). We will add the final contact pair by the ‘Editing Text Method’

Page 51: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

47

2.8.1.2.4 To add a pair by editing text: 1. Click Contact on the left side of the Scenario Explorer window 2. Click ‘Add a pair’ 3. Right click on the highlighted item under ‘Contact Piece 1’ 4. Select ‘Edit Text’ 5. Type ‘floor:base_f ’ 6. Right click on the highlighted item under ‘Contact Piece 2’ 7. Select ‘Edit Text’ 8. Type ‘brick:kit_dot2’ All four contact pairs are defined, the contact table should look like:

Select File > Save to save your work.

2.8.1.2.5 Possible Errors 1. The selection may not be valid if the contact piece is incompatible with the type of contact

defined in the ‘Collision Property’ column. If the selection is not valid, a warning will appear:

Page 52: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

48

If this warning appears, change either of the contact pieces and/or the collision property to be compatible.

2.8.1.3 Once the Contact pairs are defined, select vector property (color) 1. Under Vector Property, select a color for the vector.

2.8.1.4 Notes for working with the contact table: 1. Every time a pair is defined, all of the contact pairs are checked for validity. Any invalid

pairs will result in the Error Message (section 2.8.1.2.5). 2. Clicking on a column header (i.e., ‘Contact Pair 1’, ‘Contact Pair 2’, ‘Collision Property’,

‘Vector Property’) will sort descending by that column. Click again to sort ascending by that column. Once the column is sorted, the selection you made is still highlighted. This function is useful if you want to find other contact pairs with the same contact pieces.

3. Repeatedly clicking ‘Add a Pair’ will initially keep the Contact piece 1 (for instance prop:base_f)constant and will cycle through the equipment list for contact piece 2 (for instance brick:kit_dot, brick:kit_dot0, brick:kit_dot1, brick:kit_dot2). This is a quick and easy way to set up a contact table for an object that is composed of multiple pieces of equipment or contact pieces.

4. To delete a contact pair, select the pair in the contact table and click ‘Delete’. 5. If a contact pair is defined, and you try to define the same contact pair again, an error

message appears:

Page 53: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

49

2.8.1.5 Run the Simulation

1. Click the Setup icon .

2. Select 10 from the drop-down list of times and click Run.

3. Notice the different vectors and the different sizes of the vectors showing different forces at each corner.

4. Click Save to save your simulation.

Page 54: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

50

3 Using Cameras in the 3D View Window The 3D View window display the scenario using 3D graphics. In any mode, the 3D View can be used to:

• Change the camera view, location, motion, and object tracking using mouse clicks and movements.

• Set the camera to follow the action by tracking an object (Looking At) or dollying with an object (Looking From).

• Define and save a camera that includes its view, location, motion, and what objects it tracks.

• Access saved cameras with a default camera menu or hotkeys.

Examples of 3D Graphic Displays of Scenarios

Page 55: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

51

3.1 Digital Biomechanics Space The Digital Biomechanics 3D world exists in Cartesian space within an X,Y, and Z coordinate system. The 3D View of a scenario displays a grid as a visual aid to show the XY plane. The origin of the world is in the middle of the grid.

Digital Biomechanics Space

3.2 Understanding the Camera The 3D View window displays your scenario from one camera at a time. The current camera is defined by a set of camera settings including camera position, fixation point, orientation, and how the camera moves when you move the mouse.

You can change settings for the current camera. You can also define a new camera by saving the current camera settings and giving these settings a name. Seven default cameras are provided when DB is started. You can change the settings of the default cameras and/or rename the default cameras.

This section defines the terms used in the Camera window to change the camera.

Term Definition Figure

Look At (Fixation Point), Look From (Camera Position) A camera has something that it Looks At, also called the fixation point, and somewhere that it Looks From, also called camera position. Look At and Look From points can be defined with X,Y,Z coordinates or with objects.

Page 56: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

52

Focal Distance The distance from the Look At point and the Look From point is the Focal Distance; units are meters.

Field of View The Field of View is the width of the camera view; units are degrees.

Clipping Planes Near and Far Clipping Planes define the near and far limits of the viewing frustum; units are in meters from the Look From point.

Orientation The camera orientation defines where the camera is pointed. It is set in degrees for yaw, roll, and pitch.

Page 57: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

53

Look From Character: Dollying –The camera is dollying with a character if the Look From point follows a character. Use dollying if you want the camera to move with a character.

Look At Character: Tracking The camera is tracking a character if the Look At point follows a character. You specify a joint and an optional offset in meters. Use tracking to keep a character centered in the 3D View when either the camera or character is moving.

Tracking a Character and Dollying to the Same Character with an Offset: This is a particularly useful mode; the camera keeps a character centered in the 3D view as it moves with the character.

Page 58: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

54

3.3 Using the Camera Window You can precisely control your view and define your own cameras with the Camera window.

The Camera window settings are described in the sections and tables below.

Page 59: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

55

3.3.1 Cameras The Camera section has the following controls:

Window Item Function

Camera Drop-down menu Specifies the name of the current camera. New Click to create a new camera. Delete Click to delete a camera. Rename Click to rename the current camera. Save Click to save the current camera window settings with the named

camera. Status Saved if the current settings have been saved.

Modified if you have made changes, but not yet clicked Save. Reset Click to return to default camera settings.

3.3.2 Camera Settings Change where the camera is located and what it is viewing in the Camera Settings section of the Camera window.

Some settings or camera movers (discussed in the section Camera Movers) disable some camera settings.

Similarly, certain settings in the Camera Manager enable and disable other settings.

Page 60: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

56

The Camera Settings section has the following settings:

Frequently-Adjusted Camera Settings

The following settings are frequently adjusted, either by you directly or by the software as you move the mouse.

Window Item Function

Look From Sets where the camera is looking from. Position X,Y,Z Location of the camera. If the camera is dollying with a character,

then the character determines the camera position. Offset X,Y,Z If you select a character with which to dolly, you can locate the

camera at an offset to the character’s selected joint. Disabled if you do not select a character.

World Coord If checked, the offset uses world coordinates. If not checked, the offset uses local coordinates.

Char You can select a character with which the camera will dolly. Link If you select a character with which to dolly, you can locate the

camea on a link. If you select none, the base joint is used.

Look At Sets what the camera is looking at. Fix Pt X,Y,Z A fixation point at which the camera is looking. Offset X,Y,Z If you select a character to track, you can track an offset to the

selected link. Disabled if you do not select a character Locked Sets the camera to track a fixed point in space. World Coord If checked, the offset uses world coordinates. If not checked, the

offset uses local coordinates. Char You can select a character at which you want the camera to look.

The camera then tracks this character. Link If you select a character to track, you can select a specific link to

track. If no link is selected, the base link is assumed.

Page 61: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

57

Rarely-Adjusted Camera Settings

The following settings are not adjusted often, either by users or by the software as you move the mouse.

Window Item Function

Orientation Defines the direction in which the camera is looking.

Active only if the camera is not tracking a character. Yaw, Roll, Pitch Degrees around the Z, X, and Y axes respectively.

Lens Focal Dist Shows the distance between the camera Look-From point to the

camera Look-At point. As you move the mouse to change the camera, this figure changes. You will seldom change this manually.

FOV (deg.) Shows the viewing frustrum of view of the camera. This changes infrequently.

Clipping Planes Determines the amount of culling done. Near Clip The camera sees nothing closer than the Near Clip. (Everything

closer is clipped.) Far Clip The camera sees nothing further than the Far Clip. (Everything

further is clipped.)

3.3.3 Camera Movers A camera mover specifies how mouse clicks and moves modify the camera’s position and fixation points. There are four different camera mover types. Movers chiefly affect camera position, camera fixation, and camera offsets. The table below briefly describes the movers. Detailed descriptions follow.

Page 62: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

58

Mover Type Description Drag 1) Click either mouse button + Drag to rotate the camera position, 2) Shift-click +

Drag up or down to change focal distance, and 3) Ctrl-click + Drag to pan (camera keeps position, but changes what it is looking at by swinging view left and right, up and down).

Pros: Precise camera control.

Con: Requires you to move the mouse considerably. Fly 1) Press a mouse button to make the camera move quickly - fly - though 3D space.

2) Press both buttons + Drag to pan or rotate cameras.

Pros: Little mouse movement required. Can fly through large spaces quickly.

Con: Difficult to use for precise positioning, Plan View 1) Press a mouse button to make the camera fly though space constrained along an

axis. 2) Press both buttons to move the camera perpendicular to the viewing axis.

Pros: Provides for easy orientation-constrained movement of cameras by limiting camera movement and orientation to the world axes (x,y,z).

Con: You cannot reorient the camera off-axis. Difficult to use for precise positioning.

None Camera ignores mouse movements and buttons.

3.3.3.1 Drag If the Camera Mover is set to Drag, dragging the mouse changes the camera. The three figures below show how mouse motions work when the Drag Camera Mover is set to Drag and tracking is on, tracking is off, and dollying is on, respectively.

Drag Camera Mover with Tracking - If the Drag camera mover is selected and you have selected an object to track, the mouse works as follows:

Page 63: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

59

Drag Camera Mover without Tracking - If the Drag camera mover is selected and you have not selected to track an object (in the Look At section), the mouse works as follows:

Drag Camera Mover with Dollying - If the Drag camera mover is selected and you have selected a character with which the camera will dolly (in the Look From section), the mouse works as follows:

Speed Settings

The Drag camera mover has two speed settings, defined in the table below:

Property Function m/pix Meters per pixel determine how rapidly the camera pans, zooms, or rotates

with respect to how far the mouse has been moved.

Page 64: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

60

deg/pix Degrees per pixel determine how rapidly the camera pans, zooms, or rotates with respect to pixel movements of the mouse on the screen (that is, how much a mouse drag affects the camera settings).

3.3.3.2 Fly The Fly camera mover lets the camera fly through 3D space, covering great distances with small movements. The figures below show how mouse movements affect the camera when the Flyer camera mover is selected.

Fly Camera Mover without Tracking - If the Fly camera mover is selected and you have not selected to track an object (in the Look At section), the mouse works as follows with the Left/Right mover setting, the Forward/Back mover setting, and the Up/Down mover setting:

Fly Camera Mover with Tracking If the Fly camera mover is selected and you have selected an object to track, the mouse works as follows:

Page 65: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

61

Speed Settings

The fly camera mover has three speed settings defined in the table below:

Property Function m/s Meters-per-second determines how rapidly the camera zooms or pans with

respect to how long the mouse has been pressed. m/pix Meters-per-pixel determines how rapidly the camera zooms or pans with

respect to pixel movements of the mouse on the screen (that is, how much mouse dragging affects the camera settings).

d/pix Degrees-per-pixel determines how rapidly the camera zooms or pans with respect to pixel movements of the mouse on the screen (that is, how much mouse dragging affects the camera settings).

3.3.3.3 Plan View With the Plan View camera mover on, you cannot reorient the camera. The camera always looks in the direction specified by the Look At Setting.

Plan View with Either Mouse Button or with Both Mouse Buttons

Page 66: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

62

Mover Settings

The Plan View camera mover has 3 mover settings, described in the table below.

Property Function m/s Meters per second determine how rapidly the camera zooms or pans with

respect to how long the mouse has been pressed. m/p Meters per pixel determine how rapidly the camera zooms or pans with

respect to pixel movements of the mouse on the screen (that is, how much a mouse drag affects the camera settings).

Look At X,Y, Z grid

Specifies the Look At direction of the camera – specifically, along which axis and in which direction the camera should look at.

3.3.3.4 Camera Mover None

If None is selected, all camera settings remain fixed and moving your mouse has no effect on the camera.

3.4 Changing the Current Camera Settings In every camera mode, clicking mouse buttons and moving the mouse changes the camera. In addition, you can change the current camera using one of the following procedures.

Page 67: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

63

3.4.1 Changing to a Default Camera • Click a default camera on the menu on the 3D View window.

The camera changes are applied to the selected camera. The view and the mouse motion change accordingly.

Hotkeys: You can also access the default cameras using keys 1-7 on the keyboard. The first three new cameras that you create can be accessed with 8-0 respectively.

3.4.2 Renaming a Default Camera The cameras on the default camera menu can be renamed.

1. Click the default camera that you want to rename.

2. Set the camera settings you want in the Camera window.

3. Click Rename, enter a new name, and click OK.

Your renamed camera is now on the list of default cameras in place of the one you renamed.

3.4.3 Changing a Camera to Reuse in this Session 1. Change any settings in the Cameras window.

2. Press Tab after each setting change to see it applied.

The status message changes to Modified, letting you know that you have made changes that you have not yet saved.

3. Click Save.

The status message changes to Saved. Your changes are saved to the current camera name your_camera_name.

Page 68: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

64

The current camera retains these settings as long as you remain until you exit Digital Biomechanics. To save these settings to use in your next Digital Biomechanics session, follow the procedure in the next section, Saving and Reusing Your Cameras for Other Session.

3.4.4 Saving and Reusing Your Cameras for Other Sessions You might have certain cameras that work particularly well for your work that you want to be able to save for future Digital Biomechanics’ sessions.

1. Change and save settings in the Cameras window to desired settings for any default camera or any new camera (as described in the section above, Changing a Camera to Reuse in this Session.

2. Before exiting Digital Biomechanics, select File > Save Camera Settings.

3. Give your cameras’ file a name, such as SueCameras.

4. The next time you open Digital Biomechanics, to reuse your saved cameras, select File > Load Camera Settings.

Your saved cameras are reloaded and available for this Digital Biomechanics’ session instead of Digital Biomechanics’ default cameras.

Page 69: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

65

4 Working in Setup Mode You configure your simulation and choose its initial conditions in Setup Mode. In Setup Mode, you can create new scenarios and add objects to your scenarios, such as humans, equipment that they carry, the terrain that they are walking on, and what elements might collide with each other.

In Setup mode, you

• Add, define, and edit humans, robots, other characters, equipment, and props using the Scenario Explorer.

• Add contact relationships between elements so they can collide.

• Pose characters, equipment, and props using the posing tool.

• Cut or copy and paste characters, equipment and props from one scenario to another or from one element to another.

• Set parameters of the dynamic models and initial conditions used in simulation.

• Change the camera by moving the mouse, clicking a camera button, or using the Camera window.

4.1 To Enter Setup Mode

• Click the Setup icon .

The bottom of the 3D View window displays posing tool icons.

4.2 Adding Objects with the Scenario Explorer Use the Scenario Explorer to populate your scenario with objects. A scenario consists of one or more objects that comprise your simulation. Typically it might consist of a human with equipment, performing an action and a prop, such as the floor, that the human touches. This section introduces you to the Scenario Explorer, the interface for adding and editing these elements. In the subsections that follow, we define in more detail each of the major elements of a scenario.

To display the Scenario Explorer,

1. If you don’t have a scenario open, select File > Open.

2. Browse to the examples directory and select a scenario to open.

Page 70: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

66

Objects in the scenario are listed hierarchically in the left pane of the Scenario Explorer. The right pane contains properties for the object highlighted in the left pane.

You can expand and contract groups of objects by clicking the plus sign or minus sign, as in Windows Explorer.

In the left pane, objects for each scenario are grouped according to type:

• Characters

• Contacts (Collision properties)

• Props

• Vector Types

• Visual Materials

Page 71: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

67

As shown by the subgroups below the character, a character can have

• Poses • Equipment kits (A kit is one or more pieces of equipment.)

When you highlight an object in the left pane, its property page is displayed in the right pane.

Property page fields are described later in this chapter.

4.2.1 To Create a New Scenario 1. Before creating the new scenario, close the current one. Once that is done, click File > New.

2. You might want to create a new directory in the db folder for your new project, such as Backpack_Experiments.

3. Give the scenario a meaningful name, such as Backpack_COM.

Page 72: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

68

The new scenario is listed in the Scenario Explorer along with some default categories and objects:

The Scenario Properties page, consisting of two tabs, is displayed in the right-hand pane.

4.2.1.1 Simulation Values

The Simulation Values page is used to set certain system-wide dynamic simulation parameters. These parameters are held constant across all character simulations in order to facilitate their interaction.

The functions of the Simulation Values are defined below:

Simulation Tab Property

Function

File Names of the scenario file Abbr A shortened version of the scenario’s filename to ease scenario

identification Plant DT Interval for computing equations of motion and performing numerical

integration. This must be the smallest increment of time in the simulation.

Record DT Interval for recording data in buffer.

Page 73: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

69

Record Buffer Size Size of the buffer set aside to store simulation data. (Units are seconds of simulation time). Making this number too large slows down loading time of the simulation. Once the record buffer is full, the software starts overwriting the oldest data first.

4.2.1.2 Visibility Settings The Visibility Settings page is used to hide or unhide the individual elements of the scenario. This is in contrast to the visibility settings that are system wide and affect all the simulations that are running at the same time. The visibility settings are also used to spatially offset one scenario (or group of characters) from another. These settings are especially useful in playback mode when more than one scenario may be displayed at once. The example below shows the visibility settings for several characters in a scenario.

The Visibility Settings tab lets you choose options for the appearance of your simulation.

Page 74: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

70

Property Function Show Scenario Toggles the display of the simulation. Enable Settings Toggles the activation of the settings on this page. If unchecked, it

displays the standard visual material. Time offset (seconds) Enter a number of seconds for which the time is offset, usually used to

offset two scenarios from each other.

X,Y,Z Enter units to offset along an axis from the origin, usually used to offset two scenarios from each other.

Yaw, Roll, Pitch Enter units to offset from the Euler angle, usually used to offset two scenarios from each other.

Character Settings Check Show Name to display the character. Check Show Contact Objects to display the convex areas of contact. Select a visual material from the dropdown list. For more information see To Add a Visual Material.

Prop Settings Check Show Name to display the prop. Check Show Contact Objects to display the convex areas of contact. Select a visual material from the dropdown list. For more information see To Add a Visual Material.

4.2.1.3 Scenario Simulation Variables and Individual Character Variables

Scenario Simulation Variables Scenario simulation variables are those simulation variables that are shared by all character simulations in a scenario. The same values are enforced across different character simulations in order to enable reliable synchronizations of simulation data.

Individual Character Variables

Individual character variables are those simulation parameters defined for each character. The parameters used depend on the characters you select to simulate. See chapter on Character Simulations for more information.

4.2.2 To Add a Character Characters are independent, dynamic elements in the simulation. Every character has its own dynamic model describing how it moves when subjected to internal or external forces. Characters interact with each other or props or the ground via forces of contact. Examples of characters include humans, robots, and any dynamic equipment such as a backpack.

Page 75: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

71

To add a character to your scenario:

1. Right-click the word Characters and click New Character.

2. Select a model and type of anthropometry. (See the chapter on available characters for details of

available models.)

3. When you add an object (character, equipment, or prop) to your scenario, the object is placed so

that the object’s origin is in the same location as the origin of the world. Thus, the XY grid interpenetrates the object at the origin of the object’s base joint.

Examples showing origins of newly-added objects matching origin of Digital Biomechanics space

4. Enter a name for your new character (in the top of the right hand pane of the Scenario Explorer Window).

5. Give the character properties and an initial state as needed using the settings described below.

Page 76: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

72

4.2.2.1 Topology

The Topology page is used to display and edit the mass properties of the character. A hierarchical list of the joints (and associated links) of the character are displayed. By clicking on a joint, the list of body shapes attached to a particular joint are displayed. For instance, because the foot is attached to the ankle, if you double click on ankle_l, foot_l appears. If you click on a joint, the combined mass properties of all bodies attached to that joint are displayed. If you click on an individual shape (for instance foot_l)– the mass properties of that shape are displayed.

Page 77: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

73

Default mass properties of each character are included in the character’s configuration file (.cfg). However, you can edit these mass properties at the user interface shown above.

Property Function Name Names the character.

Topology Tab Model Template for the character that defines the arrangement of links

and joints. Anthro Template of body dimensions (anthropometry). Edit Click to select a different model or anthropometry from a popup

menu. Executable Name of executable used for this model. Draw Contact Objects Check to display contact objects (a convex representation of any

concave objects used to detect contact). MP Render Scale A scale factor used to display the COM. Visual Material The material used to display an object. For instance to display a

different uniform on the model, change the Visual Material. For more information see To Add a Visual Material.

Total Mass The character’s weight in kilograms, determined by summing the masses of each part of the body.

Joints (links) List of joints and the links immediately distal to each joint. Mass kg Link mass in kilograms (summing all the link masses will equal

the Total Mass).

COM offset m Center of mass (COM) components of immediately distal link from parent joint in meters. For instance, clicking on ankle_l shows the COM offset (and other mass properties of the immediately distal link: foot_l).

Inertia (xyz) (xyz) Inertia matrix in kg * m2 of selected link or (if joint is selected) or immediately distal link.

adjust inertia properties When this option is selected, the inertia properties will be automatically adjusted when changes are made to the mass of the object or COM location.

Page 78: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

74

4.2.2.2 Commands

This window displays the commands that define the set the initial state of the character. If data has been generated, then the commands listed are the final state of the character, which becomes the initial state if the simulation is resumed. There are two tabs in under the Commands Tab, Text View and Variable View.

4.2.2.2.1 Commands Tab: Variable View Tab

This page lets you view a set of variables derived from the character’s state variables (shown on the Text View Tab).

Property Function

Commands Tab You can see and edit the state of the character and view selected sets of variables.

Text View Tab Lists the commands that set the initial state of the character. If data has been generated, then the commands listed are the final state of the character, which becomes the initial state if the simulation is resumed.

Variable View See next table. Search Text Enter a word or phrase for which to search. Wildcards are not

supported. Next Click to search for the next instance of the search phrase.

Hotkey: Return.

Page 79: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

75

Prev Click to search for the previous instance of the search phrase. Hotkey: Shift-Return

Whole Word Only Check to find only instances of the entire search phrase. Case Sensitive Check to find only instances of the search phrase that match the

case (uppercase or lowercase) characters in the search phrase. Help Displays all commands that can be used to edit this file.

Undo Undoes the last edit you made. Each click undoes the last subsequent edit.

Redo Redoes the last undone edit. Each click redoes the last undone edit.

Apply Applies (Saves) all edits to the existing file. This cannot be undone.

Discard Edits Discards all edits that you have made in this session.

4.2.2.2.2 Commands Tab: Variable View Tab This page lets you view a set of variables derived from the character’s state variables (shown on the Variable View Tab).

Property Function

Commands Tab You can see and edit the state of the character and view selected sets of varaibles. . .

Variable View Tab On this page, you can create a group of variables, derived from the state of the character.

Groups File A file that contains a set of variables in which you are interested. It initially contains the initial state variables (if no data has been generated). Once data has been generated, the final state variables are contained in this file.

Key Variable name.

Value

Click a value to edit the value directly.

Page 80: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

76

Goal Click next to a variable to extract the variable’s value from a goal file.

Record Click next to a variable to turn on recording for this variable during simulation and then view in BDIPlot. Recording a variable will store data from that variable, so you can use it for further analysis. Only variables that are set to ‘RECORD’ are saved for further analysis.

Save Configuration A configuration is a set of groups files. Saves the Groups file (also called Variable Configuration or Group Configuration in the SimUI window). This file also defines the variables that are shown in the SimUI window while you are simulating.

Apply Applies (saves) commands to the .dbs file. Discard Edits Discards any edits you have made to the

variables’ values, goal file status, or record status. .

Click an arrow or click a column head to reverse the current sort order of variables within each variable group.

Click to reorder variables within a group by manually dragging and dropping them.

Drag and drop a column border to shrink or expand the column. The column widths are saved for the next time you are on this window.

Right-click a variable to remove it from the variable view.

Right-click a group name to edit or delete the group. If you select Edit Group, the Group Manager window (see below) is displayed. See the section To Create a Group in the Working in Simulation Mode chapter.

Right-click near the left border to Load Configuration (same as Groups File pulldown), Save Configuration (same as Save Configuration button), or Save Configuration As.

Page 81: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

77

Right-click the top-level name to create a new group.

4.2.2.2.3 Editing a Group If you right click a group name, you can add or remove variables to the list. The Group Manager window will appear when you right lick and select Edit Group

:

Page 82: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

78

Listed in the group manager are the variables in that list. To remove a variable, select the variable and click Remove. To add variables, click Show Find Tool

In the Expression textbox, type the name of the variable you want to add. Partial names and wildcards can also be used. For example, typing q.* will return a list of all variables that start with ‘q.’ Once there is a list of variable, highlight the ones you want added to the list, and click the Add

Page 83: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

79

button. If you want to keep your changes, click Ok, if you want to discard your changes, click Cancel. Once changes have been made, click ‘Save Configuration’ in the Commands Tab: Variable View.

4.2.3 To Add Static Equipment to a Character Equipment is added to a character as part of a kit. Equipment kits are collections of equipment pieces that can be attached to a character. Individual pieces of equipment are rigidly attached to a character’s links. The character to which equipment is attached is referred to as the equipment’s parent. Equipment of this type is referred to as static equipment, since the equipment’s position and orientation cannot change relative to its parent link at simulation time. Users can specify the appearance and mass properties of equipment. Equipment can also be assigned to contact relationships with other objects in the scenario allowing it to collide with those objects.

Static equipment, which is rigidly attached to the body do not exchange forces with that body part. Rather, they are treated as though they are part of the character link. Their mass is added to that of the parent link and any collision forces on the equipment are passed directly to the character link.

To add equipment to a character:

1. Right-click a character or the word Character and select New Equipment Kit.

2. Right-click kit or Equipment Kit and select New Equipment Entry.

3. The following will discuss how to edit equipment properties and suspension. Equipment

Properties define the size and mass of the equipment piece. Fields are defined in the tables below.

Page 84: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

80

:

Equipment properties are described in the table below:

Property Function Name Name of the piece of equipment. Type Template for the piece of equipment that defines default shape

and mass properties. Scale x,y,z Scale in meters. MP Render Scale A scale factor applied to the display of the COM. This will be

displayed only when you click on the COM offset, Visual Material The material used to display an object. For more information

see To Add a Visual Material. Mass (kg.) Mass in kilograms. adjust inertial values Check to adjust inertial values. When this box is checked, the

Inertia matrix will automatically be adjusted if you change the mass of the equipment.

Page 85: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

81

Com offset (m), x,y,z Center of mass location in body-fixed coordinates in meters. This is an offset of the COM from the origin of the equipment’s graphical model. To Determine the origin of the equipment’s graphical model, set COM offset to 0,0,0. A small pick ball is appear in the object.

Inertia matrix (kg*m2) Rotational inertia (moment of inertia) for the equipment (kg*m2).

Equipment is a subgroup of a Character. A piece of equipment has to be attached to a character. Specifically it has to be attached to a link of a character. It can, however, be offset from the origin of that link. The Suspension Tab allows you to choose what link the equipment is attached to, and

Equipment property page, Suspension tab

Suspension properties are described in the table below. Suspension properties define where the equipment is attached to the character.

Property Function Parent Link Choose a joint of the parent character to which to attach the

equipment. Pose X,Y,Z, yaw, roll, pitch Enter figures to place the equipment at an offset to the

named joint. Changing these values lets you position the equipment.

4.2.4 To Add Custom Static Equipment Shape files are required for both the visual model and the model used for collision detection. Shape models used for collision detection must be convex (not concave). If your custom model is concave, you can use the program polyqhull.exe to create a convex variant of the model for collision detection purposes.

Page 86: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

82

You can add your own custom static equipment designs to a scenario. To do so, add an equipment file (.dbe) that specifies the shape and default properties of the equipment. When the appropriate data files are added, your custom equipment model appears in the list of available models for equipment. A sample of an equipment file, shown below, can be found in custom\config\dbequipment\custom_sample.dbe. To create your own file, copy, rename, and edit this file.

dbEquipment custom_sample

graphics_filename = custom_sample.obj contact_graphics_filename = custom_sample.obj

shape = custom_sample

scale_x = 0.2 scale_y = 0.2

scale_z = 0.2

dbMassProperties

parent = custom_sample

mass = 1 com_x = 0

com_y = 0

com_z = 0 moi_xx = 1

moi_yy = 1

moi_zz = 1 moi_xy = 0

moi_xz = 0

moi_yz = 0

The elements of this file are:

File Element Function dbEquipment custom_sample Name of the .dbe file, custom_sample.dbe graphics_filename = custom_sample.obj Name of the custom equipment appearance file. contact_graphics_filename = custom_sample.obj

Name of the contact graphics file. If the object is convex, the contact graphics filename is the same as the custom equipment appearance file. If the object is not convex, you need to use a program called polyqhull.exe to create a suitable contact graphics file.

shape = custom_sample Name of the shape as it appears in the list of types on the Equipment property page on the Equipment tab.

Scale Scale factors applied to the visual and contact shapes.

Page 87: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

83

dbMassProperties Mass properties of the piece of equipment. See Mass Properties in the Character Simulations chapter.

4.2.5 To Add a Sensor Sensors are special equipment pieces that can record the position, velocity, and acceleration of the object to which they are attached. Sensors can be added and positioned like other pieces of equipment. Sensors can report data in either local or global coordinates. Each sensor adds variables to the simulation data files to record its own data, which can be viewed in BDI plot. The data to choose from for each sensor is listed below.

To add a sensor, click

1. Right-click a character or the word Character and select New Equipment Kit.

2. Right-click kit or Equipment Kit and select New Equipment Entry.

3. Select state_sensor as the Type.

4. The Equipment and Suspension tabs are the same as for standard equipment. Choose the

‘Sensor’ tab. Check the properties you want the sensor to track. The same sensor can measure multiple variables (i.e., position and velocity).

Page 88: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

84

Property Check to Track Position Linear position of the sensor.

Orientation Orientation of the sensor frame relative to the global coordinates.

Linear Velocity Linear velocity of the sensor.

Angular Velocity Angular velocity of sensor.

Linear Acceleration Linear acceleration of the sensor. Click Include Gravity to include gravity. (See the diagram below in Linear Acceleration with and without Gravity.)

Angular Acceleration Angular acceleration of the sensor.

Output Coordinate System: Local Global

Check one to specify the coordinate system as using local or global coordinates.

5. Variables from sensors are viewable in BDIPlot. The following table defines how sensor names (as they appear in BDIPlot are defined:

Sensor Variable in BDIPlot Definition sensorname The sensorname consists of kitname_equipmentname.{gbl

or loc}. gbl or loc specifies whether the coordinate system is in local or global coordinates.

Sensorname.{x,y,z} Linear position of the sensor in local or global coordinates.

Page 89: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

85

Sensorname.{rx,ry,rz} Orientation of the sensor frame relative to the global coordinates. These are Euler angles reported in rz-ry-rx (yaw, pitch, roll) order.

Sensorname.{dx,dy,dz} Linear velocity of the sensor reported in either local or global coordinates

Sensorname.{wx,wy,wz} Angular velocity of sensor reported in local or global coordinates

Sensorname.{ddx,ddy,ddz} Linear acceleration of the sensor in local or global coordinates.

Sensorname.{dwx,dwy,dwz} Angular acceleration of the sensor in local or global coordinates.

4.2.5.1 Linear Acceleration with and without Gravity

Page 90: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

86

4.2.6 To Add a New Pose Poses are collections of values for all the joints in a character that are used to configure a character.

1. Pose your character using the posing tool. (See Typically, all the forces are not checked. For instance, both Draw Force 1 and Draw Force 2 do not need to be checked (checking one or the other will provide the needed visual information). Scale and width can both be set to .01, and Draw Crumb does not need to be checked.

Posing Objects in the 3D View Window for instruction about using the posing tool.)

2. Right-click Poses.

3. In the Pose properties pane, click Read from Character.

This reads data from the current pose and applies to the new pose.

4. Enter a name for your pose can press Tab.

5. Use File > Save to save your scenario with its new pose.

Pose is a subgroup of character. You can pose a character and save and name the pose for reuse. You can copy and paste poses from one character to another.

The Pose properties pane is shown below:

Pose properties are described in the tables below:

Property Function Name Name of the pose. You can rename a pose here. Read from Character Reads data from the current pose and saves it to the name

shown in the Name field.

Page 91: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

87

Write to Character Writes data from the saved pose named in the Name field to the character.

4.2.7 To Add a Prop In addition to humans and equipment, you can also add props to your scenario. A prop is an object that is not attached to the human, whereas a piece of equipment is attached to a human. A prop might be a floor, hill, or wall. Props are static shapes in the simulated world that humans can collide with. Props do not move during simulation.

1. Right-click Props.

2. Enter a name for your new prop.

3. Select a type.

4. Enter Scale, Translation, and Rotation, as appropriate (see table below for details).

Page 92: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

88

Prop properties are described in the table below:

Property Function Name Name of this prop. Type One of cube, cylinder, floor, right_prism, and sphere. Scale X,Y,Z Multiplies the dimensions of the prop to make larger or

smaller. Translation X,Y,Z Position of the prop. Rotation (yaw, roll, pitch) Orientation of prop.

4.2.8 To Add a Visual Material 1. Right-click Visual Materials.

2. Give your new visual material a name.

3. Assign RGB color code to the color, or click the gray box to choose a color:

Page 93: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

89

A color palate will appear:

Select the color you want and click ‘Okay’.

After selecting a color, choose the level of transparency you want. Transparent objects are useful for seeing contact when one object is blocked by another, such as seeing the contact between a backpack and the carrier.

Page 94: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

90

Alternatively, you can click the Advanced button, the following window will appear:

Give your material colors, transparency, and shininess.

Visual material properties are defined as follows:

Property Definition

Ambient

Describes how a surface reflects the indirect light coming from all directions so that all surfaces are equally illuminated by it. Reflective effect independent of the viewpoint

Diffuse

Describes how an object reflects a light that is shining on the object (diffuses the light). Reflective effect independent of the viewpoint

Specular

Reflected light from a surface that produces the reflective highlights in a surface. Reflective effect affected by the viewpoint.

Emissive Light that an object gives off by itself. Reflective effect affected by the viewpoint.

Page 95: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

91

Alpha Transparency (higher numbers are less transparent).

Shininess How focused the reflective properties are.

If you click any of the four colors, a window is displayed in which you can define colors.

Once you have created a visual material, there are a few places where you can access this material.

Visibility Setting Location Setting

Scenario, Visibility Settings Check Enable Settings to display a visual material other than standard that you selected in one of three locations below.

Scenario, Visibility Settings, Character Settings

Visual Material

Scenario, Visibility Settings, Prop Settings

Visual Material

Character, Topology Tab Visual Material

Equipment Visual Material

4.3 Copying, Cutting, and Pasting Objects You can copy and paste or cut and paste humans, poses, equipment, and props from scenario to scenario or from object to object. For example:

• You can copy a character from one scenario to another.

• You duplicate a character in the same scenario by copying and pasting it in the same scenario.

• You can duplicate a piece of equipment in the same scenario or to another scenario.

• You can copy a pose from a character and paste it on another character.

To copy and paste a character from one scenario to another.

1. Open both scenarios at the same time.

2. In the Scenario Explorer left pane of the scenario from which you want to copy, right-click the character and select Copy.

3. In the Scenario Explorer of the scenario into which you want to paste, right-click the word Characters and select Paste.

Page 96: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

92

4.4 Adding a Contact Pair A contact pair defines a relationship between simulated objects. A contact pair allows the two objects to potentially collide and exchange forces. Characters can collide with other characters or props. A human can also collide with itself, for example, an arm can collide with a leg. To allow two objects to collide with each other, you designate two objects (two contact pieces) as a contact pair and associate a collision property with the pair. The collision property determines how forces of interaction are calculated based upon relative position and velocity of the pair. Unless a contact relationship is established between two objects, those objects will not be able to contact each other.

Contact detection can be a computationally-expensive process. Therefore, it is beneficial to minimize the number of contact pairs in a simulation.

4.4.1.1 There are 3 ways to add contact pairs: 1. Select via pull-down menu 2. Select via mouse clicking 3. Edit Text For the example we are constructing, we need to define 4 contact pairs.

4.4.1.1.1 To add a pair via pull-down menu: 1. Click Contact on the left side of the Scenario Explorer window. If there are any contact entries in

the contact table, click clear table, so we can start fresh for this example.

2. Click ‘Add a pair’ on the left side of the Scenario Explorer window

3. A contact pair is defined. This pair is defined based on the logic in the software. We will assume

for this example that this is not the contact pair you want defined. 4. Right click on the highlighted item under ‘Contact Piece 1’ 5. Select ‘Select Via Pull Down Menu’

Page 97: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

93

6. From the pull down menu, select a contact piece. As you highlight pieces of equipment, they will be highlighted in the 3D window. Select prop:base_f.

7. Right click on the highlighted item under ‘Contact Piece 2’ 8. Select ‘Select Via Pull Down Menu’ 9. From the pull down menu, select a contact piece. As you highlight pieces of equipment, they will

be highlighted in the 3D window. Select brick:kit_dot. 10. The first contact pair is defined. All the contact pairs can be defined this way. However, for this

example, we will define the other contact pairs in various other ways.

4.4.1.1.2 To add a pair via mouse click: 10. Click ‘Add a pair’ 11. Right click on the highlighted item under ‘Contact Piece 1’ 12. Select ‘Select Via Mouse clicking’ 13. A window pops up:

Piece: indicates the contact piece that is selected.

There are three ways to define a contact piece via mouse clicking: a. Shift + Click in the 3D View Window b. Click on the piece of Equipment in the Scenario Explorer c. Click on a Contact Table Entry.

14. To define a contact piece by Shift + Click in the 3D window a. Push the Shift button b. Select one of the dots on the corner of the block. Keeping choosing points until you

click on floor:base_f. c. As you click, the name of the point you selected appears in the Piece field. When

floor:base_f appears in the piece field, click ‘Ok’. This function is useful if there are few objects in the 3D window, and the contact piece can be easily identified.

15. We will define the second piece of this contact pair by clicking on the equipment in the Scenario Explorer. To define a contact piece by clicking on the equipment in the Scenario Explorer

a. Right click on the highlighted item under ‘Contact Piece 2’

Page 98: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

94

b. Select ‘Select Via Mouse clicking’ c. When the window pops up, select the contact piece in the Scenario Explorer. Select

brick:kit_dot0. d. The name of the contact piece should appear in the ‘Piece:’ textbox, the floor should

become highlighted in the 3D View Window and the Scenario Explorer will display information about that contact piece.

e. Click ‘Ok’ This function may be useful if the contact piece is not easily seen in the 3D window.

16. We need to define a total of 4 contact pairs for this example simulation, we have defined 2 pairs so far:

17. We will now define another contact pair. The first piece will be defined by mouse clicking in the

Scenario Explorer; the second piece will be defined by clicking on a contact table entry. Click ‘Add a pair’ To define the first piece, repeat #7 a-e, selecting brick:kit_dot1.

18. To define a contact piece by Clicking on a contact table entry a. Right click on the highlighted item under ‘Contact Piece 2’ b. Select ‘Select Via Mouse clicking’ c. When the window pops up, select floor:base_f from the previous contact pair. d. The name of the contact piece should appear in the ‘Piece:’ textbox and the floor

should become highlighted in the 3D View Window. The contact table will not be updated until you click ‘Ok’

e. Click ‘Ok’ This function may be useful if the same contact piece is used repeatedly in different contact pairs (i.e., for defining contact between the floor and several parts of the body).

We will add the final contact pair by the ‘Editing Text Method’

4.4.1.1.3 To add a pair by editing text: 9. Click Contact on the left side of the Scenario Explorer window 10. Click ‘Add a pair’ 11. Right click on the highlighted item under ‘Contact Piece 1’ 12. Select ‘Edit Text’ 13. Type ‘floor:base_f ’ 14. Right click on the highlighted item under ‘Contact Piece 2’ 15. Select ‘Edit Text’ 16. Type ‘brick:kit_dot2’

Page 99: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

95

All four contact pairs are defined, the contact table should look like:

Select File > Save to save your work.

4.4.1.1.4 Possible Errors 2. The selection may not be valid if the contact piece is incompatible with the type of contact

defined in the ‘Collision Property’ column. If the selection is not valid, a warning will appear:

If this warning appears, change either of the contact pieces and/or the collision property to be compatible.

Page 100: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

96

4.4.1.2 Notes for working with the contact table: 1. Every time a pair is defined, all of the contact pairs are checked for validity. Any invalid

pairs will result in the Error Message (section 2.8.1.2.5). 2. Clicking on a column header (i.e., ‘Contact Pair 1’, ‘Contact Pair 2’, ‘Collision Property’,

‘Vector Property’) will sort descending by that column. Click again to sort ascending by that column. Once the column is sorted, the selection you made is still highlighted. This function is useful if you want to find other contact pairs with the same contact pieces.

3. Repeatedly clicking ‘Add a Pair’ will initially keep the Contact piece 1 (for instance prop:base_f)constant and will cycle through the equipment list for contact piece 2 (for instance brick:kit_dot, brick:kit_dot0, brick:kit_dot1, brick:kit_dot2). This is a quick and easy way to set up a contact table for an object that is composed of multiple pieces of equipment or contact pieces.

4. To delete a contact pair, select the pair in the contact table and click ‘Delete’. 5. If a contact pair is defined, and you try to define the same contact pair again, an error

message appears:

After creating several contact pairs, the contact manager window will look like:

Page 101: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

97

Contact properties are described in the tables below:

Property Function Contact Piece 1 One contact object in the contact pair. Contact Piece 2 The second object in the contact pair. Collision Property Defines details of the contact. Vector Property Defines details of the displayed force vectors.

Contact Pieces are named as follows:

character-name:kit-name_equipment-name

Examples: Joe:Test_Outfit_helmet

Joe:T12_torso_top

4.4.2 To Add a Collision Property The collision property defines a method for computing contact forces that are generated when two objects interpenetrate. Several collision methods are provided, each with its own parameters for the user to choose. The models used for contact force generation are described in detail in Error! Reference source not found..

1. Right-click a contact.

2. Give the collision property a name.

3. Select types for contact pieces 1 and 2.

4. Select a method of computation for this collision.

5. Enter values for constants used by the computation method chosen.

Page 102: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

98

Collision properties are defined below:

Property Function Name Names the collision property.

Contact Piece Type Type of each contact piece. Method Method used to compute this collision; one of Lspring_Ldamper,

NLspring_Ldamper, NLspring_NLdamper, NLspring_with_Hysteresis, Lspring_l_damper_strap.

There are four methods of computing contacts. Each method has its own set of parameters. The four methods and their parameters are defined in Chapter 13 Error! Reference source not found..

4.4.3 To Add a Vector Type When you run a simulation, the software computes contact forces. You can display these forces in the 3D window with vectors. You can define the scale and color of vectors. When you create a contact pair, you can associate a vector with the pair so that you can improve your understanding of which objects are colliding, where they are colliding, and how large the forces are. This procedure describes how to define a new vector type that is then displayed in the drop-down Vector menu when you define a contact pair.

• Right-click Vector Types.

Page 103: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

99

The Vector Property window is displayed:

Vector properties are defined in the table below:

Property Function Name Name of the vector. Draw Force 1 Forces are always computed in equal and opposite pairs. Force on the first

half of the contact pair. Draw Force 2 Force on the second half of the contact pair. Normal {1,2} The component of force normal to the contacting surface. Tangent {1,2} The component of force parallel to the contacting surface Scale Length of vector as meters per newton. Width Width of the vector in world units. Color, R, G, B Color of this vector in red, green, and blue. Crumb The crumb is a reference point used in the calculation of the contact

forces.

Page 104: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

100

Typically, all the forces are not checked. For instance, both Draw Force 1 and Draw Force 2 do not need to be checked (checking one or the other will provide the needed visual information). Scale and width can both be set to .01, and Draw Crumb does not need to be checked.

4.5 Posing Objects in the 3D View Window In addition to posing objects in the character/pose window or (for props) in the props window, you can edit the pose of objects in the 3D View window. You can pose not only characters, but also equipment and props. To edit a pose, you use the mouse to select and adjust a joint and a DOF. This chapter describes how to select joints and DOFs. See the chapter Character Simulations for more detailed information on all joint and link names, DOF, and joint limits.

Sample Poses

4.5.1 To Activate the Posing Tool

• In Setup mode in the 3D View window, click the posing tool icon. .

With the posing tool on, the active human (or piece of equipment or prop) is greyed except for the selected link and its distal (child) links; which are highlighted. When you first activate the posing tool, the base joint is selected. As all links distal to the base joint, the entire figure is highlighted.

Page 105: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

101

All Links Highlighted Distal to the Base Joint

4.5.2 Base Joint with Six DOF By default, with the posing tool on, an object displays graphic handles connected to the object’s base joint. On a human, this base joint is at the hips. Each graphic handle represents a DOF. You can adjust a joint using a DOF graphic handle, constrained by that DOF’s range of motion. There are six DOF on the Base joint.

Base Joint on a Character Base Joint on a Prop

Three DOF, shown as lines, move the object translationally, along an axis and use a length value:

• Up and Down, Blue, adjusts along the Z axis

• Front and Back, Red, adjusts along the X axis

Page 106: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

102

• Side to Side, Green, adjusts along the Y axis

Three DOF, shown as arcs, adjust the joints rotationally, and use an angular value:

• Blue circle, adjusts the yaw (around the Z axis)

• Red circle, adjusts the roll (around the X axis)

• Green circle, adjusts the pitch (around the X axis)

Base Joint DOF

4.5.3 To Select a Joint When you select a link, the link’s proximal joint is activated for adjustment. The joint and all distal links are highlighted. Each of the available DOF is shown with a graphic handle.

Action Result Legend

Shift-click the calf to select the knee joint.

Click and drag the mouse to adjust the knee joint.

The knee joint is activated for adjustment.

The lower leg link and the foot link are highlighted.

The knee joint has one DOF shown with a green graphic handle.

The circle indicates that this is a rotational DOF.

The green color shows that you are adjusting the pitch (around the X axis).

The highlighted arc (in green) shows the range of motion of the knee joint.

The yellow marker shows the current angle of the calf.

The grey marker shows the location of the cursor and that it is out of the knee’s range of motion.

Page 107: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

103

See the chapter Character Simulations for details on links and joints.

Sometimes, due to the graphic display, you could have trouble clicking on a desired body part to select a joint for pose adjustment. The posing tool navigation buttons allows you to navigate through the hierarchy of human joints by ascending or descending chains of human joints or by choosing parallel chains.

You can select a joint in three different ways:

• Shift-click a link distal to the joint that you want to adjust, or

• Click a posing tool navigation icon in the 3D View window in Setup mode, or

Posing Navigation Icon

Function

Selects the base joint.

Selects the child joint of the current joint.

Selects the parent joint of the current joint.

Selects the sibling joint of the current.

• Press a posing tool hotkey:

Hotkey Function

↑ Up arrow Selects the parent joint of the current joint.

↓ Down arrow Selects the child joint of the current joint.

→ Right arrow Selects the left sibling joint of the current.

← Left arrow Selects the right sibling joint of the current.

4.5.4 To Select a DOF If a joint has a single DOF, it is automatically selected when you select the joint. If a joint has more than a single DOF, one is selected by default.

To select a different DOF,

• Shift-click the graphic handle of another DOF, or

• Press the spacebar to cycle through the DOF on the selected joint.

Page 108: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

104

4.5.5 To Pose an Object

1. Activate the posing tool with the posing tool icon .

2. Select an object by shift-clicking the object.

3. If there is more than one joint, select a joint by shift-clicking a link.

4. If there is more than one DOF, select a DOF by shift-clicking a graphic handle. Alternatively, once a joint is selected, you can cycle through the DOFs by pushing the spacebar

5. Adjust the joint by dragging the mouse.

6. Continue selecting joints and adjusting them until the pose is as desired.

The table below shows the effects of mouse actions in the posing tool.

4.5.6 To Adjust a Joint You can edit each joint by at least one DOF. With a joint and a DOF selected, you can adjust the joint in two ways.

• Drag the mouse, or

• Use posing tool Hotkeys.

HotKey Function in posing tool

+ Increase rotation or translation value

- Decrease rotation or translation value

4.5.7 To Change the Camera in the Posing Tool, Press Alt It is often useful to move rapidly between camera adjustments and posing tool adjustments.

• Press Alt to temporarily turn off the posing tool and adjust the camera. With Alt pressed, use mouse clicks and movements as described in the chapter on Using Cameras.

With the posing tool on, moving the mouse adjusts joints and does not affect the camera, unless you press Alt.

To Achieve this Result Perform this Mouse Action

To select a joint to adjust Shift-click on a link (body part). This activates the proximal (inbound, closer to the body) joint to the link. It highlights the link clicked and all distal (outbound, further from the body) links.

To select a DOF to manipulate Shift-click a graphic handle to highlight.

To move a joint With a joint highlighted, click and drag the mouse.

Page 109: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

105

4.5.8 To Undo and Redo Pose Edit You can sequentially undo or redo edits that you make with the posing tool using the undo and redo buttons. .

Button Function in posing tool

Undo Undoes the last edit you made. Each click undoes the last subsequent edit.

Redo Redoes the last undone edit. Each click redoes the last undone edit.

4.5.9 To Save a Pose 1. Pose your human as desired.

2. In the Scenario Explorer left pane, with your cursor on the word Poses, right-click, and select New Pose.

3. In the right pane, click Read from Character.

4. Enter a name for your pose and press Tab.

Your new pose is now displayed in the list of poses

4.5.10 To Copy and Paste a Pose You can copy and paste poses from one character of the same type to another.

1. In the Scenario Explorer left pane, right-click the pose and select Copy.

2. Highlight the character to which you want to paste this pose, right-click the word Poses, and select Paste.

4.5.11 To Pose Equipment and Props Equipment and props can be posed using the same procedure as posing a character. Most equipment and props have only a single joint, the base joint.

Page 110: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

106

The current pose of a prop or a piece of equipment is saved when you save your scenario. You cannot save multiple poses for equipment or props like you can for characters.

1. Shift-click to select a piece of equipment.

2. Press the spacebar to highlight the DOF that you want to use.

3. Click and drag to adjust the position of the object.

Page 111: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

107

5 Working in Simulation Mode In Simulation mode, Digital Biomechanics calculates the motion of characters. The software uses forward dynamic models of each character to calculate movement of that character during the course of the simulation. The forward dynamic models use optimized equations of motion to calculate how the character responds to external forces, such as gravity and collisions, and internal forces, such as joint torque which represents muscular effort. Contact software detects collisions between objects so that contact forces can be applied.

In simulation mode you control the time duration for which movement is calculated. You can run for a period of time, advance time step-by-step, or pause the calculations. You can save the computed and contact force data to a file for later review.

You can set or change individual character parameters by issuing commands at the command line. You can also put a sequence of simulation commands into a text file (called a script) that is then executed.

5.1 To Enter Simulation Mode

• Click .

The 3D View window displays the Simulation toolbar at the bottom of the window.

5.2 To Run a Simulation 1. In setup mode, open a scenario, then enter simulation mode.

2. Click Browse to find a simulation script and click Open.

3. Select an amount of time over which to run.

4. Click Run.

The script runs for the amount of time selected. It runs more slowly than in real time.

The Simulation toolbar has the following functions:

Control Function

Enter commands on the command line.

Browse for a simulation script to run.

Page 112: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

108

Runs the simulation for the amount of time shown in the box. Equivalent to the command Run time.

Select number of seconds to run from the time drop-down menu.

Run for one time increment (equal to plant_dt). plant_dt is the integration step.

Pause the running of the simulation, which can be continued at this spot later.

Save the scenario file and simulation data as a .dbs file which you can replay or view in BDIPLot.

5.3 SimUI Window When you enter Simulation mode, a SimUI window opens for each character in the scenario. In this window you can view individual character simulation variables as they are computed. You can also group and organize variables.

If the SimUI window does not appear for a character:

1. Go to the setup mode.

2. Click on that character in the Scenario Explorer.

3. Click on the Topology Tab

4. Click the Show SimUI box.

Page 113: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

109

5. Go back to Simulation Mode.

The SimUI window will appear. In the bottom pane, a series of commands will be printed. Once this stops, you can run the simulation.

Menu Item Function

File Load Variable/Group Configuration Load a SimUI window configuration file, a file describing

the SimUI window size, location, and variable and group selections.

Save Current Variable/Group Configuration

Save the current SimUI window configuration under the current name, by default, default_filename.cfg.

Save Current Variable/Group Configuration As

Save the current SimUI window configuration under a name that you specify.

Page 114: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

110

Group New Create a new group. Causes the Group Manager Window

to appear. The default name is newgroup. Delete Delete the selected group.

The size, location, and arrangement of variables in the SimUI window can be changed and saved.

You can configure and manage a simulation in this window.

In the SimUI, you can view, modify, and tag Simulation variables for recording. You can also group and organize variables.

5.3.1 To Create a Group You can create a set of variables that are particularly interested in into a group. These variables are displayed for your study during the simulation.

To create a variable group,

1. Select Group > New.

2. The Group Manager dialog appears.

3. Click Show Find Tool.

Page 115: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

111

4. Enter a regular expression for the variables you wish to find.

For example, try typing q.base_* in the expression edit box. This will list all variables starting with q.base_* (q.base_tx, q.base_ty, q.base_tz, q.base_rx, q.base_ry, q.base_rz ).

5. Click Add once you are happy with your selections.

6. Click Ok to close the dialog.

7. Click File > Save Current Variable/Group Configuration.

This saves the group so that it is next time you run a simulation. You can also save it by pressing Ctrl-S in the SimUI.

Page 116: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

112

5.4 Simulation Commands This section describes the commands supported in Simulation mode. These commands are used to

• Control the advancement of time in the simulator

• Configure data for recording and saving.

• Set variables in individual character simulations.

Special simulation commands may be defined for individual character simulations. These commands may run customized functions in the simulation.

You can run commands by clicking a button, by entering them on the command line or by entering them in a script, then executing the script.

Most simulation commands enter a queue for execution. Commands are executed sequentially in the queue with the oldest commands finishing first.

Most commands conclude quickly with the exception of the RUN command which executes the simulation and can take considerable time to finish. Commands entered while RUN is executing are not executed until after the run finishes. The PAUSE button interrupts the RUN command and clears the command queue.

The table below lists and defines simulation commands.

• Commands are not case sensitive; they are shown in uppercase but you can enter them in either upper or lower case.

• var refers to a variable.

• You can use wildcards, such as * for any character or [123] for any of the characters within the brackets. Examples: q.* is all variables that begin with q. q.joint[123] refers to the variables q.joint1, q.joint2, q.joint3.

• file refers to the name of a file.

Page 117: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

113

Commands Description

RUN n Runs the simulation for n simulated seconds.

STATE SAVE [file] Save the current simulation state to file. If [file] is omitted, the command creates a file with a name based on the current date.

LOAD [file] Read and execute commands from file. State files (file.state) and script files (file.script) are allowed. State files and script files are equivalent. All commands are executed in the sequence they are entered in the file. State files can be nested.

SET var val Assign a variable to a constant or another variable. Examples: set q.x 1 or set q.x q_d.x. If more than one character is in the simulation, type target [charname] to tell the simulation which character you are adjusting the values for. [charname] is the name of the character as it appears in the Scenario Explorer window.

SETPARAMS Update the physical model parameters in the dynamic equations of motion. This command should be executed after a model parameter such as mass, moment of inertia, or link length has been set. Only valid for simulations supporting variable mass properties or link parameters.

DATA ASCII Change data file save format to ASCII (text, human-readable) format. ASCII format is machine readable as well, but is larger than the binary format.

DATA BINARY Change data file save format to binary (machine-readable) form. The binary format is more compact than the ASCII format.

DATA RESET Clears the record buffer of all recorded data.

INITDATA Same as DATA RESET.

DATA SAVE [file] Save the contents of the record buffer to file. If the file name omitted, the command creates a file with a name based on the current date.

RECORD var Flag var to be saved in the record buffer. If the simulation value record_dt is non zero, recorded variables are saved to the record buffer every record_dt seconds.

UNRECORD var Stop recording var.

Page 118: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

114

5.5 Goal File Commands Goal files are data files that contain trajectory data. Goal trajectories may be used by the control system during a simulation.

The GOAL LOAD command reads a goal file. When the simulation is run, any simulation variables that match variables found in the goal file are updated as simulation time advances. The rate at which the values are updated is determined by the value of goal_dt. When the end of the goal data is reached, it loops and the update continues from the beginning of the goal data. If goal_dt is equal to 0, the goal values are not updated.

Parameter Description

GOAL LOAD [filename] Load the goal data saved in the specified file. Default to ddd.s.goal.

GOAL RESET Erase all goal data and unset all goal flags.

GOAL ON var1 Flag var1 to get current values from the most recent goal file. var1 must exist in the goal file.

GOAL ON var1 var2 Simulation variable, var1, takes its values from the goal file variable, var2.

GOAL OFF var Stop getting current values for var from the most recent goal file.

GOAL TIME_INDEX var Use var as the time index into the goal file for reading goal data. Default is goal_index or if that is not defined t.

GOAL READ_NOW Read the goal file now rather than waiting until the next goal_dt.

goal_t n Only on human2D, used for control purposes.

5.6 Miscellaneous Commands

Parameter Description

INDIVIDUAL name Set the individual name that is associated with the simulation. MINMAX var min max Sets minimum and maximum values for var, but does not clip the variables

values. These limits are used by various support programs. MODEL name Set the model name that is associated with the simulation. The model name

identifies which graphical model is used in a display program showing the simulation.

Page 119: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

115

5.7 Using The End State of a Simulation as Initial Conditions For Another Simulation

It may be useful to use the end state of one simulation as the initial conditions for another. For instance, you may want to start your scenario with a block resting on the ground. To do this, set up the first simulation in the Setup Mode and run the simulation in Simulation Mode for a given amount of time. Then:

1. Save the simulation by clicking the save button

2. Choose a name and save the simulation.

3. You will be asked if you want to load the simulation, choose yes.

4. The scenario will appear in the Scenario Explorer, and will be highlighted Yellow:

5. Enter Setup Mode

6. Right Click on the highlighted Scenario (the one you just saved and loaded).

7. Choose Save As…

8. Enter a new .dbs filename. The file will be saved as a .dbs file that is not a results file. The name in the Scenario window will change to be the same as the name you entered, and the highlighting will disappear, indicating the scenario is no longer a results file.

Page 120: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

116

9. Close the original scenario, and use the new one for future analysis.

Page 121: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

117

6 Working in Playback Mode Use Playback mode to view data from simulations in the 3D View window. In Playback mode, you can review, replay, and compare data from simulations you have run and saved. After you load simulation data, you can play it back in real time, faster than real time or slower than real time. You can load several scenarios and compare simulations with different parameters. You can make a record what you are playing on the screen as a single “movie” file or one frame per file.

6.1 To Enter Playback Mode 1. Open a .dbs file that is associated with data (one named as mmddyy_hhmmss.dbs).

2. Click the Playback icon

The Playback Controller toolbar is displayed at the bottom of the 3D View window.

6.2 Playback Controls The controls have the following functions:

Control Function

Segment Slider- Rectangle above the slider that highlights in green. Click and slide to shorten the length of the current playback segment. Minimum and maximum settings change accordingly.

Slider – shows the current time in the recording between the minimum and maximum settings. You can move this forward or backwards.

Expands the slider so you can adjust more finely.

The current time of the data set as measured from the beginning of the file.

Time at the beginning of the current playback segment. Greater than zero if you have moved the Segment Slider from the left.

Time at the end of the current playback segment. Smaller then the Right box (end of recording) if you have moved the

Page 122: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

118

Segment slider from the right.

Left box shows time at the start of the simulation data file, usually zero.

Right box shows time at the end of the simulation data file.

Increase or decrease speed of playback relative to real time.

The eight playback buttons have the following functions:

Button Function

Rewind to the beginning – Make the current time be the earliest time as specified by the Range Selector.

Play backwards – Play the motion backwards.

Stop – Stop the playback.

Record – Record the simulation according to the preferences set in File > Preferences > Movie Maker Preferences. (See the Main Window Menus.)

Cycle – Toggle cycling on or off. When cycle is active, the playback controller loops continuously through the simulation defined by the minimum and maximum.

Play - Play the motion forwards.

Fast Forward to the end.

Frame Backward – Click to move back one frame in time; press to move continuously. Frame length is defined as 1/25 * speed factor. If the speed factor is 1x, then a frame length is 1/25 of a second. If the speed factor is 2x, then frame length is 1/25 * 2 or 2/25’s of a second. One frame equals record_dt.

Frame Forward – Click to move forward one frame in time; press to move continuously.

When working in Playback Mode, the camera controls are the same as when working in Simulation or Setup Mode.

Scenarios that are loaded, but that you are not interested in playing in Playback mode can be hidden by entering Setup Mode, choosing the scenario you do not want to appear in Playback mode, clicking on the Visibility Setting Tab, and un-checking the Show Scenario button.

Page 123: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

119

7 Working with BDIPlot BDIPlot is a tool for viewing and analyzing numerical data generated by Digital Biomechanics simulations. BDIPlot is an independent program that can be run during any of the simulation modes. BDIPlot is based on Matlab. If more advanced mathematical analysis or plotting routines are needed then BDIPlot provides, you can import Digital Biomechanics data to Matlab for your customized analysis.

In BDIPlot, you can display data in three ways:

• As graphs of variables over time

• As graphs of one variable plotted against another, or phase plots

• BDIPlot can plot variables from multiple simulations at the same time so that you can compare data between simulations

BDIPlot supports data manipulation functions including: multiplication, division, integration, differentiation, scaling, and shifting functions. It allows you to save and reload plotlists, lists of variables, and the windows they are plotted in. This features makes it convenient to rapidly replot the same variables from a dataset for routine inspection.

7.1 To Enter BDIPlot To start BDIPlot, you need to have a scenario loaded that had data (indicated by yellow on the

scenario icon ), and you have to be in the Playback Mode. Then

• Click the BDIPlot icon

BDDPlot is loaded with the current scenario data file.

The BDIPlot icon has three looks:

• The icon is pressed. BDIPlot is already open for this scenario.

• The active scenario has no data. The icon is greyed out.

• The icon is unpressed. BDIPlot is not yet open for this scenario.

You can open and close BDIPlot for a scenario by clicking the icon.

You can open more than a single scenario to compare plots.

Page 124: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

120

Control Function

Launch New bidPlot Open a new instance of BDIPlot in which to display this scenario. Connect to existing bdiPlot

Open these files in the existing instance of BDIPlot..

BDIPlot displays three windows: a Variable List, a Data window, and a Command window.

Variable Window Data Window

Page 125: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

121

Command Window

7.1.1 Variable List Window The Variable List window contains list of recorded simulation variables for each data file that is loaded. The orange bar at the top of the Variable List window displays the name(s) of the open data file(s). When you open a .dbsave file in BDIPlot, more than one data file is opened. One file contains motion data and one file contains contact force data. If multiple humans are simulated there will be a motion file for each human.

To plot a variable,

1. Click a variable.

2. Click a plot in the Data window in which to plot the variable.

7.1.2 Data Window The Data window displays plots of variables against time. Time is on the horizontal axis and variable values are on the vertical axis. By default, there are five plots in the Data window. The left column of plots shows data for the entire simulation. The right column shows close ups of portions of the same data. You can vertically scale a plot depending on the level of detail required, however, the left and right plots in a single row are always shown with the same scale. Several variables may be plotted concurrently in the same retangle.

Page 126: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

122

The vertical red line shown in all the plots, referred to as the Data Cursor, indicates the current location in the data. The current value of all traces at the cursor position is always displayed on the top left of each plot.

Note on plotting variables from multiple files of different lengths: If you open more than one data file at a time and one of the data files is shorter than the other, the last value of every variable in the shorter file is used for any comparisons with later data in the longer file.

7.1.3 Command Window The Command Window displays controls that you use to alter the view of data plotted in the Data window. A menu at the top of the Command Window provides access to file and window functions.

Functions are grouped into four categories: Plot, View, Math and SimGlass functions. You can control several plot features by using the buttons in the View and Plot sections in the Command Window. This includes adding and removing plots, clearing plots, scaling plots, and zooming in and out. Use SimGlass controls to move forward or backward in your simulation. Time and tick (index number) corresponding to the cursor position are shown below the control buttons.

The menu contains the following options:

File Menu Options

Option Hotkey Function Open Disabled. Print Ctrl-P Prints the plots in the data window. Displays a dialog allowing

you to control the printer to send the plot to, as well as the page layout details. You can save your figure to a file.

Quit Ctrl-Q Exits BDIPlot.

Window Menu Options

Option Hotkey Function Grid Ctrl-G Toggles grid on and off.

7.1.3.1 Using View Controls The view controls modify the appearance of plots in the data window.

Page 127: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

123

Click Autoscale, Rescale, and Smallscale to modify the vertical axis scaling of a selected plot. Click Zoom in and Zoom out to modify the horizontal axis scale in the right hand plot on each row.

View Controls

Control Function

Autoscale Click Autoscale and click a plot to set vertical axis scaling to include maximum and minimum points of all data traces.

Rescale Click Rescale and click a plot to manually set the vertical axis scale of a plot. Enter desired maximum and minimum vertical axis values in the dialog.

Smallscale Click Smallscale and click a plot to set vertical axis scaling to include the maximum and minimum points of all data traces plotted in the right column plot.

Zoom In Click Zoom In to decrease the timespan displayed in the right hand column of the Data window.

Zoom Out Click Zoom Out to increase the timespan in the right hand column of the Data window.

If you right-click on a Variable List, you see a menu with the following options:

Right-Click View Menu

Control Function

Rename Renames a variable.

Save Plot List

Saves the current plots for the data file that your cursor is in, including scales and number of plots. (This can save plots from only a single data file at a time.).

Load Plot Loads a saved list of plots.

Page 128: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

124

7.1.3.2 Using Plot Controls

Plot controls perform general purpose plotting functions.

Clear, Clear Last, and Clear All remove data traces from plots. Phase Plot plots two variables against one another. Add and Delete increases or decreases the number of plots in the Data window.

Plot Controls

Control Function

Clear Click Clear and click a plot to remove all variables. Clear Last Click Clear Last and click a plot from which to remove the most-recently-added

plot variable. If only one variable is being displayed, Clear Last clears the plot. Clear All Removes all variables from all plots. Phase Plot Click Phase Plot and then click two variables. A figure is displayed that plots

the variables with respect to each other. The first variable is plotted along the horizontal axis and the second is plotted along the vertical axis. To set the start and end points of both axes, slide the control at the top of the Data window .

Add

Delete

Click Add or Delete to increase or descrease the number of plots displayed. Select whether you want the plot to be added to (or removed from) the top or the bottom of the Data window.

7.1.3.3 Using Math Controls

To perform data analysis, you sometimes want to manipulate data mathematically. The Math Ops (operations) controls provide you with this functionality.

Mathematical operations can be divided into two groups, operations between two variables and operations on a single variable. Mult/Div and Add/Sub both take two variables as input. These

Page 129: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

125

functions multiply, divide, add, and subtract one variable from another. Deriv/Int, Gain, Offset, and Abs, on the other hand, require only a single input variable.

Math Controls

Control Function

Mult/Div Click Mult/Div and then click two variables. Select multiply or divide in the dialog. The function is performed and a new variable is appended to the end of the list. The default variable name is created by concatenating the two variable names separated by * or /.

Add/Sub Click Add/Sub and then click two variables. Select add or subtract in the dialog. The function is performed and a new variable is appended to the end of the list. The default variable name is created by concatenating the two variable names separated by a + or -.

Deriv/Int Click Deriv/Int and click a variable. Select differentiate or integrate in the dialog.

If you select Integrate, you are asked for minimum and maximum times over which to integrate the variable. By default these bounds cover the entire duration of the data. Once you have entered time bounds, a new variable containing the integral of the chosen variable is added to the end of the variable list.

Gain Click Gain and click a variable. Enter a scale factor. A new variable is created. Offset Click Offset and click a variable to shift a variable up or down. Enter an offset. A

new variable is appended to the end of the variable list Abs Click Abs and click a variable to calculate the absolute value of a variable. A new

variable is appended to the end of the variable list. Mag Click Mag and click either two (2D) or three (3D) variables to calculate the

magnitude of the variables. The magnitude is the square root of the sum of the squares of the variables.

Using SimGlass

Although it is very useful during analysis to look at data traces in the Data window, it is often difficult to visualize how the data corresponds to a particular character state.

Page 130: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

126

To help you match data to a particular spot in a data file, you can play your data files in BDIPlot using SimGlass. You can play files forward, backward, or frame-by-frame.

SimGlass Controls

Control Function

Connect Enter the name of the computer running SimGlass. By default, set to your local system. If you click Connect and a connection is made, you are unable to modify the host name until you disconnect from SimGlass.

<

>

Plays data forward or backward. By default play send information corresponding to every ten data values.

|| Pauses playback. <<

>>

Steps through data frame-by-frame backward or forward.

|<

>|

Goes to beginning or end of the data.

Cycle Cycles (loops) through data over and over.

Click up or down arrow to speed up or slow down the playback. These playback controls control the playing back of the simulation. The playback controls in the 3D View window are disabled for any scenarios open in BDIPlot.

Reports the time, the tick number, and the step number for the current location in the simulation.

7.1.4 Using BDIPlot with Matlab If you are familiar with Matlab and have advanced data analysis or presentation needs that go beyond the capabilities of BDIPlot, you may wish to use the Matlab version of BDIPlot. This allows you access to the internal data structure containing the data read in from the simulation data file. Note that you need Matlab and a Matlab license to use this version of BDIPlot.

7.1.4.1 Installing and Running the Matlab Version of BDIplot

The Matlab version of BDIPlot is contained in %DIGITAL_BIOMECHANICS%/bin/Matlab/, where %DIGITAL_BIOMECHANICS% is the installation directory on your machine.

To run this program,

1. Add two directories to the Matlab path :

Page 131: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

127

BDI Install Directory\bin\matlab

BDI Install Directory\bin\win32\i586\bdiplot

This may be done from the main Matlab window by clicking File > Set Path or at the Matlab command prompt by entering:

path(path, ‘BDI Install Directory\bin\matlab’) path(path, ‘BDI Install Directory\ bin\win32\i586\bdiplot’)

2. At the Matlab prompt, enter BDIPlot.

7.1.4.2 Manipulating Data in Matlab

When BDIPlot opens a data file, it creates a global Matlab data structure for that data file. Key fields in this data structure are described below.

Digital Biomechanics Data Structure Elements

Field Description

BDI.fname Name of open data file

BDI.model Name of model associated with the data

BDI.t Vector of time values synchronized with data readings

BDI.data Data array containing runtime data. The size of the array is BDI.rows x BDI.cols

BDI.rows Number of readings for each variable

BDI.cols Number of variables in data file

BDI.vars Names and units of all variables stored in the BDI.data array.

When you exit BDIPlot, the global variable BDI is erased. However, any variable you create in Matlab remains in the Matlab workspace after you close BDIPlot.

7.1.4.3 Accessing Variable Names And Values

Variable names and units are stored in the BDI.data array.

BDI.vars = [varname1 varname2 … … varnameN]

The name of the nth variable can be obtained by entering, BDI.vars(n).name

Data corresponding to this variable can be assessed by entering, BDI.data(:, n)

7.1.4.4 Sample Matlab Script

Below is a sample Matlab program that takes two variables from the Digital Biomechanics structure, multiplies them together, and plots them over time. The labels on the x and y axes are also set.

Page 132: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

128

function sample_script()

%%------------------------------------------------------------------

%% sample_script extracts a few variables from the global BDI

%% structure, multiplies them together and plots them. %%

t_str = ‘t’;

l_hip_str = ‘q.hip_fl_ry’; r_hip_str = ‘q.hip_fr_ry’;

[i, t_data] = get_BDI_var(t_str); [j, l_hip_data] = get_BDI_var(l_hip_str);

[k, r_hip_data] = get_BDI_var(r_hip_str);

figure;

plot(t_data, l_hip_data.*r_hip_data);

xlabel(t_str); ylabel(sprintf(‘%s * %s’, l_hip_str, r_hip_str));

return;

function [inx, data] = get_BDI_var(str) %%-------------------------------------------------------------------

%% get_BDI_var returns the index and the data of the data whos name

%% matches str. %%

global BDI;

for j = 1 : BDI.cols, str_vars = sprintf('%s', BDI.vars(j).name);

if strcmp(str, str_vars)

inx = j; data = BDI.data(:, inx);

return;

end end

inx = 0;

data = []; return;

Page 133: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

129

8 Character Simulations This chapter describes variables used in character simulations for any character. Variables (joint and link names) for specific characters can be found in the next chapter.

Any entity that has its own motion is a dynamic model. Humans, dynamic equipment, robots, and bricks are all examples of dynamic models in Digital Biomechanics. Each model has its own equations of motion describing its behavior, its own skeletal structure, links, and mass properties.

In this chapter we describe standardized variables and naming conventions that apply to all dynamic models. A dynamic model is called a character within a simulation.

Multiple characters can be simulated in a scenario in Digital Biomechanics. A typical example of this might be a human with a piece of dynamic equipment, such as a backpack. Both the human and the backpack are characters. Each character in a Digital Biomechanics scenario has its own dynamic simulation associated with it. These dynamic simulations are independent modules that communicate with each other through the exchange of contact forces.

8.1 Sequence of Calculations The process of calculating the forces acting on simulated humans and their resulting motion in Digital Biomechanics is accomplished with several program modules. These program modules communicate through the simulation state variables. Each of the modules is summarized below: • COLLISION: The collision module calculates the relative position of all geometric objects in the

simulation. If any objects are found to be interpenetrating, then collision forces are calculated. Several different models for calculating collision forces can be used in the software.

• PLANT: The plant includes the equations of motion for the human. It represents the physics of a multi-link, rigid body system and its environment. For a given set of forces and torques applied to the human, the plant will compute the acceleration of that human.

• INTEGRATOR: The numerical integrator computes velocities and positions of the human given the acceleration.

• SERVOMECHANISM: There are two layers of control supported by the simulation. The servo layer has joint servomechanisms, or servos, that control the behavior at each system joint. Servos apply ideal torques directly to the joints or act through realistic actuator models. The algorithm for each joint may be software selected from one of several servo-control functions. The servos may also be disabled for free motion studies or for implementing custom servo algorithms. Section Joint Servos describes the available servo models.

• CONTROL SYSTEM: A second layer of control is provided to coordinate joint servos to produce high-level tasks such as running and walking. The list of behaviors can be extended by the user through the creation of custom control subroutines.

• ACTUATORS: Realistic joint actuators include effects due to range of motion limits, strength limits, or for robotics applications, friction, backlash, compliance, and delay. These realistic

Page 134: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

130

effects can be included in the simulation model for detailed control system development or excluded for higher level conceptual studies of motion control.

• SENSORS: Sensors are used to measure position, velocity, acceleration, contact, and forces for control system development.

8.1.1 Time A collection of time based simulation counters determines the order in which these modules are run and the rate at which they are run. The lowest level time counter for the simulation is time (t). t is incremented with the value plant_dt, set at the user interface. All other dt’s must be larger than this dt. Modules with larger dt’s are run less frequently. This saves unnecessary calculations or eliminates emulating discrete time sampling affects for sensors or actuators.

The following time variables use units of seconds in simulation time, not real time (unless indicated).

Variable Description t n Simulated time.

control_dt n Interval for calling user-supplied control subroutines.

servo_dt n Interval for computing servo control.

send_dt n Interval for sending data over pipe (realtime).

check_dt n Interval for updating the check routine, also used to compute some sensor values.

goal_dt n Interval for updating goal data.

check_time n Time based counter for running the check routine.

control_time n Time based counter for running control routine.

The following time variables are special. They are used in all simulated characters of a simulation; that is, the same value is applied to all characters. These values are set in the Scenario Explorer window. They cannot be individually set in the simulations or on the command line.

Variable Description record_dt n Interval for recording data in buffer.

plant_dt n Interval for computing equations of motion and performing numerical integration of all time. This must be the smallest increments in the simulation.

Page 135: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

131

8.2 Creating Simulation Scripts The initial state of the simulation is defined in the .dbs file. You can change the initial state with a script file. Variables set in a script file are included in subsequent .dbs files. Script files have a .script extension. Simulation commands that can be put into simulation scripts are described in the section Simulation Commands in chapter 5.

Script files are useful for changing a character’s setting after a specified amount of simulation time. For instance, a script that contains set q.* 0

run 1

set q.* 1

run 1

will set all variables that start with q. to zero, run the simulation for 1 second of simulation time, then set all variables that start with q. to 1 and run the simulation for another second.

8.3 Standardized Character Variables This section describes variables associated with characters. Many of these variables use the argument jointname. The syntax of jointname is

joint_[l,r]_{r,t}{x,y,z}

where

l,r is an optional argument for either left or right, for joints that are in pairs, such as elbow_l and elbow_r

r,t is a required argument specifying how the DOF movement occurs in relation to the axis; around, rotational, or along, translational.

x,y,x is a required argument for the axis around which the joint rotates or along which the joint translates

Examples : shoulder_r_rz, wrist_l_rx, base_tx

8.3.1 Example: Brick Base Joint Variable Names All characters have a base joint. A brick is a dynamic model called a freebody and can be a character in a simulation. It has only one link, called base. It has six joint names. Three are translational, along each axis: base_tx, base_ty, base_tz. Three are rotational, around each axis: base_rx, base_ry, base_rz.

Page 136: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

132

Names of other character joints and links are shown in the next chapter.

8.3.2 Position, Velocity, Acceleration The table below describes the state variables for each character. State variables describe the position, velocity, and acceleration of each joint DOF of the character.

Variable Description q.jointname n Joint position. n is in radians for rotating joints and meters for

translational joints.

qd.jointname n Velocity of the joint. n is radians/second for rotating joints and meters/second for translational joints. For ball joints, this is the angular velocity.

p.jointname n Position variable used internal to the simulation. It differs from q for 3 DOF rotational joints to avoid joint singularities.

pd.jointname n Derivative of p used internally.

u.jointname n Equivalent to pd.

ud.jointname n Acceleration. Strictly the second derivative of p.

8.3.3 Zero Configuration Each link of a human has its own local coordinate system in which the link mass properties are defined. To simplify the understanding of these coordinate systems we define a special zero configuration of the body. In the zero configuration, all joint angles are zero. In the zero configuration, the local axes of body parts are parallel to the axes of the global frame (the world used in the software). Any displacement of links from this configuration results in non-zero joint angles.

Page 137: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

133

All link-specific parameters, such as mass parameters or offsets between joints, are defined in this configuration.

Zero Configuration: All joint angles are zero. Link axes are aligned with the global axes. Positive rotations about the joint axes result in positive joint angles.

8.3.4 Mass Properties All inertia tensor values are given with respect to each link’s center of mass and defined in link local coordinates. (See the mass properties page in the section To Add a Character).

A frequently used measure of a character’s overall mass properties is the center of mass (COM) location in global coordinates. The COM depends upon the configuration of the human (i.e, the position of the human’s arms and legs at any point in time) and therefore is an output of the simulation rather than an input. The following table lists the COM variable.

Variable Description

com_{x,y,z} Center of mass location. moi_{x,y,z}{x,y,z} Rotational inertia about an axis

8.3.5 Gravity The table below defines the gravity field variable.

Variable Description gravity_{x,y,z} Gravity component in global x,y, and z directions. Default values are

0.0 m/s2 in x and y, –9.81 m/s2 in z.

Page 138: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

134

8.3.6 Joint Servos To create active behavior of a character, internal torques and forces at the human joints are required to create coordinated body motion. To control each joint, Digital Biomechanics uses a simulated servomechanism that can apply a torque to each rotational joint and a force to each translational joint. The joint’s torque or force is set by tau.jointname. Each joint also has a servosw.jointname variable (servo switch) that determines the method used to compute the applied joint torque. The servosw.jointname can have one of four values, each corresponding to a servo model as follows:

Available Joint Servo Types

Type servosw.jointname Value

Limp 0

PD Servo 1

Custom 2

Feedforward + PD Servo 3

Each type of servo is described below.

Limp Servo

The limp servo applies zero torque or force to a joint. It applies the function: tau.jointname = 0.0

If all joints are set to a limp servo with servosw.jointname = 0, the model is influenced only by gravity in a simulation.

PD Servo

A Proportional plus Derivative (PD) servo computes joint torques based on a spring-damper model according to the function : tau.jointname = -k_jointname * (q.jointname – q_d.jointname)

-b_jointname * (qd.jointname – qd_d.jointname)

You must specify two parameters for this servo model: k_jointname and b_jointname

The tmax.jointname variable can also be used to set bounds on the torque applied at each joint: tmax.jointname ≤ tau.jointname ≤ tmax.jointname

Custom Servo

This servo mode leaves the tau.jointname variables unmodified. You can use this if you write your own control software that computes the joint torques independently.

Page 139: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

135

Feedforward + PD Servo

This mode is a combination of servo types 1 and 2. It can be used to apply a standard PD servo, along with a feed-forward term computed using a control-specific method. tau.jointname = ff.jointname +

-k_jointname * (q.jointname – q_d.jointname)

-b_jointname * (qd.jointname – qd_d.jointname)

The following table lists variables associated with joint servos.

Variable Description servosw.jointname n Index to select control servo algorithm in effect at a joint. Servos used

may differ for each joint.

tau.jointname n Torque or force applied to the joint by simulated servo. Units of N*m.

tmax.jointname n Maximum allowable joint torque. Units of N*m.

k_jointname n Joint PD Servo Proportional (P) gain. This corresponds to a spring constant. Units of (N * m) / rad.

b_jointname n Joint PD servo derivative (D) gain. This corresponds to a damping constant. Units of Nms/rad.

ff_jointname n Feed forward torque. Units of N*m.

8.3.7 Joint Limits Both torque and position limits can be applied to a character’s joints.

Torque Limits Torque Limits restrict the size of the torque that can be produced by a given joint. Three models exist for limiting the joint torque.

1. Magnitude limit: The magnitude of the joint torque is limited by the variable tmax.jointname

2. Torque-Speed limits: Simple motor models use a linear relationship between motor speed and motor torque to restrict the maximum available motor torque. In this case, the parameters describing this linear relationship are used to set the value of tmax.jointname.

Human Strength Limits: The amount of torque a human can apply at a joint depends upon the angle of that joint. Maximum torque versus joint angle curves can be used to model these strength limits. Digital Biomechanics uses nth order polynomial functions to describe these torque limit versus joint angle curves.

Page 140: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

136

Position Limits

Position Limits restrict the movement of a joint beyond predefined. The position limit is implemented using a PD servo that applies resisting torques to a joint once it moves beyond the limiting position.

Variable Description lim_jointname_min Minimum joint position limit. Units are rad.

lim_jointname_max Maximum joint position limit. Units are rad.

lim_jointname_k Joint position limit servo proportion gain. Units are (N * m) / rad

lim_jointname_b Joint position limit servo derivative gain. Units are (N * m * s)/rad

lim_jointname_tau Joint position limit torque. The resisting torque resulting from the limit servo. This torque is added to the tau.jointname.

8.3.8 External Forces Forces applied to the human from the environment influences its motion. These external forces arise from collision with other objects or characters in the simulation. All external forces (other than the force of gravity) are summed into a set of external force variables which are then applied to the character. The table below lists the summed, external forces for each link of a character.

Variable Description ef_linkname.pos_{x,y,z} n Position on the link where torque and force are applied at

current time, defined in local link coordinates. Units are m. ef_linkname.torque_{x,y,z} n Torque applied at current time on link. Units are N*m. ef_linkname.f_{x,y,z} n Force applied at current time on link. Units are N.

8.3.9 Integrators Once the acceleration of each joint of a human is computed from the equations of motion, a numerical integrator is used to compute the resulting velocity and position of those joints. Digital Biomechanics uses a standard Euler integration scheme to integrate velocity and position of each character. The integrator type is set with the variable integ_method.

Variable Description integ_method n n specifies the type of integrator used; one of

Page 141: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

137

0 Euler – Recommended 5 Null integrator – Allows you to specify position and velocities of joints explicitly (see text below).

Null Integrator

The null integrator lets you study predetermined motion of a character. You might use it, for example, to simulate a complicated human motion for which we have no feedback controller that can reliably produce the desired motion. In null integrator mode, the software doesn’t compute the motion of the character, it reads it from an associated data file. The null integrator mode can be useful for studying the motion and dynamic behavior of secondary characters, such as a backpack, that are attached to a primary human like a human that is using the null integrator. In this example, the backpack is dynamically simulated as it moves along with the human model. It remains attached to the human model by virtue of a suspension system. Collision forces between it and the human are computed and applied to the backpack. Those forces cannot affect the motion of the human, however, since its motion is predetermined.

The null integrator mode is a valuable simplification for analyzing how equipment interacts with humans during complex human motions.

The null integrator requires the user to load a goal file that contains the desired position and velocity data for the character. The joint position and velocity variables for the human should be set up to get their values from the data file using the goal commands on goal driven behaviors. (Goal commands are in the section Goal File Commands.

8.3.10 Integrals of Motion Physical quantities that summarize the motion of each human are computed during the simulation. These quantities are computed in the check routine. These quantities can serve as a useful analysis tools for the human simulation.

Variable Description angular_momentum_{x,y,z} Angular momentum of the entire character. Units are

2

2 **s

radmkg

linear_momentum_{x,y,z}

Linear momentum of the entire character. Units are s

mkg *

Page 142: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

138

kinetic_energy n

Kinetic energy of the entire character. Units are 2

2*s

mkg

8.4 Notes on Simulation Speed Increasing the speed of a simulation can be accomplished without tackling the underlying code by doing any of the following:

• Increasing the simulation time step dt

• Turning off graphics rendering as in batch mode

• Reducing the amount of data recorded

• Minimizing the number of contacts

• Using poly to poly contact instead of point to poly contact

In order to get a feel for the amount of speed up that can be achieved by each of these factors, we chose a snake simulation with 38 degrees of freedom as a test case

Disclaimer: The numbers reported in this study are the result of a doing only a few experiments on a single simulation and should be used only to indicate trends. No attempt has been made to do a thorough statistical study.

Here is a very brief summary of the results.

Increasing the simulation time step resulted in an inversely proportional decrease in the simulation speed.

Turning off the graphics had a significant effect of maybe 70-80% on the speed. This percentage will probably lessen as the complexity of the simulation increases, i.e., with more contact points, or with a more complex control system.

Turning off data recording has a less significant effect on the speed, resulting in reductions of less than 13%. Reducing the recording frequency by a factor of 3, reduced the speed by less than 5%.

Tripling the number of contact relationships, resulted in slowdowns of 36% for lower numbers of contacts (<200) and 22% for higher numbers of contacts (<950).

Poly to poly contact takes about the same amount of time as point to poly contact per contact relationship. Representing a polygonal shape with a set of points requires many points, so that in general point to poly contact will involve many more contact relationships than poly to poly contact. This makes poly to poly contact a clear win in terms of speed. The disadvantages of using poly to poly contact are:

Page 143: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

139

• The boundary layer required between contacting objects does not allow for sharp corners

• The visuals show a gap between contacting objects

• Friction may not be accurately modeled, because contact is reinitialized each time the contact point moves around on the polygon. This may result in underestimating the friction.

• Interpenetration can exceed the boundary layer and will produce unreliable contact forces.

Page 144: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

140

9 Batch Mode Processing Batch processing of simulations has been added to support running sequential simulation experiments. Using batch mode, the user can systematically vary a control parameter or environmental parameter to gain understanding of its impact on the simulation. The screenshot of the DB batch-mode session is shown below. Typing help displays a list of supported functions. For more information on a particular function type help command (e.g. help open). This will display command usage information (i.e. if the function takes mandatory or optional arguments) and a description detailing usage details (i.e. you need to provide relative or absolute paths, etc.).

Currently, the DB batch-mode supports no GUI and the simulations are being carried out using script commands only. Batch mode can be activated from the main DigitalBiomechanics start menu.

Alternatively, the following command line initiates the batch-mode session in the command prompt window:

%Boston_Dynamics%\bin\win32\i586\db.exe -no_ui

Batch Processing Screen Shot

The table below illustrates the list of commands for batch processing. In addition to these commands, the normal simulation commands for setting, sending and recording variables are all supported.

Page 145: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

141

Description of Batch Processing Commands

Command Description

open <scenario file> Open the specified scenario file

start Launch sim mode

save <scenario file> Save the simulation results to the specified scenario name

stop Transition to the setup mode; leave simulation mode

close Close the dbs file

!<command> Escape into shell and execute command (eg. !dir)

echo <on|off> Increase/diminish verbosity

exit Terminate the session

Commands can be typed one at a time or placed in a “.script” file for batch processing. Note that when using the open command, interactively or in a script file, you must either use the entire absolute file path, or make sure that the provided relative path coincides with the location from which the script file is started.

You can also run commands available in your shell window, by using the special shell escape character !.

For example, typing !cd c:\

changes the current working directory to c:\. Using shell commands is a convenient way to navigate around your file system, shortening the names of script files you type. Note that commands available on different systems will vary based on the user’s setup. A set of useful command line tools can be downloaded at: http://www.cygwin.com.

A sample of a script file is shown below. To run this script start up the batch mode, go to the directory

%DIGITAL_BIOMECHANICS%/db/examples/brick/;

type

open test_batch.script.

Page 146: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

142

test_batch.script

echo on # OPEN SCENARIO open brick_point_contact.dbs # LAUNCH SIM MODE start # SET INITIAL CONDITIONS target brick set q.roll .2 record kinetic_energy run 10 # SAVE RESULTS: save brick_test.dbs # LEAVE THE SIMULATION MODE stop # CLOSE THE SCENARIO close

Page 147: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

143

10 LittleDog Model Digital Biomechanics supplies a model of the LittleDog robot. This chapter describes link, joint, and servo structure of this model. It describes the default mass properties and link lengths of the model. Also included are directions to view an example walking simulation.

The model is comprised of 13 rigid body sections called links connected by 12 rotational joints.

10.1.1 Model Structure The LittleDog model has 13 rigid links and 18 DOF. The figure below shows a schematic representation of the model joints. The base joint has 3 translational and 3 rotational DOF; the four legs each have 3 single DOF pin joints.

fl_hip_ry

fl_knee_ry

fl_hip_rx

fr_hip_ry

fr_knee_ry

fr_hip_rx

hl_hip_ry

hl_knee_ry

hl_hip_rx

hr_hip_rx

hr_hip_ry

hr_knee_ry

x

y z

Page 148: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

144

The tables below list the links and joints of the LittleDog model. The base joint is a 6 degree of freedom joint located near the center of mass of the body.

LittleDog Joints

Joint Name Parent Link Translation from Parent (m) base_t[xyz]

base_r[xyz]

Ground

fl_hip_rx base (0.104, 0.033, 0.0)

fl_hip_ry fl_hip_rx (0.0, 0.0236, 0.0)

fl_knee_ry fl_hip_ry (0.018, 0.0, -0.0728)

fr_hip_rx base (0.104, -0.033, 0.0)

fr_hip_ry fr_hip_rx (0.0, -0.0236, 0.0)

fr_knee_ry fr_hip_ry (0.018, 0.0, -0.0728)

hl_hip_rx base (-0.104, 0.033, 0.0)

hl_hip_ry hl_hip_rx (0.0, 0.0236, 0.0)

hl_knee_ry hl_hip_ry (-0.018, 0.0, -0.0728)

hr_hip_rx base (-0.104, -0.033, 0.0)

hr_hip_ry hr_hip_rx (0.0, -0.0236, 0.0)

hr_knee_ry hr_hip_ry (-0.018, 0.0, -0.0728)

LittleDog Model Links Body Segment Parameters

Link Name Mass (kg) Center of Mass (m) Moment of Inertia (Ixx, Iyy, Izz) body 1.8 (0.0, 0.0, 0.0) (1.625e-3, 9.178e-3, 8.794e-3)

fl_hip 0.0623 (0.0, 2.934e-4, 0.0) (3.694e-6, 1.455e-5, 1.467e-5)

fl_uleg 0.1279 (0.013, 0.0013, -0.0206) (8.153e-5, 8.924e-5, 1.459e-5)*

fl_lleg 0.0464 (0.0, 0.0, -0.0202) (3.773e-5, 3.537e-5, 4.177e-6)

fr_hip 0.0623 (0.0, -2.934e-4, 0.0) (3.694e-6, 1.455e-5, 1.467e-5)

fr_uleg 0.1279 (0.013, -0.0013, -0.0206) (8.153e-5, 8.924e-5, 1.459e-5)*

fr_lleg 0.0464 (0.0, 0.0, -0.0202) (3.773e-5, 3.537e-5, 4.177e-6)

Page 149: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

145

hl_hip 0.0623 (0.0, 2.934e-4, 0.0) (3.694e-6, 1.455e-5, 1.467e-5)

hl_uleg 0.1279 (-0.013, 0.0013, -0.0206) (8.153e-5, 8.924e-5, 1.459e-5)*

hl_lleg 0.0464 (0.0, 0.0, -0.0202) (3.773e-5, 3.537e-5, 4.177e-6)

hr_hip 0.0623 (0.0, - 2.934e-4, 0.0) (3.694e-6, 1.455e-5, 1.467e-5)

hr_uleg 0.1279 (-0.013, -0.0013, -0.0206) (8.153e-5, 8.924e-5, 1.459e-5)*

hr_lleg 0.0464 (0.0, 0.0, -0.0202) (3.773e-5, 3.537e-5, 4.177e-6)

10.2 Example Behavior View an example of LittleDog walking by following the directions below.

10.2.1 Walking One simulation showing LittleDog walking with an amble gait has been included with this distribution of DB.

The dbs file is in this directory: %DIGITAL_BIOMECHANICS%\db\examples\littledog

And this file: LittleDog_walk.dbs

To run the simulation:

1. Enter Setup mode with .

2. Open the dbs file that corresponds to the desired simulation. LittleDog_walk.dbs

3. Enter Simulation mode with this icon .

4. Use to load the corresponding script: %DIGITAL_BIOMECHANICS%\db\examples\littledog\scripts

LittleDog_walk.script

5. Select 10 seconds in the bottom of the 3D view window and click

Page 150: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

146

11 Freebody Model A freebody is a 6 DOF rigid body simulation. You can see the list of available freebodies if you create a new character and select freebody as the model. Alternatively, you can add your own free body shapes and mass properties. See the section Introducing Digital Biomechanics.

The table below shows the joint names of the freebody

Joint Name Outbound Body Link base_t{x,y,z} Base

base_r{x,y,z} Base

Page 151: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

147

12 Modeling Dynamic Equipment Certain types of analysis require an estimate of the interaction forces between equipment and simulated characters. Since no forces are exchanged between static equipment and its parent, users seeking this level of simulation detail should use dynamic equipment.

Dynamic equipment is nothing more than a passive character (i.e. a character without controlled behavior) that interacts with other characters by exchanging external force. Since force interaction depends not only on the inertial properties of the object, but also on the object’s shapes, an appropriate visual and contact shape should be selected. Digital Biomechanics includes several standard piece of equipment (i.e. helmet, backpack) that can be used.

For example, if we wanted to simulate a character running with a helmet we could do this using two different techniques. If our goal was to understand how helmet mass influences the character’s running motion, we could use static equipment. On the other hand, if our goal was to understand how helmet/head interaction forces affect helmet position and orientation during running, dynamic equipment should be used.

To model the helmet as dynamic equipment, we would need two characters in our simulation, a human character and a six degree of freedom freebody for the helmet. Next, we would need to find a way to get the freebody to stay on the character’s head. As in real life, this would be accomplished through force exchange. First, contact points could be added to the helmet to prevent helmet/head interpenetration. Secondly, we could model the helmet suspension system between the helmet/head via a spring and damper.

The soldier run to prone examples1 included with your distribution show some examples of how to use dynamics equipment

1 Take a look at “%DIGITAL_BIOMECHANICS%/db/examples/human3d_46_run_to_prone” for some examples of using dynamic equipment.

Page 152: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

148

13 Collision Property Methods and Parameters When you set up a scenario in Digital Biomechanics, you add contact pairs for which you want the software to test for collisions. A contact pair consists of two objects and a collision property. Vectors illustrating the forces are automatically generated whenever you create a contact pair.

You want to create collision properties that create realistic collisions between objects. When you create a collision property, you give it a name, select one of five calculation methods, and select values for the parameters for your chosen calculation method.

This chapter describes what good collision properties are, the four default calculation methods, and how to choose good parameter values for each method.

13.1 What Makes a Good Collision Property? A good collision property is essential to create realistic dynamic simulation of objects that interact through contact forces. Usually, a “good” (or stable) collision property allows only realistic levels of interpenetration between objects and removes some if not most of the energy of the objects in contact. “Bad” (or unrealistic) collision properties remove too little energy or even add energy during contact, do not allow sustained contact, oscillate excessively, or may allow large interpenetrations. Digital Biomechanics offers five default methods with default parameter values that you can adapt to your needs. The five default methods used in Digital Biomechanics depend upon spring and damper models that apply forces based on relative penetration and velocity of colliding objects. The default sets of parameter values provide good behavior for a range of simulation conditions.

Unlike the underlying simulations, that require only their underlying dynamic representation to be simulated (that is, mass properties, joint offsets, equations of motion), contact detection uses both the graphical and the dynamic system descriptions to calculate contact forces. This is because contact forces are modulated by interpenetration of the 3D geometry.

The five default methods of computing collisions, on which you can base your collision properties, are:

• Linear Spring – Linear Damper (Lspring_Ldamper or L-L) method

The Lspring_Ldamper method provides the same stiffness and damping in both normal and tangential directions, however, the normal and tangential forces are related according to the Coulomb friction law.

• Nonlinear Spring – Linear Damper (NLspring_Ldamper or NL-L) method

The NLspring_Ldamper method is similar to the L-L method except it allows you to set different stiffness and damping in normal and tangential directions. Like the L-L method, the normal and tangential forces are related according to Coulomb friction law.

• Nonlinear Spring – Nonlinear Damper (NLspring_Nldamper or NL-NL) method

The NLspring_NLdamper method is analogous to NLspring_Ldamper with nonlinear damper. In this model, the damping coefficient is a linear function of penetration. This

Page 153: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

149

presents a softer model than the NLspring-Ldamper method and eliminates large velocity dependant forces at the initiation of contact.

• Nonlinear Spring with hysteresis (NLspring with hysteresis) method

The NLspring with hysteresis method is a spring model with hysteresis whose parameters were chosen to match the polyurethane foam pad for MICH helmets.

• Linear Spring-Linear Damper Strap (Lspring_Ldamper_strap) method

The Lspring_Ldamper_strap models a spring/damper system connected between two points. This method should only be used between two point pieces of equipment.

The methods’ equations and parameters are detailed below:

13.2 Lspring_Ldamper Method The L-L method computes the collision forces as follows:

Normal collision force is calculated by:

tnn xbxkF &∆−∆−=

Tangential collision force is calculated by:

⎪⎩

⎪⎨⎧

⋅≥⋅

⋅<=

µµ

µ

nn

nt FFifF

FFifFF

Torsional collision torque is calculated by:

θθτ &∆−∆−= rrn bk

The table below defines parameters pertaining to this contact method. More information on these parameters can be found in the “Choosing Stable Collision Property Parameters” section later in this chapter.

Property Function

nb Normal damping coefficient (resistance to normal relative velocity of the two contacting objects). (Ns/m)

rab Torsional damping coefficient (resistance to relative rotation of the two contacting objects). (Nms/rad)

k Normal and tangential stiffness (resistance to relative penetration of the two contacting objects). (N/m)

rk Torsional stiffness (resistance to relative rotation of the two contacting objects.). (Nm/rad)

Page 154: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

150

µ (mu) Coefficient of friction.

or Object radius; boundary layer thickness (m)

13.3 NLspring_Ldamper Method The NLspring_Ldamper method computes the collision forces as follows:

Normal collision force is calculated by:

⎪⎪⎪⎪

⎪⎪⎪⎪

⋅∆≤∆∆−∆

∆∆

−−

⋅∆>∆∆−∆−

≤∆∆−∆−

=

92.01

92.008.0

0

nomnnnn

nom

n

n

nomnnnnn

nomnnnn

n

xifxbxx

k

xifxbxk

ifxbxk

F

&

&

&

Tangential collision force is calculated by:

⎪⎪⎪⎪

⎪⎪⎪⎪

⋅∆≤∆∆−∆

∆∆

−−

⋅∆>∆∆−∆−

≤∆∆−∆−

=

92.01

92.008.0

0

nomtttt

nom

t

t

nomttttt

nomtttt

xifxbxx

k

xifxbxk

ifxbxk

F

&

&

&

⎪⎩

⎪⎨⎧

⋅≥⋅

⋅<=

µµ

µ

nn

nt FFifF

FFifFF

Torsional collision torque is calculated by:

θθτ &∆−∆−= rrn bk

Page 155: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

151

The table below defines parameters pertaining to this contact model. More information on these parameters can be found in the section later in this chapter Choosing Parameters for Stable Simulation of Contact.

Property Function

nb Normal damping coefficient (resistance to normal relative velocity of the two contacting objects). (Ns/m)

rb Torsional damping coefficient (resistance to relative rotation of the two contacting objects.). (Nms/rad)

tb Tangential damping coefficient (resistance to tangential relative velocity of the two contacting objects). (Ns/m)

nk Normal stiffness (resistance to normal penetration of the two contacting objects). (N/m)

rk Torsional stiffness (resistance to relative rotation of the two contacting objects.). (Nm/rad)

tk Tangential stiffness (resistance to tangential penetration of the two contacting objects). (N/m)

µ (mu) Coefficient of friction

nom∆ Nominal nonlinear spring length. (m)

or Object radius; boundary layer thickness (m)

13.4 NLspring_NLdamper Method The NLspring_NLdamper method computes the collision forces as follows:

Normal collision force:

⎪⎪⎪⎪

⎪⎪⎪⎪

⋅∆≤∆∆⋅∆−∆

∆∆

−−

⋅∆>∆∆⋅∆−∆−

≤∆∆⋅∆−∆−

=

92.01

92.008.0

0

nomnnnn

nom

n

n

nomnnnnn

nomnnnn

n

xifxxbxx

k

xifxxbxk

ifxxbxk

F

&

&

&

Page 156: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

152

Tangential collision force:

⎪⎪⎪⎪

⎪⎪⎪⎪

⋅∆≤∆∆⋅∆−∆

∆∆

−−

⋅∆>∆∆⋅∆−∆−

≤∆∆⋅∆−∆−

=

92.01

92.008.0

0

nomtttt

nom

t

t

nomttttt

nomtttt

xifxxbxx

k

xifxxbxk

ifxxbxk

F

&

&

&

⎪⎩

⎪⎨⎧

⋅≥⋅

⋅<=

µµ

µ

nn

nt FFifF

FFifFF

Torsional collision torque:

θθτ &∆−∆−= rrn bk

The table below defines parameters pertaining to this contact model.

Property Function

nb Normal damping coefficient (resistance to normal relative velocity of the two contacting objects). (Ns/m)

rb Torsional damping coefficient (resistance to relative rotation of the two contacting objects.). (Nms/rad)

tb Tangential damping coefficient (resistance to tangential relative velocity of the two contacting objects). (Ns/m)

nk Normal stiffness (resistance to normal penetration of the two contacting objects). (N/m)

rk Torsional stiffness (resistance to relative rotation of the two contacting objects.). (Nm/rad)

tk Tangential stiffness (resistance to tangential penetration of the two contacting objects). (N/m)

µ (mu) Coefficient of friction.

nom∆ Nominal nonlinear spring length. (m)

or Object radius; boundary layer thickness (m)

Page 157: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

153

13.5 NLspring with Hysteresis Method The NLspring with hysteresis method uses a special spring model with hysteresis in the normal direction. It uses standard spring damper models in the lateral and rotational directions. This model was created to emulate the properties of a polyurethane foam pad for MICH helmets. In the normal direction, this model uses a parameterized force displacement curve to compute contact forces. The loading and unloading curves are different, thereby introducing hysteresis.

Tangential collision force is calculated by:

xbxkF nn &∆−∆−=

⎪⎩

⎪⎨⎧

⋅≥⋅

⋅<=

µµ

µ

nn

nt FFifF

FFifFF

Torsional collision torque is calculated by:

θθτ &∆−∆−= rrn bk

The table below defines parameters pertaining to this contact model.

Property Function

rb Torsional damping coefficient (resistance to relative rotation of the two contacting objects.). (Nms/rad)

tb Tangential damping coefficient (resistance to tangential penetration of the two contacting objects). (Ns/m)

displacement gain

Gain to scale input displacement to method (disp = dispin x Gain).

Page 158: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

154

force gain Gain to scale output force calculated by model (F = F out x Gain).

rk Torsional stiffness (resistance to relative rotation of the two contacting objects.). (Nm/rad)

tk Tangential stiffness (resistance to tangential penetration of the two contacting objects). (N/m)

µ (mu) Coefficient of friction.

or Boundary layer thickness. (m)

rate gain Gain to scale input rate to method (rate = ratein x Gain).

13.6 Lspring_Ldamper_strap Method The L-L strap method computes the interaction forces as if a linear spring/damper was connected between the two objects in the collision relationship. Interaction force is calculated by:

( )o

otocalc ll

llxbllkF−−

⋅∆+−= )( &

Compressible Setting Generated Force

1 calcFF =

0

⎩⎨⎧

<≥

=

000

calc

calccalc

FFF

F

Property Function

k Normal and tangential stiffness (resistance to relative penetration of the two contacting objects). (N/m)

b Damping coefficient (resistance to relative velocity of the two contacting objects). (Ns/m)

l Actual Spring Length (m)

ol Spring Rest Length (m)

compressible See above.

Page 159: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

155

This collision property should be used only between point equipment objects.

13.7 Choosing Stable Collision Property Parameters This section describes how to choose collision property parameters that lead to stable simulation of contact. The table below shows the acronyms and variables used in this section:

Item Definition

ζ (zeta) Damping ratio; rate of decay of oscillation, mk2b

ωn (omegan) Natural frequencymk

n =ω

e Coefficient of restitution,

collisionbeforevelocityrelativecollisionaftervelocityrelative

e =

e<1 Realistic collisions m Mass, the object(s) making contact with SDFF k Linear spring (stiffness) b Damper

∆t (delta t) Fixed time step

It is difficult to choose collision property (or contact) parameters that work equally well for all possible characters, behaviors, and ground types. The characteristics of a collision depend not only on the parameters chosen, but also on the mass and configuration of the characters, the number of points in contact, and the discrete nature of digital simulation. If you change the mass, size, or behavior of a creature, you may need to adjust the collision property parameters to work well for your particular simulation.

In this section we describe how to tune contact parameters for your particular simulation. We describe a simple theoretical model that can help guide your choice of collision property parameters.

First we describe how to choose parameters for the Lspring_Ldamper method. The theoretical model described below is an approximation. A thorough treatment of this topic is beyond the scope of this document. Generating good contact parameters is an iterative and empirical process by which you choose parameters, test them, and adjust them. Using a few basic rules of thumb and the figures provided here, you should be able to choose stable contact parameters for your simulation.

Then in the two following sections, we describe how to extrapolate this method to choose parameters for the NLspring_Ldamper and NLspring_NLdamper methods.

Page 160: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

156

13.7.1 Choosing Parameters for the Lspring_Ldamper Method This section describes how to choose parameters that lead to the stable simulation of contact for the Lspring_Ldamper contact method.

This analysis uses a simple mass-spring-damper model of contact. It includes the non-linearity of a contact force that can act only in compression, and assumes the use of Euler integration, at a fixed time-step of ∆t, to integrate the equations of motion.

Contact can be modeled as a mass-spring-damper system, like that shown in Figure 1. This system, which consists of an object with mass m, a spring with stiffness k, and a damper with damping b, oscillates with natural frequency ωn. That oscillation decays with damping ratio ζ.

mk

n =ω mk2b

=ζ (1)

m

k b

Figure 1

Under ideal conditions, ζ = 0 means the mass oscillates indefinitely, and ζ ≥ 1 eliminates the oscillations altogether. A basic measure of stability in ground contact is given by the dynamic stability of this simple mass-spring-damper system.

Figure 2 shows stable and unstable regions of mass-spring-damper models as a function of their damping ratio (ζ) and natural frequency (ωn). (Note that the natural frequency is normalized by ∆t.) The equations for ζ1 and ζ3 are as follows:

n

n1 t

41

t1

ω∆+ω∆

=ζ 2t n

3ω∆

=ζ (2)

Page 161: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

157

Figure 2

The mass-spring-damper is unstable for values of ζ > ζ1 and ζ < ζ3. Conversely, the region ζ1 > ζ > ζ3 results in a stable mass-spring-damper simulation. However, this does not guarantee stability in a discrete simulation with one-sided contact.

One-sided contact means that the contact force only acts in compression. One practical way to include the effect of this contact constraint is to measure the coefficient of restitution (e) of a collision between the mass and the spring-damper pair. The coefficient of restitution is the ratio of relative velocity between objects just after and just before contact:

collisionbeforevelocityrelativecollisionaftervelocityrelative

e = (3)

Figure 3 shows a large green region for which e < 1. Realistic collisions between objects should result in e < 1.

The reason that the green region is smaller than that predicted by the ζ1, ζ3 curves is as follows.

Page 162: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

158

Digital Biomechanics advances time in discrete steps. It is likely during simulation that when contact is first detected between two bodies, they have already interpenetrated. When this happens, it is equivalent to a small amount of energy being created because the contact spring was suddenly compressed. The stable region plotted in Figure 3 is for the “worst-case” situation in which the object penetrated a full ∆t before contact was initialized. For smaller penetrations, the e ≤ 1 region is always larger. The contours (left to right) in the stable zone show values of e = 0.25, 0.5, 0.75, and 1. Note that the stable region as predicted by the coefficient of restitution is significantly smaller than the region of stability predicted by the equations for ζ1 and ζ3 above. Given a system with a certain ωn, the minimum value of e (most energy loss during contact) is approximated by the curve for ζ2. The equation for ζ2 follows:

nn

tt

ωω

ζ ∆+∆

=411

21

2 (4)

Figure 3

Page 163: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

159

Above and to the right of ζ2, the simulation remains in contact for only a single time step before contact is broken again.

In the ideal case of a perfect mass-spring-damper that contacts the ground at a single point, you can simply choose the point in Figure 3 where you want your dynamic model to operate. You may choose to maximize energy loss (choose a point along the ζ2 line) with the stiffest ground (choose a high ωn) so that contact penetrations are small. Knowing the mass, you can choose the natural frequency and damping ratio from which you can solve for k and b using equation (1). However, in more complex simulations that include articulated objects like humans, the mass that the contact model ‘sees’, the apparent mass, may not be well known. In terms of stability, this apparent mass depends upon the mass and configuration of the object, as well as other factors. Apparent mass is never more than, and is frequently much less than, the total mass of your object. One of the dashed lines in Figure 4 shows how the operating point changes as the apparent mass changes (m↑ or m↓) for fixed spring and damper values. These lines of changing mass always go through the origin of the figure with a slope that depends upon your chosen values of b and k. As apparent mass increases you move toward the origin and vice versa as apparent mass decreases. (Note that trends in increasing and decreasing stiffness and damping are also shown.) Therefore good ground model parameters need to produce stable contact for the range of apparent masses your simulated object is likely to present.

Figure 4

Page 164: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

160

For example, suppose you are simulating running. At heel strike there may be a single contact point (the heel) and the apparent mass is nearly the total body mass because the compression of the ground at the heel is related to the descent of the whole body. Suppose you choose an operating point for the heel on the ζ2 line in order to maximize energy loss during heel strike. Then when the ball of the foot and the heel of the foot are both in contact, the ground ‘sees’ two apparent masses, that of the forefoot and that of the heel . The apparent mass of the forefoot may be much lower than that of the heel since the rotation of the foot about the ankle may not involve any translation of the bulk of the mass of the body. Therefore, the operating point of the forefoot in Figure 4 is further out on the mass line which puts it in an area of lower energy loss or possibly even in an unstable region. This may cause the forefoot to “chatter” with the ground; that is, make and break contact rapidly as the forefoot oscillates about the ankle. This can be a problem with running or walking simulations where stable ground contact is desired. You can remedy this problem by choosing a heel strike condition closer to the origin (further in the mass line) thus moving the lighter apparent mass condition of the forefoot to a lower e contour in Figure 4.

The ground parameters most suitable for your simulation depend upon the objects in contact, their mass and the range of configurations in which those objects collide. Some examples follow that show how to start the process of choosing ground parameters.

Example 1: Ideal Mass Spring Damper.

In this example we use a simple brick model with mass = 1 kg. Put a single contact point located at the center of mass (0,0,0) of the brick and eliminate contact between the polygonal brick shape and the ground. Because contact forces are applied directly to the center of mass the apparent mass is equal to the total mass.

We choose the operating point with ζ = 1.5, ωn = 0.350/∆t =350 rad/s (∆t = 0.001) because it has the highest possible stiffness with e < 0.25 (Figure 5). Solving for spring and damper values from equations (1) results in k = 122,500 N/m and b = 1050 Ns/m. Choosing an L-L ground model with these parameters (mu = kr = br = 0) and dropping the brick from a 1 meter height shows that the contact is stable and the brick movement quickly settles down.

Page 165: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

161

Figure 5

Example 2: Brick With Reduced Apparent Mass. In this example, we place contact points at the four corners of the brick. The addition of multiple points that simultaneously touch the ground and their location away from the COM has the effect of reducing the apparent mass at the contact points. We see that the parameters need to be adjusted to achieve stable contact.

Starting from the same scenario in example 1, add 4 contact points, one to each lower corner of the brick (± 0.5, ±0.5, −0.5). Use the same parameters as in Example 1. Tilt the brick slightly using the posing tool so one corner hits the ground before the others as the brick falls. You see that the brick motion does not settle down and may even gain energy during the simulation.

The instability is due to the reduced apparent mass at each of the 4 contact points. Following the line of slope b/2k towards the lower mass direction in Figure 5, the operating point is somewhere above the ζ2 line. Given the instability of this simulation, the operating point is probably beyond the green region. You can improve the ground contact by using a lower apparent mass in the calculation of k

Page 166: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

162

and b. Using the same ζ = 1.5, ωn = 0.350/∆t but using apparent mass = mass/4 = 0.25 results in k = 30625 N/m, b = 262.5 Ns/m. Dropping the brick with these parameters results in a stable simulation.

From these examples, you can see that a design strategy for choosing L-L parameters is to choose a line segment in Figure 4 for which both the light and heavy apparent masses of your system fall in a good region of stable contact. The larger the range of apparent masses in your system, the harder this can be. However, using the above diagrams, we have found that we can find good contact parameters through an empirical process of choosing, testing, and adjusting contact parameters.

13.7.2 Quick Ground Contact Parameter Choices for LittleDog The information provided above presents bounds for parameter choices and directions for successive iterations of the ground contact properties. However, for quick parameter generation for the LittleDog model you can follow the steps below. From equation 1 above, t∆ is upper bounded by

groundkmt ≤∆ , however empirical data suggest a more conservative bound on t∆ shown in

equation 5.

• Using the mass m of the last link on the leg:

• For a desired t∆

210 tmkground ∆⋅

≤ (5)

• Or for a desired groundk

groundk

mt⋅

≤∆10

(6)

• If we fix 1=ζ then:

groundground kmb ⋅⋅= 2 (7)

13.7.2.1 LittleDog Ground Tuning Example

Using the LittleDog walking example presented in 10.2.1 with 005.0=∆t . Using the mass (0.0464 kg) of the last link of the leg: 1560,18 −≤ Nmkground then 17.58 −= Nsmbground . Shown below is

the variance in the ground reaction force over one gait cycle as groundb is varied. The ground damping with the least amount of variance occurs at a point lower than produced by equation 7 above. Generally, you should attempt to use ground stiffness values as low as possible which still result in

Page 167: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

163

realistic ground penetrations and then tune ground damping to reduce oscillations in the ground reaction force vectors.

20 40 60 80 100 120 140

50

100

150

200

250

300

350

GR

F V

aria

nce

(N2 )

Ground Damping (N/m/s)

Ground Reaction Force Variance vs. Ground Damping (k = 18,560 N/m)

Calculated Damping Value

Figure 4

13.7.3 Choosing Parameters for the NL-L Method The NL-L method includes a ground spring whose stiffness starts with the value k as in the L-L model, but increases as penetration increases. This stiffening spring can be useful. If your simulation includes occasional impulsive contacts that produce extreme penetrations, then you may try using the NL-L method to reduce those large penetrations without significantly changing the low penetration contact behavior. Our suggestion is to design L-L parameters first. Then use these parameters for b and k in the NL-L method along with a non-zero value for the nonlinear spring length parameter. Choose nonlinear spring length to be some value of object penetration beyond which you do not want your simulation to exceed. The spring non-linearity effectively makes the L-L method you started with stiffer. Therefore, if you are at the limit of stiffness for the L-L method, the NL-L method may cause your contact to become unstable. If so, try reducing the linear stiffness parameter. Experiment with the parameters you’ve chosen and iterate on them to find suitable values.

13.7.4 Choosing Parameters for the NL-NL Method Viscous damping terms frequently result in impulsive forces immediately upon impact. The goal of the NL-NL method is to reduce those impulsive damping forces by making the damping penetration dependent. The NL-NL method requires much higher damping constants than either the L-L or NL-L methods to create satisfactory ground forces. A rule of thumb that can be used to start the tuning process for the NL-NL is to first solve for the maximum (∆zmax) or steady-state (∆zss) penetration of

Page 168: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

164

your object using the NL-L or L-L method. Then solve for the new damping parameter of the NL-NL method (bNL-NL) by setting

LNLNLNL bzb −− =∆ ))(( max

or

LNLssNLNL b)z)(b( −− =∆

(5)

Then iterate on the design to empirically determine parameters that work well for your case.

Page 169: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

165

14 Writing Custom Control Code Advanced Digital Biomechanics users can create new character behaviors by writing custom control code. This section describes how to write, compile, and run custom simulations. This chapter assumes that you are familiar with programming and object-oriented techniques, as well as moderately familiar with reading and writing programs in C/C++.

This chapter is written for the Microsoft Visual C++ Compiler version 6.0 on machines running the Microsoft Windows Operating System. If you are using another C/C++ compiler, consult your compiler’s documentation to check for differences.

To use Digital Biomechanics on other operating systems, contact Boston Dynamics.

14.1 Check your Setup Before you begin adding custom code, compile the example source code shipped with your Digital Biomechanics distribution. This ensures that future compilation problems are not due to errors in the way your computer or compiler is set up.

The procedure compiles the example source and links the produced object files to several Boston Dynamics and 3rd party libraries. It uses the nmake utility (part of your Microsoft Visual Studio) and places the new executable in the Digital Biomechanics executables directory, %DIGITAL_BIOMECHANICS%/bin/win32/i586.

Copies of the original executable and any other files are backed up to %DIGITAL_BIOMECHANICS%/bin/win32/i586/backup. If you need to rerun the original executable, copy all files from the %DIGITAL_BIOMECHANICS%/bin/win32/i586/backup to %DIGITAL_BIOMECHANICS%/bin/win32/i586.

1. Open a DOS window (one way is to click Start > Run and type cmd.exe ).

2. Change directories to the customization directory %DIGITAL_BIOMECHANICS%/sim/creaturename.

creaturename is the name of a specific simulation that was shipped to you.

3. Enter nmake –f Makefile.nmake

You should see something similar to the following: Microsoft (R) Program Maintenance Utility Version 6.00.8168.0

Copyright (C) Microsoft Corp 1988-1998. All rights reserved. setting BDI_CONFIG_TARGET to i586_md setting BDI_LIBS_DIR to c:/DBL/bdi/lib/win32/i586_md cl /nologo /G5 /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /c /Ic:/DBL/bdi/include /Ic:/DBL/bdi/3rdparty/cygnus/pthreads-win32/include /I../create /Fo./main_qt.obj .\main_qt.cpp main_qt.cpp

Page 170: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

166

cl /nologo /G5 /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /c /Ic:/DBL/bdi/include /Ic:/DBL/bdi/3rdparty/cygnus/pthreads-win32/include /I../create /Fo./customize.obj .\customize.cpp customize.cpp link /subsystem:windows /OUT:human2d_qt.exe /nologo /LIBPATH:c:/DBL/bdi/lib/win32/i586_md libbdi_human2d.lib libbdi_human2d_ui.lib winmm.lib ws2_32.lib advapi32.lib comctl32.lib netapi32.lib shell32.lib user32.lib gdi32.lib imm32.lib ole32.lib uuid.lib comdlg32.lib c:/DBL/bdi/3rdparty/cygnus/pthreads-win32/lib/win32/i586_md_dll/pthread.lib /LIBPATH:c:/DBL/bdi/3rdparty/globetrotter/flexlm7/lib/win32/i586_md lmgr.lib lmgr327a.lib lm_new.obj ./main_qt.obj ./customize.obj

# # If this copy fails, you must manually copy human2d_qt.exe to c:/DBL/bdi/bin/win32/i586 # cp -f human2d_qt.exe c:/DBL/bdi/bin/win32/i586

If you are unable to compile the source code, check the following:

1. Check that your computer can find the Microsoft compiler in the shell you opened. At the DOS command prompt, enter cl /help

2. If this fails, run the VCVARS32.bat batch file provided with your Visual C++ distribution. This file is, by default, in the VC98\bin directory of your Visual Studio installation directory (usually C:Program Files\Microsoft Visual Studio ). This batch file appends required directories to your path.

3. In the MS-DOS window, enter set to check that the BDI environment variable, BDI_DB, is set to the directory in which Digital Biomechanics has been installed. By default this is c:\Digital Biomechanics\Boston_Dynamics.

Consider writing a batch file to help set up your environment to avoid future problems.

Once you have successfully compiled the example programs, you are ready to start writing custom control code.

14.1.1 Class Hierarchy Overview Digital Biomechanics simulations are written in C++ and use a number of classes to partition and organize simulation functionality. Figure 6 - Simulation Hierarchy Class Diagram shows the simulation class hierarchy.

The first three classes (bdiSimulation, bdiCLSimulation, and dbSimulation) are generic and shared by all simulations. The latter three classes are simulation-specific and contain details about the character you are simulating, such as the system equations of Motion, etc.

For full details on the functionality implemented in each class, read the class headers found in %DIGITAL_BIOMECHANICS%\include.

Page 171: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

167

Figure 6 - Simulation Hierarchy Class Diagram

To create a customized character behavior, you must add source code in the bdiCLSimulation_creaturename_customize class. This class is declared in the creature_creaturename_customize.h found in the customization directory for the simulation. The simulation’s ui directory contains the following files.

File Purpose Makefile.nmake Microsoft Visual C++ makefile to be used with the

nmake utility.

creature_creaturename_customize.h Customize class header file.

main_qt.cpp Main source file that creates an instance of simulation. Only contains the main function.

bdiSimulation

bdiCLSimulation

dbSimulation

bdiCLSimulation_X_base

bdiCLSimulation_X

bdiCLSimulation_X_customize

GENERIC

SIMULATION SPECIFIC

Page 172: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

168

creature_creaturename_customize.cpp A sample customization file to get you started.

Other implementation files (.cpp ) may also exist to group or separate desired functionality. If you add additional files, make sure to include the additional files in the provided makefile (Makefile.nmake).

14.2 Simulation Variables Control code often has many parameters that must be tuned to obtain stable simulation behavior. For maximum flexibility and to avoid having to recompile the controller source each time a parameter’s value changes, variables can be “added” to the simulation.

Once added, the variable’s value can be modified via a script file and inspected at the simulation user interface (SimUI) at simulation run time. Added variables can also be recorded and analyzed in BDIPlot. This is allows visual analysis debugging of input and output signals.

To add a custom simulation variable:

1. Declare the variable we want to add in the custom class header.

2. During class construction add the variable to the SimUI and provide an alias for the variable.

We suggest that simulation variables follow the Digital Biomechanics naming convention. Traditionally we prefix simulation variables with ls_ (such as ls_offset). This convention helps quickly identify variables accessible via the user interface when looking at source code.

14.2.1 Declaring the Variable Declare variables in the class header file creature_creaturename_customize.h), where creaturename is the simulated creature name. Simulation variables can be of type int, float, or double.

To add a simulation variable with the name ls_example, of type double, add the following to the class header file:

double ls_example;

14.2.2 Initializing and Adding the Variable to the Simulation Once a variable has been declared, it needs to be initialized and added to the simulation. This must be done in the simulation class’ constructor. Variables are added to the simulations via three functions in bdiSimulation (see include/bdiCLSimulation.h). The declarations for these functions are add_variable( const char *name, int *var, int value=0 );

add_variable( const char *name, float *var, float value=0.0 );

add_variable( const char *name, double *var, double value=0.0 );

The first parameter specifies the name of the variable that appears in the SimUI. Although this name does not need to be the same as the variable name, we recommended that you do this to avoid confusion. Make sure you do not add two variables with the same name, as the behavior is undefined.

Page 173: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

169

When you add a variable to the simulation, the variable is automatically initialized to 0. If you wish to initialize the variable to some other default value, you can set a value for the third function argument.

Listing 1 and Listing 2 show code that adds three variables of types int, float, and double to a simulation.

Listing 1 Sample variable declaration (creature_charactername_customize.h) #include <creature_human2d.h>

class bdiCLSimulation_human2d_customize : public bdiCLSimulation_human2d

{

public:

bdiCLSimulation_human2d_customize(void);

.

. // Code omitted for clarity

.

protected:

// Define all variables that are added to the dataset. // Consider adding a prefix to all controller variable names

// to avoid namespace conflicts (i.e. ls_run_td_angle,

// ls_walk_stance_time, etc.) int ls_example_int;

float ls_example_float;

double ls_example_double;

};

Listing 2 Sample variable initialization and addition (creature_creaturename_customize.cpp)

#include "creature_human2d_customize.h"

bdiCLSimulation_human2d_customize::bdiCLSimulation_human2d_customize(void)

{

// Add the example variables to the simulation and initialize them add_variable( "example_int", &ls_example_int, 200 );

add_variable( "example_float", &ls_example_float );

add_variable( “example_double", &ls_example_double ); return;

}

14.3 Creating a Custom Controller Once you have added all required variables, you can start writing your controller. The main entry point for all control code is the control_now() function of the creature_creaturename_customize class. This function is called every control_dt seconds.

Page 174: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

170

Listing 3 shows a simple control_now function that sets the desired value of joint 1 to the actual value of joint 2 plus some user-specified offset. The function assumes ls_user_offset was added to the customize class declaration as explained in section Simulation Variables.

Listing 3 Sample control_now() function void bdiCLSimulation_charactername_customize::control_now(void) { servosw.joint1 = bdiCLSimulation::SERVO_TYPE_PD; // use PD servo q_d.joint1 = q.joint2 + ls_user_offset; // Set desired set point servose.joint2 = bdiCLSimulation::SERVO_TYPE_FF; // Use FeedForward Servo tau.joint2 = 10; // Set the torque to some // constant value }

Depending on the selected servo type, the controller can output different parameters. Consult the section Joint Servos to learn about available servo models. Although the entry point for custom control code is the control_now() function, it can call other functions extending over several files. If you add additional files to the simulation, make sure to edit the Makefile.nmake file to include the added files.

14.4 Forward Kinematics The simulation infrastructure contains a significant amount of code to help users with common forward kinematics operations such as obtaining the velocity and position of a point on a link in different frames of reference. Using this infrastructure can save you time and avoid debugging of complex mathematical transforms.

The bdiCLSimulation class (see Figure 6 - Simulation Hierarchy Class Diagram) contains a number of functions for obtaining link position, velocity, and acceleration information. void bl_get_global_position( int link,

double x, double y, double z,

double *gx, double *gy, double *gz);

void bl_get_global_velocity( int link,

double x, double y, double z, double *gx, double *gy, double *gz);

void bl_get_global_acceleration( int link, double x, double y, double z,

double *gx, double *gy, double *gz);

void bl_get_global_orientation( int link, double dc[3][3] );

void bl_get_angular_velocity( int link, double *rx, double *ry, double *rz);

Page 175: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

171

void bl_get_angular_acceleration( int link, double *rx, double *ry, double *rz);

In addition two other functions exist to ease expressing the retrieved information in different frames of reference. // Express the point with coordinates x,y,z in the reference frame of link

// “fromlink” in the “tolink” reference frame. The calculated position is // returned in rx, ry, rz. Use this function when expressing converting a

// position between different reference frames.

void bl_translate( int fromlink, double x, double y, double z,

int tolink, double *rx, double *ry, double *rz);

// Express the vector quantity (i.e. velocity, force, torque, etc. )

// with components x,y,z in the reference frame of link

// “fromlink” in the “tolink” reference frame. The calculated vector comments // are returned in rx, ry, rz.

void bl_transform(

int fromlink, double x, double y, double z, int tolink, double *rx, double *ry, double *rz);

To determine the fromlink and tolink indeces for different links on your creature you need to refer to the bdiCLSimulation_creaturename_base class for you simulation. For example if you have a planar human simulation, this class is called bdiCLSimulation_human2d_base. The class declaration can be found in %DIGITAL_BIOMECHANICS%\include

14.5 Reading Sensors Digital Biomechanics allows you to add virtual sensors to a character as a means of simulating sensors on a real mechatronic system. Currently supported sensors include position, orientation, linear velocity, angular velocity, linear acceleration, and angular acceleration. In addition, sensors can record quantities in global or link local coordinated. Sensor values are automatically recorded and accessible in BDIPlot for analysis.

If you wish to read sensor values for control purposes, you can use a function defined in dbSimulation class (see include/dbSimulation.h) to read sensor values. The declaration for this function is shown below. // Returns 0 if the call fails and 1 otherwise

int get_sensor_values(

const char * kit, const char *sensor,

dbSensor::Info info,

dbSensor::Frame frame, bdiVec3d & v );

Supported Info types are POSITION, ORIENTATION, LIN_VELOCITY, ANG_VELOCITY, LIN_ACCELERATION, and ANG_ACCELERATION. Supported Frame types are GLOBAL and LOCAL.

Page 176: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

172

If the kit and sensor combination specified cannot be found, the function returns 0, otherwise 1 is returned and the vector passed in as the last parameter has the latest reading measured by the sensor.

Page 177: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

173

Listing 4 Sample get_sensor_values() usage {

bdiVec3d v;

if ( !get_sensor_values(

"sensors", // Kit Name ( Obtained from DB UI )

"gyro", // Equipment Name ( Obtained from DB UI ) dbSensor::POSITION, // Requested Information

dbSensor::GLOBAL, // Frame of Information

v ) ) return;

double x = v[ BDI_VEC_X ]; return;

}

14.6 Reading Interaction Forces The dbSimulation class (see include/dbSimulation.h) contains two useful functions for reading forces acting on equipment and shapes from contact relationships specified by the user at the Digital Biomechanics user interface. This section describes these functions in detail, highlighting important considerations.

14.6.1 Reading Forces on Equipment To read the force acting on a piece of equipment, use the function below: dbForce * dbSimulation::get_force(

const char *kit, const char *equipment,

bdiCLEForce *force )

If no contact relationship exists for the specified piece of equipment, NULL is returned. Otherwise the dbForce containing the last calculated value for the interaction force is returned. Force, torque, and point of application of the force can be extracted from the dbForce. Alternatively if you prefer to work with bdiCLEForce, the contents of the dbForce is also copied into the 3 function argument. Note that if the dbForce has zero forces and torques, the point of application is not valid.

An example of the function is shown below.

Listing 5 Sample get_force() usage bdiCLEForce tmp;

if ( !get_force( “left_foot”, “heel”, &tmp ) {

bdi_log_printf( BDI_LOG_INFO,

“Unable to get force for kit \”left_foot\” and equipment \”heel\” \n” ); return;

Page 178: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

174

}

double fx = tmp.f_x;

double fy = tmp.f_y;

double fz = tmp.f_z;

double mag = sqrt( fx*fx + fy*fy + fz*fz );

Note that get_force returns values in the global reference frame. Reading Sensors discusses how to convert force between reference frames.

14.6.2 Reading All Forces on a Link The simulation allocates a bdiCLEForce structure (see include/bdiCLSimulation.h) for every link in the character’s skeleton. At simulation runtime all forces acting on a link are accumulated in these structures. The name of this structure is ef_linkname (for example, ef_body, ef_uleg_l, and so forth ). Because these classes are automatically added in your simulation’s base class, you can simply refer to these structures in the simulation’s customization class. Listing 6 shows an example of this.

Listing 6 Accessing total force on a link by reading the bdiCLEForce link struct // Create and initialize a bdiCLEForce struct

bdiCLEForce tmp; memset( &tmp, 0, sizeof( bdiCLEForce ) );

// Copy the value of the eforce struct for the body to the tmp variable eforce_sum( &ef_body, &tmp, &tmp );

double fx = tmp.f_x; double fy = tmp.f_y;

double fz = tmp.f_z;

Whenever possible, use this method for reading forces on links since it is not affected if equipment is removed from the character.

14.7 Recommended Best Practices • Never use static function variables to maintain internal controller state. Static variables make

it impossible for you to correctly restore the full state of your controller. If you need to keep information for later retrieval or calculations, add variables holding this information as described in the section Creating a Custom Controller.

• Try to isolate the controllers you write. It can be frustrating to discover that changes made to one controller break another previously-working controller. A good practice is to add a prefix to all functions used by a controller to make it clear who is using them. For example a running controller might have functions called: run2d_do_control();

run2d_estimate_forward_speed(); run2d_ankle_control()

It can also be useful to group controller variables in controller-specific structures.

Page 179: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

175

3

3D window 18, 45, 46, 93, 94, 98

A

adjust inertial values 80

B

ball joints 132 BDI Plot 15, 16, 17, 19, 23, 28, 35, 36, 76, 84, 119,

120, 121, 122, 126, 127, 167, 170 BDIPlot

phase plot 119

C

camera movers 55 camera settings 51, 55, 60, 61, 62, 63 Camera Window 10, 12, 19, 54 Character Settings 70, 91 check_dt 130 check_time 130 collision property 48, 92, 95, 97, 98, 147, 154 COM offset 73, 80, 81 Commands 27, 74, 75, 79, 112, 113, 114, 131, 137 Contact Objects 70 Contact Pair 44, 45, 46, 47, 48, 92, 93, 94, 95, 96,

97, 98, 99, 147 contact pieces 45, 46, 47, 48, 92, 93, 94, 95, 96, 97,

98 contact points 23, 40, 41, 42, 43, 146, 160 control_time 130 Crumb 86, 99, 100 custom control code 164, 165, 169 custom static equipment 82

D

data window 122

default camera 50, 51, 55, 63, 64 Deflate 21 drag 24, 60, 62, 102, 104, 106 Draw Contact Objects 73 Draw Force 86, 99, 100 dynamic equipment 70, 129, 146

E

Editing a Group 77 Enable Settings 70, 91 end state 17, 115 enter simulation mode 107 external forces 70, 107, 136

F

fly 15, 58, 60, 61 focal distance 35, 58 Frame dt 21 Frame Size 21 Frames Recorded 22

G

Geometry 18 goal file 17, 76, 114, 137 goal_dt 114, 130 gravity 84, 107, 133, 134, 136 group 27, 69, 75, 76, 77, 78, 108, 109, 110, 111,

167, 173 Group Manager 76, 77, 110 groups file 76

I

Installation 9, 126

Page 180: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

176

J

joint 24, 53, 56, 71, 72, 73, 81, 100, 101, 102, 103, 104, 105, 107, 112, 129, 131, 132, 133, 134, 135, 136, 137, 145, 147, 169

JPEG 21

L

limits 52, 100, 114, 129, 135 Load Configuration 76 Log Window 10, 12, 19 look at 62, 125, 146 Lspring_Ldamper 98, 147, 148, 153, 154, 155

M

mass properties 7, 17, 72, 73, 79, 80, 113, 129, 132, 133, 145, 147

matlab 127

N

New Character 71 New Equipment Entry 41, 79, 83 New Equipment Kit 41, 79, 83 new scenario 18, 19, 37, 65, 67, 68 New Vector Property 43 NLspring_NLdamper 98, 147, 150, 154

O

orientation 12, 26, 51, 52, 58, 79, 146, 169, 170

P

parent link 79 plant_dt 108, 130 playback controls 126 Playback Mode 14, 15, 19, 20, 30, 33, 117, 118,

119 Playback Offsets 33

pose 11, 14, 23, 24, 25, 65, 86, 87, 91, 100, 101, 103, 104, 105, 106, 160

prop 26, 45, 48, 65, 70, 71, 87, 88, 93, 96, 100, 106 Prop Settings 70, 91

R

record_dt 113, 118, 130 recording a variable 17, 23, 69, 76, 83, 113, 117,

118, 130, 170 Remove Files 22 Reset 22, 55

S

Save Configuration 28, 76, 79 Scenario Explorer 10, 11, 23, 27, 29, 31, 33, 36,

41, 44, 45, 46, 47, 65, 66, 68, 71, 91, 92, 93, 94, 105, 108, 113, 115, 130

scripts 131, 144 sensor 83, 84, 85, 130, 170, 171, 172 servo_dt 130 servos 129, 135 Setup Mode 14, 19, 30, 31, 65, 115, 118 Show Scenario 70, 118 simulation commands 107, 112 Simulation Mode 14, 15, 19, 28, 32, 76, 107, 109,

115 static equipment 17, 79, 146 suspension 7, 79, 137, 146

T

TIFF 20, 21, 22 Topology 72, 73, 91, 108

V

variable list 37, 125 Variable View Tab 74, 75 vector property 43, 48 vector type 98 Visibility Settings 33, 69, 91 visual material 70, 88, 91

Page 181: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

177

W

walking 13, 65, 129, 159 Window Menu 18, 118, 122

Z

zero configuration 132

Page 182: Digital Biomechanics 1.0 User Guidecga/bdi/Digital_Biomechanics.pdf · Digital Biomechanics 1.0 User Guide Digital Biomechanics Software License Agreement This is a legally binding

Digital Biomechanics 1.0 User Guide

178

515 Massachusetts Avenue, Cambridge MA 02139 USA 617-868-5600 www.BostonDynamics.com