why are importers in the examples directory?

Post Reply
keithmgould
Posts: 12
Joined: Thu May 31, 2018 5:21 pm

why are importers in the examples directory?

Post by keithmgould »

Trying to get a sense of the cpp code layout, and was surprised to find some things in the examples directory that did not feel like examples.

1. the Importers, such as URDF importers.
2. pyBullet.

Can someone please help me understand the nature of the examples directory? Or should things be moved out? Asking because I'd be happy to help with a PR if some code reorganization is in order.

As a specific example, it looks like the actual URDF parser is here:

https://github.com/bulletphysics/bullet ... Parser.cpp
mnaveau
Posts: 5
Joined: Tue Jan 15, 2019 4:11 pm

Re: why are importers in the examples directory?

Post by mnaveau »

I am also puzzled by this choice. I installed bullet from the apt repositories and I cannot find a way to use this parser.
Though it would seem to be a crucial tool to be included in the main API (which is present in the python API by the way).
Must I extract the code of the URDF parser from the examples to actually use it?
That seems overkill.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: why are importers in the examples directory?

Post by Erwin Coumans »

Good point. Python bindings and URDF import is not really part of the core SDK and it has been under heavy development. Our primary users are using Python nowadays, so the Python API is where the focus is at the moment. At some state, I'll move the files into a final 'BulletRobotics' library under 'src' and move PyBullet into a separate repository. The recommended way to install PyBullet is "pip install pybullet".

I could have developed this in a separate repository from the start, but since there isn't a large development 'team', it is more convenient to keep all in a single repository. The dependencies are kept low, so that the URDF loader parts can be re-used easier, as in an example of the BulletExampleBrowser.

Note that when using premake or cmake, there is a 'BulletRobotics' library, that includes the URDF import etc. The CMakeList and premake4.lua is under Bullet/Extras/BulletRobotics. Its API is more high-level, like PyBullet. The C-API for this is under

bullet3\examples\SharedMemory\PhysicsClientC_API.h
bullet3\examples\SharedMemory\b3RobotSimulatorClientAPI_NoGUI.h

Of course, you can also directly use the URDF importer, as shown in the BulletExampleBrowser target.
mnaveau
Posts: 5
Joined: Tue Jan 15, 2019 4:11 pm

Re: why are importers in the examples directory?

Post by mnaveau »

I understand your point.
Though I am using bullet the same way as in the hello world example:
https://github.com/bulletphysics/bullet ... oWorld.cpp
I copied the file and build it separately.

My point is to use Bullet without the shared memory to gain computation time.
The final goal is to have the fastest implementation possible to do machine learning.

My problem now is that I cannot find the header of the urdf parser anywhere in the standard install.
With pybullet they are embedded in the pybullet.so.
And the ''' #include "../Importers/ImportURDFDemo/ImportURDFSetup.h" ''' does not exist in the include files from apt nor pip.

Is there a way to install bullet including the header in the examples?
mnaveau
Posts: 5
Joined: Tue Jan 15, 2019 4:11 pm

Re: why are importers in the examples directory?

Post by mnaveau »

Dear all,

After further investigation, I realised that the apt vesrion is not up to date on 14.04, which make sense.
I downloaded the bullet repos and compiled from source and I now see the bulletRobotics.so

Here is a list of packaging problems I could notice. (I openned an issue on github!)
- In the CMakelist.txt you lack the installation of such header in include/bullet/bulletRobotics.
- the bullet.pc do not register the -lBulletRobotics either...

The pull request is visible here:
https://github.com/bulletphysics/bullet3/pull/2063
The issue is visible here:
https://github.com/bulletphysics/bullet3/issues/2061
Post Reply