.. _alredballtracker-api: ALRedBallTracker API ==================== :ref:`Overview ` | ALRedBallTracker API | :ref:`alfacetracker-api` | :ref:`trackers-sample` Namespace : **AL** .. code-block:: cpp #include Method list ----------- .. cpp:class:: ALRedBallProxy * Methods: * :cpp:func:`ALRedBallTrackerProxy::getPosition` * :cpp:func:`ALRedBallTrackerProxy::isActive` * :cpp:func:`ALRedBallTrackerProxy::isNewData` * :cpp:func:`ALRedBallTrackerProxy::setWholeBodyOn` * :cpp:func:`ALRedBallTrackerProxy::startTracker` * :cpp:func:`ALRedBallTrackerProxy::stopTracker` .. seealso:: * :ref:`Methods inherited from ALModule ` Methods ------- .. cpp:function:: std::vector ALRedBallTrackerProxy::getPosition() Returns the [x, y, z] position of the red ball in SPACE_TORSO. This is done assuming an average red ball size (diameter: 0.06 m), so it might not be very accurate. :return: An Array of float containing the red ball position [x, y, z]. .. cpp:function:: bool ALRedBallTrackerProxy::isActive() Return true if the red Ball Tracker is running. :return: true if the red Ball Tracker is running. .. cpp:function:: bool ALRedBallTrackerProxy::isNewData() Return true if a new Red Ball was detected since the last getPosition(). :return: true if a new Red Ball was detected since the last getPosition(). .. cpp:function:: void ALRedBallTrackerProxy::setWholeBodyOn(const bool& wholeBodyOn) If true, the tracking will be through a Whole Body Process. :param wholeBodyOn: The whole Body state .. cpp:function:: void ALRedBallTrackerProxy::startTracker() Start the tracker by Subscribing to Event redBallDetected from ALRedBallDetection module. Then Wait Event redBallDetected from ALRedBallDetection module. And finally send information to motion for head tracking. NOTE : Stiffness of Head must be set to 1.0 to move! .. cpp:function:: void ALRedBallTrackerProxy::stopTracker() Stop the tracker by Unsubscribing to Event redBallDetected from ALRedBallDetection module.