示例#1
0
 def __init__(self, date = None):
     from morse.sensors._magnetometer import Magnetometer as Mag
     self._mag = Mag(os.path.join(MORSE_COMPONENTS, 'WMM.COF'))
     self._coord_conv = CoordinateConverter.instance()
     if date:
         self._date = date
     else:
         self._date = _decimal_date(datetime.date.today())
示例#2
0
 def __init__(self, date=None):
     from morse.sensors._magnetometer import Magnetometer as Mag
     self._mag = Mag(os.path.join(MORSE_COMPONENTS, 'WMM.COF'))
     self._coord_conv = CoordinateConverter.instance()
     if date:
         self._date = date
     else:
         self._date = _decimal_date(datetime.date.today())
示例#3
0
文件: gps.py 项目: zyh1994/morse
    def __init__(self, obj, parent=None):
        """ Constructor method.
            Receives the reference to the Blender object.
            The second parameter should be the name of the object's parent. """
        # Call the constructor of the parent class
        GPS.__init__(self, obj, parent)

        # Variables to store the previous LTP position
        self.pltp = None
        self.v = [0.0, 0.0, 0.0]

        self.coord_converter = CoordinateConverter.instance()
示例#4
0
文件: gps.py 项目: adegroote/morse
    def __init__(self, obj, parent=None):
        """ Constructor method.
            Receives the reference to the Blender object.
            The second parameter should be the name of the object's parent. """
        # Call the constructor of the parent class
        GPS.__init__(self, obj, parent)
        
        # Variables to store the previous LTP position
        self.pltp = None
        self.v = [0.0, 0.0, 0.0]

        self.coord_converter = CoordinateConverter.instance()
示例#5
0
    def __init__(self, obj, parent=None):
        """ Constructor method.
            Receives the reference to the Blender object.
            The second parameter should be the name of the object's parent. """
        # Call the constructor of the parent class
        GPS.__init__(self, obj, parent)

        ##copied from accelerometer
        # Variables to store the previous position
        self.ppx = 0.0
        self.ppy = 0.0
        self.ppz = 0.0
        # Variables to store the previous velocity
        self.pvx = 0.0
        self.pvy = 0.0
        self.pvz = 0.0
        # Make a new reference to the sensor position
        self.p = self.bge_object.position
        self.v = [0.0, 0.0, 0.0]  # Velocity
        self.pv = [0.0, 0.0, 0.0]  # Previous Velocity

        self.coord_converter = CoordinateConverter.instance()
示例#6
0
文件: gps.py 项目: HorvathJo/morse
    def __init__(self, obj, parent=None):
        """ Constructor method.
            Receives the reference to the Blender object.
            The second parameter should be the name of the object's parent. """
        # Call the constructor of the parent class
        GPS.__init__(self, obj, parent)
        
        ##copied from accelerometer
        # Variables to store the previous position
        self.ppx = 0.0
        self.ppy = 0.0
        self.ppz = 0.0
        # Variables to store the previous velocity
        self.pvx = 0.0
        self.pvy = 0.0
        self.pvz = 0.0
        # Make a new reference to the sensor position
        self.p = self.bge_object.position
        self.v = [0.0, 0.0, 0.0] # Velocity
        self.pv = [0.0, 0.0, 0.0] # Previous Velocity

        self.coord_converter = CoordinateConverter.instance()
示例#7
0
    def __init__(self, obj, parent=None):
        """ Constructor method.

        Receives the reference to the Blender object.
        The second parameter should be the name of the object's parent.
        """
        logger.info('%s initialization' % obj.name)
        # Call the constructor of the parent class
        morse.core.sensor.Sensor.__init__(self, obj, parent)

        has_physics = bool(self.robot_parent.bge_object.getPhysicsId())
        if self._type == 'Automatic':
            if has_physics:
                self._type = 'Velocity'
            else:
                self._type = 'Position'

        if self._type == 'Velocity' and not has_physics:
            logger.error("Invalid configuration : Velocity computation without "
                        "physics")
            return

        if self._type == 'Velocity':
            # make new references to the robot velocities and use those.
            self.robot_w = self.robot_parent.bge_object.localAngularVelocity
        else:
            # previous attitude euler angles as vector
            self.pp = copy(self.position_3d)

        if self._use_angle_against_north:
            self._coord_converter = CoordinateConverter.instance()

        # imu2body will transform a vector from imu frame to body frame
        self.imu2body = self.sensor_to_robot_position_3d()
        # rotate vector from body to imu frame
        self.rot_b2i = self.imu2body.rotation.conjugated()

        logger.info("Attitude Component initialized, runs at %.2f Hz ", self.frequency)
示例#8
0
    def __init__(self, obj, parent=None):
        logger.info('%s initialization' % obj.name)
        # Call the constructor of the parent class
        morse.core.actuator.Actuator.__init__(self, obj, parent)

        #logger.setLevel(logging.DEBUG)

        # Make new reference to the robot velocities (mathutils.Vector)
        self.robot_w = self.robot_parent.bge_object.localAngularVelocity

        # get the robot inertia (list [ix, iy, iz])
        robot_inertia = self.robot_parent.bge_object.localInertia
        self.inertia = Vector(tuple(robot_inertia))
        logger.debug("robot inertia: (%.3f %.3f %.3f)" % tuple(self.inertia))

        # yaw setpoint in radians is just integrated from yaw rate input
        self.yaw_setpoint = 0.0

        self.prev_err = Vector((0.0, 0.0, 0.0))

        if self._use_angle_against_north:
            self._coord_converter = CoordinateConverter.instance()

        logger.info("Component initialized, runs at %.2f Hz ", self.frequency)
示例#9
0
    def __init__(self, obj, parent=None):
        logger.info('%s initialization' % obj.name)
        # Call the constructor of the parent class
        morse.core.actuator.Actuator.__init__(self, obj, parent)

        #logger.setLevel(logging.DEBUG)

        # Make new reference to the robot velocities (mathutils.Vector)
        self.robot_w = self.robot_parent.bge_object.localAngularVelocity

        # get the robot inertia (list [ix, iy, iz])
        robot_inertia = self.robot_parent.bge_object.localInertia
        self.inertia = Vector(tuple(robot_inertia))
        logger.debug("robot inertia: (%.3f %.3f %.3f)" % tuple(self.inertia))

        # yaw setpoint in radians is just integrated from yaw rate input
        self.yaw_setpoint = 0.0

        self.prev_err = Vector((0.0, 0.0, 0.0))

        if self._use_angle_against_north:
            self._coord_converter = CoordinateConverter.instance()

        logger.info("Component initialized, runs at %.2f Hz ", self.frequency)
示例#10
0
文件: ecef.py 项目: zhongqishi/morse
 def initialize(self):
     self.converter = CoordinateConverter.instance()
示例#11
0
文件: ecef.py 项目: chgrand/morse
 def initialize(self):
     self.converter = CoordinateConverter.instance()
     self.method = None