.. _control-joint-api: Joint control API +++++++++++++++++ :ref:`Overview ` | API | :ref:`Tutorial ` .. seealso:: - :ref:`naoqi-motion` ------------ Method list ----------- .. cpp:class:: ALMotionProxy * :cpp:func:`ALMotionProxy::setAngles` * :cpp:func:`ALMotionProxy::changeAngles` * :cpp:func:`ALMotionProxy::getAngles` * :cpp:func:`ALMotionProxy::angleInterpolation` * :cpp:func:`ALMotionProxy::angleInterpolationWithSpeed` * :cpp:func:`ALMotionProxy::angleInterpolationBezier` * :cpp:func:`ALMotionProxy::closeHand` * :cpp:func:`ALMotionProxy::openHand` .. cpp:function:: void ALMotionProxy::angleInterpolation( const AL::ALValue& names, const AL::ALValue& angleLists, const AL::ALValue& timeLists, const bool& isAbsolute ) Interpolates one or multiple joints to a target angle or along timed trajectories. This is a blocking call. :param names: Name or names of joints, chains, "Body", "BodyJoints" or "BodyActuators". :param angleLists: An angle, list of angles or list of list of angles in radians :param timeLists: A time, list of times or list of list of times in seconds :param isAbsolute: If true, the movement is described in absolute angles, else the angles are relative to the current angle. :download:`almotion_angleinterpolation.cpp ` .. literalinclude:: /samples/cpp/almotion/almotion_angleinterpolation.cpp :language: cpp :download:`almotion_angleinterpolation.py ` .. literalinclude:: /samples/python/almotion/almotion_angleinterpolation.py :language: py .. cpp:function:: void ALMotionProxy::angleInterpolationWithSpeed( const AL::ALValue& names, const AL::ALValue& targetAngles, const float& maxSpeedFraction ) Interpolates one or multiple joints to a target angle, using a fraction of max speed. Only one target angle is allowed for each joint. This is a blocking call. :param names: Name or names of joints, chains, "Body", "BodyJoints" or "BodyActuators". :param targetAngles: An angle, or list of angles in radians :param maxSpeedFraction: A fraction. :download:`almotion_angleinterpolationwithspeed.cpp ` .. literalinclude:: /samples/cpp/almotion/almotion_angleinterpolationwithspeed.cpp :language: cpp :download:`almotion_angleinterpolationwithspeed.py ` .. literalinclude:: /samples/python/almotion/almotion_angleinterpolationwithspeed.py :language: py .. cpp:function:: void ALMotionProxy::angleInterpolationBezier( const std::vector& jointNames, const AL::ALValue& times, const AL::ALValue& controlPoints ) Interpolates a sequence of timed angles for several motors using bezier control points. This is a blocking call. :param jointNames: A vector of joint names :param times: An ragged ALValue matrix of floats. Each line corresponding to a motor, and column element to a control point. :param controlPoints: An ALValue array of arrays each containing [float angle, Handle1, Handle2], where Handle is [int InterpolationType, float dAngle, float dTime] descibing the handle offsets relative to the angle and time of the point. The first bezier param describes the handle that controls the curve preceeding the point, the second describes the curve following the point. .. cpp:function:: void ALMotionProxy::setAngles( const AL::ALValue& names, const AL::ALValue& angles, const float& fractionMaxSpeed ) Sets angles. This is a non-blocking call. :param names: The name or names of joints, chains, "Body", "BodyJoints" or "BodyActuators". :param angles: One or more angles in radians :param fractionMaxSpeed: The fraction of maximum speed to use :download:`almotion_setangles.cpp ` .. literalinclude:: /samples/cpp/almotion/almotion_setangles.cpp :language: cpp :download:`almotion_setangles.py ` .. literalinclude:: /samples/python/almotion/almotion_setangles.py :language: py .. cpp:function:: void ALMotionProxy::changeAngles( const AL::ALValue& names, const AL::ALValue& changes, const float& fractionMaxSpeed ) Changes Angles. This is a non-blocking call. :param names: The name or names of joints, chains, "Body", "BodyJoints" or "BodyActuators". :param changes: One or more changes in radians :param fractionMaxSpeed: The fraction of maximum speed to use :download:`almotion_changeangles.cpp ` .. literalinclude:: /samples/cpp/almotion/almotion_changeangles.cpp :language: cpp :download:`almotion_changeangles.py ` .. literalinclude:: /samples/python/almotion/almotion_changeangles.py :language: py .. cpp:function:: std::vector ALMotionProxy::getAngles( const AL::ALValue& names, const bool& useSensors ) Gets the angles of the joints :param names: Names the joints, chains, "Body", "BodyJoints" or "BodyActuators". :param useSensors: If true, sensor angles will be returned :return: Joint angles in radians. :download:`almotion_getangles.cpp ` .. literalinclude:: /samples/cpp/almotion/almotion_getangles.cpp :language: cpp :download:`almotion_getangles.py ` .. literalinclude:: /samples/python/almotion/almotion_getangles.py :language: py .. cpp:function:: void ALMotionProxy::closeHand(const std::string& handName) Closes the hand, then cuts motor current to conserve energy. This is a blocking call. :param handName: The name of the hand. Could be: "RHand" or "LHand" :download:`almotion_closehand.cpp ` .. literalinclude:: /samples/cpp/almotion/almotion_closehand.cpp :language: cpp :download:`almotion_closehand.py ` .. literalinclude:: /samples/python/almotion/almotion_closehand.py :language: py .. cpp:function:: void ALMotionProxy::openHand(const std::string& handName) Opens the hand, then cuts motor current to conserve energy. This is a blocking call. :param handName: The name of the hand. Could be: "RHand or "LHand" :download:`almotion_openhand.cpp ` .. literalinclude:: /samples/cpp/almotion/almotion_openhand.cpp :language: cpp :download:`almotion_openhand.py ` .. literalinclude:: /samples/python/almotion/almotion_openhand.py :language: py