.. _tools-motion-task-api: Motion task API +++++++++++++++ :ref:`Overview ` | API .. seealso:: - :ref:`naoqi-motion` ------------ Method list ----------- .. cpp:class:: ALMotionProxy * :cpp:func:`ALMotionProxy::getTaskList` * :cpp:func:`ALMotionProxy::areResourcesAvailable` * :cpp:func:`ALMotionProxy::killTask` * :cpp:func:`ALMotionProxy::killTasksUsingResources` * :cpp:func:`ALMotionProxy::killWalk` * :cpp:func:`ALMotionProxy::killAll` .. cpp:function:: AL::ALValue ALMotionProxy::getTaskList() Gets an ALValue structure describing the tasks in the Task List :return: An ALValue containing an ALValue for each task. The inner ALValue contains: Name, MotionID :download:`almotion_gettasklist.cpp ` .. literalinclude:: /samples/cpp/almotion/almotion_gettasklist.cpp :language: cpp :download:`almotion_gettasklist.py ` .. literalinclude:: /samples/python/almotion/almotion_gettasklist.py :language: py .. cpp:function:: bool ALMotionProxy::areResourcesAvailable(const std::vector& resourceNames) Returns true if all the desired resources are available. Only motion API's' blocking call takes resources. :param resourceNames: A vector of resource names such as joints. Use ``getJointNames("Body")`` to get the list of the available joints for your robot. :return: True if the resources are available :download:`almotion_areresourcesavailable.cpp ` .. literalinclude:: /samples/cpp/almotion/almotion_areresourcesavailable.cpp :language: cpp :download:`almotion_areresourcesavailable.py ` .. literalinclude:: /samples/python/almotion/almotion_areresourcesavailable.py :language: py .. cpp:function:: bool ALMotionProxy::killTask(const int& motionTaskID) Kills a motion task. :param motionTaskID: TaskID of the motion task you want to kill. :return: Return true if the specified motionTaskId has been killed. :download:`almotion_killtask.cpp ` .. literalinclude:: /samples/cpp/almotion/almotion_killtask.cpp :language: cpp :download:`almotion_killtask.py ` .. literalinclude:: /samples/python/almotion/almotion_killtask.py :language: py .. cpp:function:: void ALMotionProxy::killTasksUsingResources(const std::vector& resourceNames) Kills all tasks that use any of the resources given. Only motion API's' blocking call takes resources and can be killed. Use ``getJointNames("Body")`` to get the list of the available joints for your robot. :param resourceNames: A vector of resource joint names :download:`almotion_killtasksusingresources.cpp ` .. literalinclude:: /samples/cpp/almotion/almotion_killtasksusingresources.cpp :language: cpp :download:`almotion_killtasksusingresources.py ` .. literalinclude:: /samples/python/almotion/almotion_killtasksusingresources.py :language: py .. cpp:function:: void ALMotionProxy::killWalk() Emergency Stop on Walk task: This method will end the walk task brutally, without attempting to return to a balanced state. If NAO has one foot in the air, he could easily fall. :download:`almotion_killwalk.cpp ` .. literalinclude:: /samples/cpp/almotion/almotion_killwalk.cpp :language: cpp :download:`almotion_killwalk.py ` .. literalinclude:: /samples/python/almotion/almotion_killwalk.py :language: py .. cpp:function:: void ALMotionProxy::killAll() Kills all tasks. :download:`almotion_killall.cpp ` .. literalinclude:: /samples/cpp/almotion/almotion_killall.cpp :language: cpp :download:`almotion_killall.py ` .. literalinclude:: /samples/python/almotion/almotion_killall.py :language: py