NASA-Tensegrity-Robotics-Toolkit/NTRTsim — pull request #99 by brtietz (2014-11-18 20:48:14+00:00)
Title: MuscleNP

This is a big merge. Here's a summary:

Some important notes to start:

1) You'll need to rebuild bullet for this and do a clean build of your repository, as its much more stable with double precision. I'll make a separate thread where we can discuss that in more depth and I can post the results. Rebuilding also includes some additional modifications to tgDemoApplicaiton in the patching process that allow us to render the new strings properly and avoid a serious memory leak.

2) There have been some additional changes to the builder tools in tgUtil and tgSphereInfo that have global implications as well as some lower level changes that shouldn't be noticeable at a high level (btRigidBodies have been changed to btCollisionObjects). These need to be verified with unit tests (another forthcoming issue).

Now, what's all here?

1) Oops - I had some local merge issues and dragged along the Corde commits from before June. These are pretty harmless and boring (just a simple text printout at this point) so I'm not opposed to merging them. Actually merging in the full Corde branch will be more interesting.

2) I've gone through and dropped profiling information for btQuickProfiler in a few relevant places so I can see runtimes. We should consider adding the BT_NO_PROFILE flag to our cmake build so these can be turned off if that's desirable.

3) Within core:
a) muscleAnchor has become a much more fully featured class, as it has to store data for multiple types of anchors, yet still be the same object for rendering and other purposes. I'm open to making a base class and doing some casting if people prefer that to the booleans I'm using right now.
b) Muscle2P stores its data a little differently so that Muscle2P and MuscleNP can both be rendered by the same funcitons
c) Some fixes for the ground class
d) The world is equipped to handle bullet's ghost objects

4) For tgcreator:
a) Anything involving a rigid body has been changed slightly to accommodate storing a btCollisionObject instead and getting the rigid body with a cast in the getRigidBody() funciton
b) tgUtil's getQuaternionBetween function returns negative identity instead of the result of a random vector. @ryan1248 suggested this is insufficient for all cases, but I need to see the test it fails.
c) tgSphereInfo had a corrective sign change so the string actually appears on the outside of the sphere.

5) Finally MuscleNP and associated classes
a) MuscleNP is a child class of Muscle2P, since the controller interface is identical. The calculateAndApplyForce function is _a lot_ beefier, since it also has to handle all of the bullet contact information. This is split between four private functions, which I can explain in detail if you have questions - hopefully the documentation suffices.
b) tgMultiPointStringInfo constructs a tgLinearString with a MuscleNP.
c) There are two ghost object construction classes here as well. They are no longer used in this branch, but I believe DuCTT uses them in the DuCTT branch
d) The demo classes are in my dev folder: muscleNPTests (two in one with conditional compiles), muscleNPEnergy (almost an integration test), sphereFeet (repurposed superball), and tetraCollisions)

There are still a few cases where MuscleNP blows up, which mostly have to do with figuring out the correct order for new contacts, but they're not common in tensegrity applications. The methods used here have the potential to improve Corde's contact dynamics with some additional work, but runtime may need to be addressed in that case.