Last week I manage to get a 3d model of InMoov taking the position in synch of my InMoov. So let me explain how I did it

I start with the VinMoov model that Gareth post some time ago. Unfortunatly, I did not manage to be able to move it's armature (or did not found how to do). So I try something else

in Blender, I disasemble the VinMoov and saved each robot part that represent my DHLink in IK individually. I modify the part slightly so the origin of the part (rotation point) is at 0,0,0. I then export the part using OGRExml exporter.

Then, in the jMonkeyEngine SDK, I import the files exported from blender. By default, the SDK create the Assets folder inside it's own working folder. But I need to have the asset inside MRL environment. I follow those instruction to set the asset folder in the root directory of myrobotlab

https://jmonkeyengine.github.io/wiki/jme3/advanced/asset_manager.html#a…

Now I can modify the 3d models that will be use in MRL.

So I import the blender model to the MRL Assets folder. Unfortunatly, the material in the blender file did not import well, so I need to fix it

  1. I convert the .scene file to jme binary (.j3o) by right clicking on the .scene file
  2. I right click on the .j3o file and select edit in SceneComposer
  3. in the SceneExplorer Window, I expand the items until I see the Material set on the 3d object and select it
  4. In the Properties window, I change Material to an existing Material or create a new default one. The defautl material is white so I was fine with it
  5. I then it SaveAll to save the j3o object
  6. I repeat those step for all the 3d model I use end then I was done with jmeSDK

Back in Eclipse, I create a class that extends JME SimpleApp (https://github.com/MyRobotLab/myrobotlab/blob/develop/src/org/myrobotla…) just like we will do in jmeSDK. That class will render 3d model and updates their position. Some thing noteworthy to said to have it work in MRL

  • We need to tell him where to look for the 3d files since the assets folder are not at the default location. this is done with assetManager.registerLocator("inmoov/jm3/assets", FileLocator.class) command
  • SimpleApp need that we don't modify items from another thread. So item setting and updating must be done inside the simpleInitApp() and simpleUpdate(float) methods. Otherwise jmonkey will crash

the class also have 

addPart() -> use to set the 3d model in position. each part create a Node, place the 3d model in it, add that node to a parent node with a position relative to the parent node and set an initial rotation.

updatePosition(IKData) will update the rotation of the 3d model. IKData is a class that output by the servo (ServoEvent) that contain the name and position of the servo and is output every time a servo position change.

Acapulco Rolf

6 years 6 months ago

Great post Calamity
 
Following your lead, JMonkey InMoov legs and feet are now available here ready to be incorportated into the VinMoov model
 
Bartcam's InMoov legs and feet have been used to create the VInMoov model leg and feet parts by way of Blender and the JMonkey IDE 
 
The parts have been zipped here in a JMonkey (version 3.1.0) project export
 
You may want to make some adjustments to these leg parts in Blender to set the rotation point of the parts to (0,0,0)
 
More parts to come...