How to load a robot from URDF in the C++ interface?

Post Reply
DanielSJohnson
Posts: 4
Joined: Wed Jan 18, 2023 2:49 pm

How to load a robot from URDF in the C++ interface?

Post by DanielSJohnson »

HI all, I know this is a basic question so thank you for your patience with me.

I have a piece of python code using pyBullet for a robotics application. I am now looking to convert that code into C++ and switch out pyBullet for the C++ bullet3 interface. Im afraid in doing this i've fallen at the first hurdle and can't figure out how to load my urdf file into the world.

I've checked the manual, but all it has to say on the matter is:
Note that btMultiBody is introduced in the Bullet Physics SDK fairly recently, and is still work-in-progress. In this document, only the maximal coordinates based btRigidBody and btTypedConstraints is discussed. In a future revision, a chapter about btMultiBody will be added. For now, if you are interested in btMultiBody, please see the example browser and its source code in examples/MultiBody and examples/ImportURDF.
I've looked at the cpp files for the multibody examples and the files in \examples\Importers\ImportURDFDemo, but I'm struggling to understand what I'm seeing. Is there any place with up to date guidance on how to do this? When i try searching online I just get guidance for pyBullet, which is significantly more straightforward. Given than in pyBullet this is done with a single line, I had assumed that this would be similarly straightforward in C++ but I am not finding this to be the case.

Any guidance on what I should do or where I could find further reading would be very gratefully received!
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: How to load a robot from URDF in the C++ interface?

Post by Erwin Coumans »

see HelloBulletRobotics.cpp and use cmake to build projects:

https://github.com/bulletphysics/bullet ... tSimulator
Post Reply