Simulating a revolute robot using btMultibody

Decker
Posts: 4
Joined: Sun Oct 13, 2019 9:28 pm

Simulating a revolute robot using btMultibody

Post by Decker »

For few that past few weeks, I've been trying to simulate the 'Kuka LWR' robot using 'btMultibody'. So, I peeked over at the examples, which implements an URDF loader and some kind of 'URDF2Bullet' converter. However, the whole example is a bit convoluted and I cannot get this thing working, altough it seems I am sticking pretty close to the example.

The 'basic' recipe, as I was able to deduct is basically this:
  • Create the btMultibody instance
  • Create the joints (in my case all joints are revolute joints)
  • Call 'finalizeMultiDof' on the multibody
  • Create the colliders for each link (^1)
  • Call 'forwardKinematics' and 'updateColllisionObjectWorldTransforms' with the results from 'updateCollisionObjectWorldTransforms'
  • Add the multibody and its colliders to the world
  • Create all render objects and sync the render objects position with the collider (which I cached from previous step) position

However, according to my own worktime tracker, I've spent ~90 hours trying to dismember and comprehend the example and get it to work with my very limited case, without luck.
I've verified, that all values passed to 'setupRevolute' are the same, also all values passed to 'setWorldTransform' when creating the collision shape match with the values in the example. Yet, I cannot get it to work.

So, I guess, my questions are:
  • Is my overall procedure correct?
  • Regarding (^1) is it mandatory to use btCompoundShape for these kind of applications? I will try it now, but didn't yet.
Usually I don't plead for help, but this project is getting me close to a breaking point. What is it, that I am doing wrong?
Decker
Posts: 4
Joined: Sun Oct 13, 2019 9:28 pm

Re: Simulating a revolute robot using btMultibody

Post by Decker »

For the grace of god. I finally managed to figure it out.

Apparently the procedure is correct. Regarding my question (^1): No, not at all. One can build everything up completely from compound shapes.

When the time comes, I'll release a blog post, showing a smaller/easier example, for people that are forced to use an in-house render engine.