.. _control-wholebody-api: Whole Body control API ++++++++++++++++++++++ :ref:`Overview ` | API | :ref:`Tutorial ` .. seealso:: - :ref:`naoqi-motion` ------------ Method list ----------- .. cpp:class:: ALMotionProxy * :cpp:func:`ALMotionProxy::wbEnable` * :cpp:func:`ALMotionProxy::wbFootState` * :cpp:func:`ALMotionProxy::wbEnableBalanceConstraint` * :cpp:func:`ALMotionProxy::wbGoToBalance` * :cpp:func:`ALMotionProxy::wbEnableEffectorControl` * :cpp:func:`ALMotionProxy::wbSetEffectorControl` .. cpp:function:: void ALMotionProxy::wbEnable(const bool& isEnabled) User friendly Whole Body API: enables Whole Body Balancer. It's a Generalized Inverse Kinematics which deals with cartesian control, balance, redundancy and task priority. The main goal is to generate and stabilized consistent motions without precomputed trajectories and adapt nao's behaviour to the situation. The generalized inverse kinematic problem takes in account equality constraints (keep foot fix), inequality constraints (joint limits, balance, ...) and quadratic minimization (cartesian / articular desired trajectories). We solve each step a quadratic programming on the robot. :param isEnabled: Active / Disactive Whole Body Balancer. :download:`almotion_wbenable.cpp ` .. literalinclude:: /samples/cpp/almotion/almotion_wbenable.cpp :language: cpp :download:`almotion_wbenable.py ` .. literalinclude:: /samples/python/almotion/almotion_wbenable.py :language: py .. cpp:function:: void ALMotionProxy::wbFootState( const std::string& stateName, const std::string& supportLeg ) UserFriendly Whole Body API: set the foot state: fixed foot, constrained in a plane or free. :param stateName: Name of the foot state. "Fixed" set the foot fixed. "Plane" constrained the Foot in the plane. "Free" set the foot free. :param supportLeg: Name of the foot. "LLeg", "RLeg" or "Legs". :download:`almotion_wbfootstate.cpp ` .. literalinclude:: /samples/cpp/almotion/almotion_wbfootstate.cpp :language: cpp :download:`almotion_wbfootstate.py ` .. literalinclude:: /samples/python/almotion/almotion_wbfootstate.py :language: py .. cpp:function:: void ALMotionProxy::wbEnableBalanceConstraint( const bool& isEnable, const std::string& supportLeg ) UserFriendly Whole Body API: enable to keep balance in support polygon. :param isEnable: Enable NAO to keep balance. :param supportLeg: Name of the support leg: "Legs", "LLeg", "RLeg". :download:`almotion_wbenablebalanceconstraint.cpp ` .. literalinclude:: /samples/cpp/almotion/almotion_wbenablebalanceconstraint.cpp :language: cpp :download:`almotion_wbenablebalanceconstraint.py ` .. literalinclude:: /samples/python/almotion/almotion_wbenablebalanceconstraint.py :language: py .. cpp:function:: void ALMotionProxy::wbGoToBalance( const std::string& supportLeg, const float& duration ) Advanced Whole Body API: "Com" go to a desired support polygon. This is a blocking call. :param supportLeg: Name of the support leg: "Legs", "LLeg", "RLeg". :param duration: Time in seconds. :download:`almotion_wbgotobalance.cpp ` .. literalinclude:: /samples/cpp/almotion/almotion_wbgotobalance.cpp :language: cpp :download:`almotion_wbgotobalance.py ` .. literalinclude:: /samples/python/almotion/almotion_wbgotobalance.py :language: py .. cpp:function:: void ALMotionProxy::wbEnableEffectorControl( const std::string& effectorName, const bool& isEnabled ) UserFriendly Whole Body API: enable whole body cartesian control of an effector. :param effectorName: Name of the effector : "Head", "LArm" or "RArm". NAO goes to posture init. He manages his balance and keep foot fix. "Head" is controlled in rotation. "LArm" and "RArm" are controlled in position. :param isEnabled: Active / Disactive Effector Control. :download:`almotion_wbenableeffectorcontrol.cpp ` .. literalinclude:: /samples/cpp/almotion/almotion_wbenableeffectorcontrol.cpp :language: cpp :download:`almotion_wbenableeffectorcontrol.py ` .. literalinclude:: /samples/python/almotion/almotion_wbenableeffectorcontrol.py :language: py .. cpp:function:: void ALMotionProxy::wbSetEffectorControl( const std::string& effectorName, const AL::ALValue& targetCoordinate ) UserFriendly Whole Body API: set new target for controlled effector. This is a non-blocking call. :param effectorName: Name of the effector : "Head", "LArm" or "RArm". NAO goes to posture init. He manages his balance and keep foot fix. "Head" is controlled in rotation. "LArm" and "RArm" are controlled in position. :param targetCoordinate: "Head" is controlled in rotation (WX, WY, WZ). "LArm" and "RArm" are controlled in position (X, Y, Z). TargetCoordinate must be absolute and expressed in SPACE_NAO. If the desired position/orientation is unfeasible, target is resize to the nearest feasible motion. :download:`almotion_wbseteffectorcontrol.cpp ` .. literalinclude:: /samples/cpp/almotion/almotion_wbseteffectorcontrol.cpp :language: cpp :download:`almotion_wbseteffectorcontrol.py ` .. literalinclude:: /samples/python/almotion/almotion_wbseteffectorcontrol.py :language: py