|
After several years of simulator usage, I think that we all agree that USARSim physics is far from perfect. We have understood a lot of Karma parameters and we have found the correct scale for every unit used by Karma and Unreal Engine. We also know that tuning these parameters is not easy and sometimes it leads to unstable results. Much has been done regarding the world physics, but there's still space for improvement for what concerns robot physics.
I would like to point out that none of the publications that concern USARSim simulator (http://usarsim.sourceforge.net/ documents section) face directly the physics accuracy, that is how much the simulated robot physics emulates the real one. We all use phrases like "comparable to realty", "plausible results" and os on, but never give a quantitative measurement of the difference between real and simulated behavior.
Evaluating such a difference may be difficult, that's why, in my opinion, we should simplify the problem and ask ourselves what we really need. For example, a reasoning pattern could be (I'm not an expert so please forgive my over-simplification):
a) We need absolutely realistic physics:
Why?
What degree of error can we tolerate?
b) We are happy with a simplified physics:
Why?
What can be simplified and what should be realistic? Why?
How much can we simplify?
In this case physics realism is not a good measure of the simulation quality. How can we measure such quality?
Obviously I have no answer to these questions, however I think that the answer may vary from robot to robot. For example, wheeled robot can work "realistically" (what this means?) with a much stronger simplification than legged can.
I'm sure that there's plenty of space in this field for new publications :-)
Now, paying attention to not answer to any question, I will give only some suggestions to improve the visual realism.
Much has been said about this subject in the previous reports. You can refer to:
The Scale between Unreal world and Karma physics world
KSimParams, properties of the Virtual World
AIBO physics behavior at various scales
Time scale correction
Actually we use the following simulation parameters:
This is not the only good combination and there are also other parameters that can be modified. However it' really hard to tune them because so much depends on the hardware used. There's no way to tune them one for all. We will always struggle with them.
There are different things in the rigid body parameters of the robot that should be changed. All the physics objects that we simulate have a declaration, in the defaultproperties section of their script, that starts with:
Begin Object Class=KarmaParamsRBFull ...
This section fills a structure that contains many different physics parameters. Something should be added, something should be changed.
Fig.1 KActorGravScale compensates gravity for USARSim scale |
The inertia tensor is perhaps the harder parameter to set. If we simplify the shape of each robot part with a rectangular one, we can calculate the inertia tensor with these formulas (please correct me if I'm wrong):
Fig.2 Inertia tensor calculation |
Attention! Karma wants a mass normalized tensor! This means that you must divide all by M. Simply calculate Ix, Iy and Iz assuming M = 1.
A note about KMaxSpeed (from http://www.unrealwiki.com/wiki/Karma):
" This is fairly straightforward, and is the maximum allowed speed of any Karma actor. It's a bit low by default. The default is 2500. Making it higher will make the simulation more accurate, but if a Karma actor hits something going too fast, it could get lodged in it. (By exceeding MaxPenetration in a single update). In theory, you should be able to avoid all kinds of Karma craziness by limiting your maximum KMaxSpeed. Using the equation MaxPenetration per second = MaxPenetration/MaxTimeStep = 5/0.04 = 125 UU per second, you could set KMaxSpeed = 125 and possibly stop some items from being lodged in other items. "
KFriction, KCOMOffset and KInertiaTensor are some of the parameters that can be tuned to achieve a "better" simulation. I put them also in the previous section because their values are often wrong in USARSim, so it's more a correction than a tuning :-)
NewSpeed = - KRestitution * OldSpeed
Another important thing is to verify the collision primitives of the robot for self collisions. Remember that jointed parts will not collide.
Another word about two objects that becomes lodged (http://wiki.beyondunreal.com):
" Karma does not automatically "fix" an object that becomes lodged in another object because it doesn't know whether that's what you wanted or not. "
Actual USARSim P2AT physics:
P2AT falling from stairs
P2AT climbing wall
P2AT falling from a wall
P2AT walking on step field
P2AT falling on ramp
New P2AT physics:
P2AT falling from stairs
P2AT climbing wall 1
P2AT climbing wall 2
P2AT falling from a wall
P2AT walking on step field
P2AT falling on ramp