ReinforcementLearning.jl icon indicating copy to clipboard operation
ReinforcementLearning.jl copied to clipboard

bullet3 environment

Open findmyway opened this issue 4 years ago • 3 comments

https://github.com/bulletphysics/bullet3 See also here

findmyway avatar Aug 17 '19 15:08 findmyway

How difficult is this anticipated to be? Are we essentially looking at a rewrite of PyBullet in Julia? We're porting a MuJoCo model to Bullet right now because our lab wants to move away from proprietary environments, so we've been fiddling with PyBullet internals. I'd personally love to ditch Python altogether and move all my research code to Julia, rather than dealing with PyCall.

I could take a look after ICML deadline, but am a bit worried, in typical Python fashion, that the code is going to be massive and near-impossible for a newcomer to understand.

aterenin avatar Jan 24 '20 14:01 aterenin

I do not expect this to be particularly difficult, but I think it would be quite a bit of work. I have not looked at Bullet for a while but maybe @goretkin can tell something about his experience writing https://github.com/goretkin/Bullet.jl.

jbrea avatar Jan 24 '20 17:01 jbrea

I was going to write this out as a comment, but then thought this information might be useful to anyone else stumbling upon that repository, so I added something to the README:

This package illustrates two different methods of interfacing with Bullet. There is the core physics code written afaik entirely in C++, and a command processor (running in its own POSIX process) that handles a special-made protocol (which could be over shared memory, or the network), and then there's C code for sending/receiving command messages. This is the way that pybullet works. It's C code that uses the Python C API to expose a Python interface to the C code for sending/receive command messages.

There are aspects of the C++ code that are not exposed via the command processor (after all, it's supposed to be a sort of abstraction over at least some parts of the specific engine implementation), and this package tries to demonstrate how to use Cxx.jl for that purpose.

Note that pybullet, taken to mean what I described above, does not do any physics calculation, and goretkin/Bullet.jl roughly rewrites at least part of what resembles PyBullet. Except that it's a bit better, because our ecosystem has some packages like ColorTypes.jl, Rotations.jl, GeometryTypes.jl that aim to be used in interfaces. So Bullet.jl tries to be fancy by taking a Bullet C API function like e.g. setOrientation(Float x, Float y, Float z, Float w) and turn it into setOrientation(r::Rotation) and then you can use whatever parameterization of rotation (quaternion, rpy, ...) you'd like.

I think with a significant but not too significant polishing to that Bullet.jl package, we could have a feature-complete (as far as pybullet goes... the Cxx stuff seems to still not be extremely reliable across Julia versions, and definitely not across Bullet versions, but people usually just use pybullet) interface to Bullet. Please try the package and run the tests. I haven't done any testing except on my machine, so the feedback (and pull requests) would be appreciated.

goretkin avatar Jan 24 '20 17:01 goretkin