Skip to content
Snippets Groups Projects
Commit a0b475a1 authored by p-kaiser's avatar p-kaiser
Browse files

SupportPolygon: Allow lazy stability index computation (without update)

git-svn-id: http://svn.code.sf.net/p/simox/code/trunk@781 042f3d55-54a8-47e9-b7fb-15903f145c44
parent 2859895a
No related branches found
No related tags found
No related merge requests found
......@@ -72,11 +72,13 @@ float SupportPolygon::getSquaredDistLine(Eigen::Vector2f &p, Eigen::Vector2f &pt
}
float SupportPolygon::getStabilityIndex(VirtualRobot::RobotNodeSetPtr rns)
float SupportPolygon::getStabilityIndex(VirtualRobot::RobotNodeSetPtr rns, bool update)
{
if (!rns)
return 0.0f;
updateSupportPolygon();
if (update)
updateSupportPolygon();
// check if com is outside support polygon
MathTools::ConvexHull2DPtr ch = getSupportPolygon2D();
......
......@@ -57,7 +57,7 @@ public:
1 means that the current 2D CoM lies at the center of the support polygon
0 means it is outside.
*/
float getStabilityIndex(RobotNodeSetPtr rns);
float getStabilityIndex(RobotNodeSetPtr rns, bool update=true);
SceneObjectSetPtr getContactModels();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment