MCPcopy
hub / github.com/dronekit/dronekit-python / goto

Method goto

examples/drone_delivery/drone_delivery.py:124–141  ·  view source on GitHub ↗
(self, location, relative=None)

Source from the content-addressed store, hash-verified

122 time.sleep(1)
123
124 def goto(self, location, relative=None):
125 self._log("Goto: {0}, {1}".format(location, self.altitude))
126
127 if relative:
128 self.vehicle.simple_goto(
129 LocationGlobalRelative(
130 float(location[0]), float(location[1]),
131 float(self.altitude)
132 )
133 )
134 else:
135 self.vehicle.simple_goto(
136 LocationGlobal(
137 float(location[0]), float(location[1]),
138 float(self.altitude)
139 )
140 )
141 self.vehicle.flush()
142
143 def get_location(self):
144 return [self.current_location.lat, self.current_location.lon]

Callers 1

trackMethod · 0.80

Calls 5

_logMethod · 0.95
LocationGlobalClass · 0.90
simple_gotoMethod · 0.80
flushMethod · 0.80

Tested by

no test coverage detected