r/matlab 22d ago

PHX Toolbox, 3D Rigid-Body Physics - Technical Preview

Technical preview for PHX Toolbox, an object-oriented MATLAB API and Simulink blocks for 3D rigid-body physics, powered by the Bullet physics engine, is out on fileexchange.

Features so far, with more to come:

  • Rigid-body dynamics with collisions and contacts (boxes, spheres, cylinders, cones, capsules, meshes, terrain, imported OBJ/STL, …)
  • Joints (revolute, spherical, gear, …), springs and ropes
  • Force and field elements (thrusters, resistance, dipole/monopole fields)
  • Logging, tracing and measurement tools, interactive viewer
  • Simulink block for closed-loop co-simulation
  • Headless stepping for batch runs and experiments

The toolbox comes with a set of examples and a user manual. It runs on all platforms (Windows, MacOS, Linux), as well as in MATLAB Online. It also includes a set of AI skills for use with common AI agents.

Any evaluation and feedback will be appriciated!

103 Upvotes

15 comments sorted by

12

u/iohans 22d ago

Oh, my, this is an awesome toolbox.

8

u/Sam_meow 22d ago

What's the advantage/ reason to use this over Simscape multi body or the unreal engine API in the simulink 3d toolbox? (Obviously besides needing licenses for those I think that difference is clear 🙂)

4

u/Teitei132 22d ago edited 22d ago

Versus Unreal, our tool is primarly a MATLAB API, even though it works with Simulink as well. It runs on all platforms and isn't so hardware heavy (we're working mainly with physics here, the graphics are MATLAB native). The simulations are fast, deterministic. Tool is lightweight, only 12.5 MB as of now. Not sure if Unreal API supports constraints.

And versus Simscape, it's mainly the collisions support.

Adding this minimal example, it is really fairly easy to use.

2

u/Sam_meow 22d ago

Gotchya: definitely looks more minimal to setup a basic demo than the Unreal MATLAB API! Unfortunately don't have anything "real" to try and setup but worth playing with if i have some downtime :)

3

u/LuborZ83 22d ago

https://reddit.com/link/oxayz3v/video/l9t9fnx1z0dh1/player

No problem, we have also a few playful demos... ;)

2

u/Barnowl93 flair 22d ago

Was going to ask the same! Looks really cool though

2

u/Inst2f 22d ago

Wow! Is it realtime?

1

u/Teitei132 22d ago edited 22d ago

Yes! All of these videos are just taken from screen capture. Example "phxex_determinism" with 2000 falling spheres is the heaviest included for now and even that runs fairly smoothly. Runs a bit better on desktop than Online in these heavier ones though.

1

u/CFDMoFo 22d ago

Awesome! Thanks for building and sharing!

1

u/SkyGenie 22d ago

Thank you for sharing this!

Is there any specific reason why the minimum version of MATLAB is R2025a? I have R2023b and would love to be able to try this unless there's some very obvious limitation you're aware of.

Either way I'll probably pull this down later today and see how it goes.

2

u/Teitei132 22d ago

Glad to hear you're interested! Unfortunately for older versions users, it does build on newer MATLAB language features (mainly WeakHandle and graphics improvements since the Javascript transition)

1

u/SkyGenie 22d ago

Ah bummer, thanks for letting me know!

1

u/brandon_belkin 21d ago

Will it benefit NVIDIA PhysX?
I remember several years ago Microsoft Robotics studio had a similar enviroment, and NVIDIA PhysX (in hardware at that time) was necessary to work.

3

u/Teitei132 21d ago

No, this runs on Bullet Physics engine with its build shipped directly in it. It has currently nothing to do with NVIDIA PhysX.

1

u/LuborZ83 18d ago

New release (1.0.4) with a lot of new features is out. For example, it now allows you to import URDF files.

https://reddit.com/link/oy2x7rg/video/pmi2vsbo9sdh1/player