示例#1
0
    def setUp(self):
        origin = LocationGlobalRelative(37.873168, -122.302062,
                                        0)  # lat,lon,alt
        self.startxOffset = 20  # meters
        self.startyOffset = 15  # meters
        self.startzOffset = 10  # meters
        self.startHeading = 0  # deg

        self.startLocation = location_helpers.addVectorToLocation(
            origin,
            Vector3(self.startxOffset, self.startyOffset, self.startzOffset))

        #Run the controller constructor
        self.controller = flyController.FlyController(origin,
                                                      self.startxOffset,
                                                      self.startyOffset,
                                                      self.startzOffset,
                                                      self.startHeading)
示例#2
0
    def setUp(self):
        origin = LocationGlobalRelative(37.873168, -122.302062,
                                        0)  # lat,lon,alt
        self.startxOffset = 20  # meters
        self.startyOffset = 15  # meters
        self.startzOffset = 130  # meters
        self.startHeading = 0  # deg

        self.startLocation = location_helpers.addVectorToLocation(
            origin,
            Vector3(self.startxOffset, self.startyOffset, self.startzOffset))

        #Run the controller constructor
        self.controller = flyController.FlyController(origin,
                                                      self.startxOffset,
                                                      self.startyOffset,
                                                      self.startzOffset,
                                                      self.startHeading)
        self.controller._approach = Mock(return_value=Vector3())
        self.controller._strafe = Mock(return_value=Vector3())
        self.controller._climb = Mock(return_value=Vector3())

        #Set options
        self.controller.maxClimbRate = 5  # m/s
        self.controller.maxAlt = 100  #m

        #Arbirary sticks
        throttle = 0.3
        roll = -0.4
        pitch = 0.5
        yaw = -0.6
        raw_paddle = 0.7
        self.channels = [throttle, roll, pitch, yaw, 0.0, 0.0, 0.0, raw_paddle]

        self.controller.move(self.channels,
                             newHeading=0,
                             newOrigin=LocationGlobalRelative(
                                 37.873168, -122.302062, 20))