2 ms·
Ah. Very cool. Are you computing center of mass / moment of inertia yourself, or using a 3rd party library to do it? PhysX is free, and I believe it can do t
by palish 18y ago
Ah. Very cool.
Are you computing center of mass / moment of inertia yourself, or using a 3rd party library to do it? PhysX is free, and I believe it can do those calculations for you fairly automatically. (In PhysX, a 'scene' is composed of 'actors', and each actor is described by a set of shape descriptors. A shape descriptor can represent a box, a sphere, a capsule, a convex hull, etc. So a laptop actor could crudely be approximated with two box shape descriptors (one for the screen, one for the body) connected by a joint. Given those shape descriptors, the library calculates the actor's center of mass / moment of inertia / etc. If your CAD software simply exports a list of polygons, you'll need to decompose those into a set of convex hulls using convex hull decomposition techniques: http://codesuppository.blogspot.com/2006/04/approximate-convex-decomposition.html http://codesuppository.blogspot.com/2006/04/approximate-conv... ) You also might have better luck running dynamics simulations with PhysX than with ODE. It comes with a large number of code examples to get you started: http://developer.nvidia.com/object/physx_downloads.html http://developer.nvidia.com/object/physx_downloads.html
- tlb 18y agoI use a very simple and exact O(N) algorithm to calculate mass properties of polyhedrons without computing convex hulls or anything: http://www.cs.berkeley.edu/~jfc/mirtich/massProps.html http://www.cs.berkeley.edu/~jfc/mirtich/massProps.html Maybe 80 LOC. I'm not sure why anything more complex is needed. PhysX does seem promising.
- palish 18y agoYeah, that works. I mentioned computing convex hulls because I wasn't sure whether your CAD program exports "manifold" meshes, that is, closed polygonal meshes where each edge is connected to exactly two faces. When a mesh is manifold, it is possible to compute whether a point in space lies within or outside of the mesh, for example. It is also possible to compute the mesh's mass properties. In the video game industry, artists create models with techniques that are much less precise than CAD techniques, and so non-manifold meshes are very common, which makes them difficult to analyze in physical ways. The solution to that problem is to decompose the mesh into a set of convex hulls, then analyze the convex hulls. The other reason I mentioned convex hull computation is because PhysX can only simulate dynamic actors that are composed of boxes, spheres, capsules, and convex hulls, IIRC. Arbitrary polygon meshes aren't supported for dynamic actors, because they are very difficult to simulate in realtime. So if you wanted to use PhysX for dynamics simulations, you would probably need to decompose your model into a set of convex hulls. Good luck -- if you need any assistance with PhysX, feel free to contact me at shawnpresser@gmail.com.
- danbmil99 18y ago"You also might have better luck running dynamics simulations with PhysX than with ODE." I worked on the simulator at Anybots, and I'm pretty much convinced a different physics engine isn't going to magically make things better (in terms of using simulations to predict real robot behavior). The problem is more about getting every little physical detail of the actual robot -- and its interactions with the environment -- into the model. The particulars of how collision, joint constraints, and dynamics are numerically computed isn't what makes the problem really hard.
- palish 18y agoYeah, after giving it some thought, it would be very tough to repurpose a realtime physics simulator like PhysX or ODE to be useful to Anybots. But that doesn't necessarily mean that it isn't practical to create a simulator suited for rapid prototyping of robots. (I'm just brainstorming ideas in the rest of this post; I'm not sure whether they'll work, but it's a fun problem to think about.) Perhaps it would be useful to write your own simulator that incorporates data about how the components of the robot behave in the real world, to get a more accurate simulation. By that I mean, the problem is that the robot model has so much complexity that it's difficult to simulate accurately. So instead of creating a mathematical model for how a compressed-air actuator behaves, for example, gather real-world data about how it actually behaves in the robot, then incorporate that data into the simulator. I mean, if the robot is walking slowly on a flat surface, then its individual components behave in the same ways each time the robot takes a step forward, right? Therefore it seems like the behavior of the whole robot can be reproduced and predicted in a simulator, since the behavior of each component is known (under controlled conditions, like when the robot is walking slowly). Brute force the problem by using large amounts of real-world data, is what I'm getting at.
- danbmil99 18y agoIt's not that PhysX or ODE aren't good enough, it's that they only solve part of the problem. We did do some empirical analysis to get the pneumatic models. "Brute force the problem by using large amounts of real-world data, is what I'm getting at." Absolutely, that is Trevor's viewpoint, and I agree. Turns out to be somewhat difficult in practice. It's hard to even know what all the parameters should be, much less do all the work necessary to tune them. And all the while, the robot itself is changing. Joints get loose; servos get replaced. It's a constant battle. There is a feeling among hard-core robotics folks that this level of simulation is either impossible or not worth the trouble. I tend to disagree. I think we got pretty far with the Anybots simulator; we did manage to evolve a neural network that balances on the simulator, and also balances the real robot. It's definitely a 'hard' problem to get a simulator good enough to be usefully predictive.