import logging; logger = logging.getLogger("morse." + __name__)

import morse.core.sensor

from morse.core import blenderapi
from morse.core.services import service, async_service
from morse.core import status
from morse.helpers.components import add_data, add_property


class Boatvelocity(morse.core.sensor.Sensor):
    _name = "velocity"
    _short_desc = "Measure the velocity of an object"

    add_data('velocity', [], 'Vector', 'Velocity')

    def __init__(self, obj, parent=None):
        logger.info("%s initialization" % obj.name)
        morse.core.sensor.Sensor.__init__(self, obj, parent)
        logger.info('Component initialized')

    def default_action(self):

        self.local_data['velocity'] = self.robot_parent._v
