.. _tools-general-api: General tools API +++++++++++++++++ :ref:`Overview ` | API .. seealso:: - :ref:`naoqi-motion` ------------ Method list ----------- .. cpp:class:: ALMotionProxy * :cpp:func:`ALMotionProxy::getJointNames` * :cpp:func:`ALMotionProxy::getSensorNames` * :cpp:func:`ALMotionProxy::getLimits` * :cpp:func:`ALMotionProxy::getRobotConfig` * :cpp:func:`ALMotionProxy::getSummary` * :cpp:func:`ALMotionProxy::getMass` * :cpp:func:`ALMotionProxy::getCOM` .. * :cpp:func:`ALMotionProxy::setMotionConfig` * :cpp:func:`ALMotionProxy::updateTrackerTarget` .. cpp:function:: std::vector ALMotionProxy::getJointNames(const std::string& name) Gets the names of all the joints in the collection. :param name: Name of a chain, "Body", "BodyJoints" or "BodyActuators". :return: Vector of strings, one for each joint in the collection :download:`almotion_getjointnames.cpp ` .. literalinclude:: /samples/cpp/almotion/almotion_getjointnames.cpp :language: cpp :download:`almotion_getjointnames.py ` .. literalinclude:: /samples/python/almotion/almotion_getjointnames.py :language: py .. cpp:function:: std::vector ALMotionProxy::getSensorNames() Gets the list of sensors supported on your robot. :return: Vector of sensor names :download:`almotion_getsensornames.cpp ` .. literalinclude:: /samples/cpp/almotion/almotion_getsensornames.cpp :language: cpp :download:`almotion_getsensornames.py ` .. literalinclude:: /samples/python/almotion/almotion_getsensornames.py :language: py .. cpp:function:: AL::ALValue ALMotionProxy::getLimits(const std::string& name) Get the minAngle (rad), maxAngle (rad), and maxVelocity (rad.s-1) for a given joint or actuator in the body. :param name: Name of a joint, chain, "Body", "BodyJoints" or "BodyActuators". :return: Array of ALValue arrays containing the minAngle, maxAngle and maxVelocity for all the joints specified. :download:`almotion_getlimits.cpp ` .. literalinclude:: /samples/cpp/almotion/almotion_getlimits.cpp :language: cpp :download:`almotion_getlimits.py ` .. literalinclude:: /samples/python/almotion/almotion_getlimits.py :language: py .. cpp:function:: AL::ALValue ALMotionProxy::getRobotConfig() Get the robot configuration. Get the minAngle (rad), maxAngle (rad), and maxVelocity (rad.s-1) for a given joint or actuator in the body. :return: ALValue arrays containing the robot parameter names and the robot parameter values. :download:`almotion_getrobotconfig.cpp ` .. literalinclude:: /samples/cpp/almotion/almotion_getrobotconfig.cpp :language: cpp :download:`almotion_getrobotconfig.py ` .. literalinclude:: /samples/python/almotion/almotion_getrobotconfig.py :language: py .. cpp:function:: std::string ALMotionProxy::getSummary() Returns a string representation of the Model's state :return: A formated string :download:`almotion_getsummary.cpp ` .. literalinclude:: /samples/cpp/almotion/almotion_getsummary.cpp :language: cpp :download:`almotion_getsummary.py ` .. literalinclude:: /samples/python/almotion/almotion_getsummary.py :language: py .. cpp:function:: float ALMotionProxy::getMass(const std::string& pName) Gets the mass of a joint, chain, "Body" or "BodyJoints". :param pName: Name of the body which we want the mass. "Body", "BodyJoints" and "Com" give the total mass of NAO. For the chain, it gives the total mass of the chain. :return: The mass in kg. :download:`almotion_getmass.cpp ` .. literalinclude:: /samples/cpp/almotion/almotion_getmass.cpp :language: cpp :download:`almotion_getmass.py ` .. literalinclude:: /samples/python/almotion/almotion_getmass.py :language: py .. cpp:function:: std::vector ALMotionProxy::getCOM( const std::string& pName, const int& pSpace, const bool& pUseSensorValues ) Gets the COM of a joint, chain, "Body" or "BodyJoints". :param pName: Name of the body which we want the mass. In chain name case, this function give the com of the chain. :param pSpace: Task space {SPACE_TORSO = 0, SPACE_WORLD = 1, SPACE_NAO = 2}. :param pUseSensorValues: If true, the sensor values will be used to determine the position. :return: The COM position (meter). :download:`almotion_getcom.cpp ` .. literalinclude:: /samples/cpp/almotion/almotion_getcom.cpp :language: cpp :download:`almotion_getcom.py ` .. literalinclude:: /samples/python/almotion/almotion_getcom.py :language: py .. .. cpp:function:: void ALMotionProxy::setMotionConfig(const AL::ALValue& config) Internal Use. :param config: Internal: An array of ALValues [i][0]: name, [i][1]: value .. cpp:function:: void ALMotionProxy::updateTrackerTarget( const float& pTargetPositionWy, const float& pTargetPositionWz, const int& pTimeSinceDetectionMs, const bool& pUseOfWholeBody ) Update the target to follow by the head of NAO. :param pTargetPositionWy: The target position wy in SPACE_NAO :param pTargetPositionWz: The target position wz in SPACE_NAO :param pTimeSinceDetectionMs: The time in Ms since the target was detected :param pUseOfWholeBody: If true, the target is follow in cartesian space by the Head with whole Body constraints.