Up:[[Tutorial]]    Previous:[[Grasping Function]]     Next: [[Wheeled mobile robot]]  

----

#contents

* Control of humanoid agent by BVH file [#r2c7c34b]

※This tutorial is valid for later than SIGVerse v2.1.0


** Download sample programs [#k63d8bb9]


Make working directory.

 $ cd ~
 $ mkdir readBVH
 $ cd readBVH

Please download the programs from below link.

https://github.com/SIGVerse/samples/tree/master/controllers/AgentControllerByBVHfile

>You can download all sample controllers from [[this page>https://github.com/SIGVerse/samples]]. 

The package includes the following files.

- Controller
-- srcs/BVH.cpp
-- srcs/BVH.h
-- srcs/BVHController.cpp
-- srcs/BVHController.h
- World file
-- BVHWorld.xml
- Agent configuration file
-- Man-bvh.xml
- Shape model for the humanoid agent
-- bvh_man.x3d
- other
-- Makefile

** Compilation [#s8798c81]

 $ make

BVHController.so will be output.

*** Getting bvh file [#ac1a5058]

Put your favority bvh file on the current directory (~/readBVH). This tutorial uses Action_Kick_bvh.bvh provided by [[PV STUDIO>http://www.privatestudio.co.jp/down.htm]]

*** Configuration of world file [#a07173c4]

Specify the target bvh file in the world file

 $ emacs BVHWorld.xml

BVHWorld.xml
old
#highlight(xml:firstline[19]){{
 <!--specification of bvh file-->
        <set-attr-value name="BvhFile" value="./filename.bvh"/>
}}

new
#highlight(xml:firstline[19]){{
 <!--specification of bvh file-->
        <set-attr-value name="BvhFile" value="./Action_Kick_bvh.bvh"/>
}}

The path for the bvh file should be relative path from the directories to execute.


BVHWorld.xml

#highlight(xml){{
<?xml version="1.0" encoding="UTF-8"?>
 <world name="newworld">
 
 <!--Gravity-->
   <gravity x="0.0" y="-9.8" z="0.0"/> 
 
 <!--humanoid agent Man-nii-->
   <instanciate class="Man-bvh.xml"> 
 
 <!--Name of the agent--> 
         <set-attr-value name="name" value="man_000"/> 
 
 <!--C++ for the controller-->
         <set-attr-value name="language" value="c++"/> 
 
 <!--specification of controller file -->
         <set-attr-value name="implementation" value="./BVHController.so"/>
 
 <!--specification of BVH file-->
         <set-attr-value name="BvhFile" value="./Action_Kick_bvh.bvh"/> 
 
 <!--Set dynamics mode off-->
         <set-attr-value name="dynamics" value="false"/> 
 
 <!--position of the agent(x,y,z)-->
        <set-attr-value name="x" value="0.0"/>
        <set-attr-value name="y" value="60.0"/>
        <set-attr-value name="z" value="0.0"/> 
 
  </instanciate>
</world>
}}
#gist(sigverse-git/e53ded9d0f882fd716c4);


** Execution [#fcb6abdd]

 $ sigserver.sh -w ./BVHWorld.xml

You can see an avator agent is standing with its hands opened.

Push the start button to start the simulation. The bvh file will be read after the simulation start.

#ref(./motion_kick.PNG,40%)
The agent will perform kick motion.

** sample model [#z588d3da]

Joint names used in the sample model (bvh_man.x3d) is as shown in the following picture.
All of the joints is configured to rotate around x,y,z axis of local coordinate.

#ref(./joint_name.jpg)

** reference [#p7ab5310]
-[[Real animation software PV STUDIO>http://www.privatestudio.co.jp/down.htm]]

#highlight(end)

Up:[[Tutorial]]    Previous:[[Grasping Function]]     Next: [[Wheeled mobile robot]]  

#counter

Front page   Edit Diff Backup Upload Copy Rename Reload   New List of pages Search Recent changes   Help   RSS of recent changes