id
int32
0
252k
repo
stringlengths
7
55
path
stringlengths
4
127
func_name
stringlengths
1
88
original_string
stringlengths
75
19.8k
language
stringclasses
1 value
code
stringlengths
51
19.8k
code_tokens
list
docstring
stringlengths
3
17.3k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
87
242
249,100
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/pymavlink/mavutil.py
mavfile.field
def field(self, type, field, default=None): '''convenient function for returning an arbitrary MAVLink field with a default''' if not type in self.messages: return default return getattr(self.messages[type], field, default)
python
def field(self, type, field, default=None): '''convenient function for returning an arbitrary MAVLink field with a default''' if not type in self.messages: return default return getattr(self.messages[type], field, default)
[ "def", "field", "(", "self", ",", "type", ",", "field", ",", "default", "=", "None", ")", ":", "if", "not", "type", "in", "self", ".", "messages", ":", "return", "default", "return", "getattr", "(", "self", ".", "messages", "[", "type", "]", ",", "...
convenient function for returning an arbitrary MAVLink field with a default
[ "convenient", "function", "for", "returning", "an", "arbitrary", "MAVLink", "field", "with", "a", "default" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/mavutil.py#L726-L731
249,101
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/pymavlink/mavutil.py
mavfile.setup_signing
def setup_signing(self, secret_key, sign_outgoing=True, allow_unsigned_callback=None, initial_timestamp=None, link_id=None): '''setup for MAVLink2 signing''' self.mav.signing.secret_key = secret_key self.mav.signing.sign_outgoing = sign_outgoing self.mav.signing.allow_unsigned_callback =...
python
def setup_signing(self, secret_key, sign_outgoing=True, allow_unsigned_callback=None, initial_timestamp=None, link_id=None): '''setup for MAVLink2 signing''' self.mav.signing.secret_key = secret_key self.mav.signing.sign_outgoing = sign_outgoing self.mav.signing.allow_unsigned_callback =...
[ "def", "setup_signing", "(", "self", ",", "secret_key", ",", "sign_outgoing", "=", "True", ",", "allow_unsigned_callback", "=", "None", ",", "initial_timestamp", "=", "None", ",", "link_id", "=", "None", ")", ":", "self", ".", "mav", ".", "signing", ".", "...
setup for MAVLink2 signing
[ "setup", "for", "MAVLink2", "signing" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/mavutil.py#L740-L758
249,102
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/pymavlink/mavutil.py
mavfile.disable_signing
def disable_signing(self): '''disable MAVLink2 signing''' self.mav.signing.secret_key = None self.mav.signing.sign_outgoing = False self.mav.signing.allow_unsigned_callback = None self.mav.signing.link_id = 0 self.mav.signing.timestamp = 0
python
def disable_signing(self): '''disable MAVLink2 signing''' self.mav.signing.secret_key = None self.mav.signing.sign_outgoing = False self.mav.signing.allow_unsigned_callback = None self.mav.signing.link_id = 0 self.mav.signing.timestamp = 0
[ "def", "disable_signing", "(", "self", ")", ":", "self", ".", "mav", ".", "signing", ".", "secret_key", "=", "None", "self", ".", "mav", ".", "signing", ".", "sign_outgoing", "=", "False", "self", ".", "mav", ".", "signing", ".", "allow_unsigned_callback",...
disable MAVLink2 signing
[ "disable", "MAVLink2", "signing" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/mavutil.py#L760-L766
249,103
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/pymavlink/mavutil.py
mavlogfile.scan_timestamp
def scan_timestamp(self, tbuf): '''scan forward looking in a tlog for a timestamp in a reasonable range''' while True: (tusec,) = struct.unpack('>Q', tbuf) t = tusec * 1.0e-6 if abs(t - self._last_timestamp) <= 3*24*60*60: break c = self.f....
python
def scan_timestamp(self, tbuf): '''scan forward looking in a tlog for a timestamp in a reasonable range''' while True: (tusec,) = struct.unpack('>Q', tbuf) t = tusec * 1.0e-6 if abs(t - self._last_timestamp) <= 3*24*60*60: break c = self.f....
[ "def", "scan_timestamp", "(", "self", ",", "tbuf", ")", ":", "while", "True", ":", "(", "tusec", ",", ")", "=", "struct", ".", "unpack", "(", "'>Q'", ",", "tbuf", ")", "t", "=", "tusec", "*", "1.0e-6", "if", "abs", "(", "t", "-", "self", ".", "...
scan forward looking in a tlog for a timestamp in a reasonable range
[ "scan", "forward", "looking", "in", "a", "tlog", "for", "a", "timestamp", "in", "a", "reasonable", "range" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/mavutil.py#L1073-L1084
249,104
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/pymavlink/mavutil.py
mavlogfile.pre_message
def pre_message(self): '''read timestamp if needed''' # read the timestamp if self.filesize != 0: self.percent = (100.0 * self.f.tell()) / self.filesize if self.notimestamps: return if self.planner_format: tbuf = self.f.read(21) if ...
python
def pre_message(self): '''read timestamp if needed''' # read the timestamp if self.filesize != 0: self.percent = (100.0 * self.f.tell()) / self.filesize if self.notimestamps: return if self.planner_format: tbuf = self.f.read(21) if ...
[ "def", "pre_message", "(", "self", ")", ":", "# read the timestamp", "if", "self", ".", "filesize", "!=", "0", ":", "self", ".", "percent", "=", "(", "100.0", "*", "self", ".", "f", ".", "tell", "(", ")", ")", "/", "self", ".", "filesize", "if", "s...
read timestamp if needed
[ "read", "timestamp", "if", "needed" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/mavutil.py#L1087-L1113
249,105
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/pymavlink/mavutil.py
mavlogfile.post_message
def post_message(self, msg): '''add timestamp to message''' # read the timestamp super(mavlogfile, self).post_message(msg) if self.planner_format: self.f.read(1) # trailing newline self.timestamp = msg._timestamp self._last_message = msg if msg.get_typ...
python
def post_message(self, msg): '''add timestamp to message''' # read the timestamp super(mavlogfile, self).post_message(msg) if self.planner_format: self.f.read(1) # trailing newline self.timestamp = msg._timestamp self._last_message = msg if msg.get_typ...
[ "def", "post_message", "(", "self", ",", "msg", ")", ":", "# read the timestamp", "super", "(", "mavlogfile", ",", "self", ")", ".", "post_message", "(", "msg", ")", "if", "self", ".", "planner_format", ":", "self", ".", "f", ".", "read", "(", "1", ")"...
add timestamp to message
[ "add", "timestamp", "to", "message" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/mavutil.py#L1115-L1125
249,106
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/pymavlink/mavutil.py
periodic_event.trigger
def trigger(self): '''return True if we should trigger now''' tnow = time.time() if tnow < self.last_time: print("Warning, time moved backwards. Restarting timer.") self.last_time = tnow if self.last_time + (1.0/self.frequency) <= tnow: self.last_tim...
python
def trigger(self): '''return True if we should trigger now''' tnow = time.time() if tnow < self.last_time: print("Warning, time moved backwards. Restarting timer.") self.last_time = tnow if self.last_time + (1.0/self.frequency) <= tnow: self.last_tim...
[ "def", "trigger", "(", "self", ")", ":", "tnow", "=", "time", ".", "time", "(", ")", "if", "tnow", "<", "self", ".", "last_time", ":", "print", "(", "\"Warning, time moved backwards. Restarting timer.\"", ")", "self", ".", "last_time", "=", "tnow", "if", "...
return True if we should trigger now
[ "return", "True", "if", "we", "should", "trigger", "now" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/mavutil.py#L1256-L1267
249,107
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/pymavlink/mavutil.py
MavlinkSerialPort.write
def write(self, b): '''write some bytes''' from . import mavutil self.debug("sending '%s' (0x%02x) of len %u\n" % (b, ord(b[0]), len(b)), 2) while len(b) > 0: n = len(b) if n > 70: ...
python
def write(self, b): '''write some bytes''' from . import mavutil self.debug("sending '%s' (0x%02x) of len %u\n" % (b, ord(b[0]), len(b)), 2) while len(b) > 0: n = len(b) if n > 70: ...
[ "def", "write", "(", "self", ",", "b", ")", ":", "from", ".", "import", "mavutil", "self", ".", "debug", "(", "\"sending '%s' (0x%02x) of len %u\\n\"", "%", "(", "b", ",", "ord", "(", "b", "[", "0", "]", ")", ",", "len", "(", "b", ")", ")", ",", ...
write some bytes
[ "write", "some", "bytes" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/mavutil.py#L1696-L1713
249,108
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/pymavlink/mavutil.py
MavlinkSerialPort._recv
def _recv(self): '''read some bytes into self.buf''' from . import mavutil start_time = time.time() while time.time() < start_time + self.timeout: m = self.mav.recv_match(condition='SERIAL_CONTROL.count!=0', ...
python
def _recv(self): '''read some bytes into self.buf''' from . import mavutil start_time = time.time() while time.time() < start_time + self.timeout: m = self.mav.recv_match(condition='SERIAL_CONTROL.count!=0', ...
[ "def", "_recv", "(", "self", ")", ":", "from", ".", "import", "mavutil", "start_time", "=", "time", ".", "time", "(", ")", "while", "time", ".", "time", "(", ")", "<", "start_time", "+", "self", ".", "timeout", ":", "m", "=", "self", ".", "mav", ...
read some bytes into self.buf
[ "read", "some", "bytes", "into", "self", ".", "buf" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/mavutil.py#L1715-L1738
249,109
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/pymavlink/mavutil.py
MavlinkSerialPort.read
def read(self, n): '''read some bytes''' if len(self.buf) == 0: self._recv() if len(self.buf) > 0: if n > len(self.buf): n = len(self.buf) ret = self.buf[:n] ...
python
def read(self, n): '''read some bytes''' if len(self.buf) == 0: self._recv() if len(self.buf) > 0: if n > len(self.buf): n = len(self.buf) ret = self.buf[:n] ...
[ "def", "read", "(", "self", ",", "n", ")", ":", "if", "len", "(", "self", ".", "buf", ")", "==", "0", ":", "self", ".", "_recv", "(", ")", "if", "len", "(", "self", ".", "buf", ")", ">", "0", ":", "if", "n", ">", "len", "(", "self", ".", ...
read some bytes
[ "read", "some", "bytes" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/mavutil.py#L1740-L1753
249,110
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/pymavlink/mavutil.py
MavlinkSerialPort.flushInput
def flushInput(self): '''flush any pending input''' self.buf = '' saved_timeout = self.timeout self.timeout = 0.5 self._recv() self.timeout = saved_timeout self.buf = '' self.debug("flushInput...
python
def flushInput(self): '''flush any pending input''' self.buf = '' saved_timeout = self.timeout self.timeout = 0.5 self._recv() self.timeout = saved_timeout self.buf = '' self.debug("flushInput...
[ "def", "flushInput", "(", "self", ")", ":", "self", ".", "buf", "=", "''", "saved_timeout", "=", "self", ".", "timeout", "self", ".", "timeout", "=", "0.5", "self", ".", "_recv", "(", ")", "self", ".", "timeout", "=", "saved_timeout", "self", ".", "b...
flush any pending input
[ "flush", "any", "pending", "input" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/mavutil.py#L1755-L1763
249,111
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_nsh.py
NSHModule.stop
def stop(self): '''stop nsh input''' self.mpstate.rl.set_prompt(self.status.flightmode + "> ") self.mpstate.functions.input_handler = None self.started = False # unlock the port mav = self.master.mav mav.serial_control_send(self.serial_settings.port, ...
python
def stop(self): '''stop nsh input''' self.mpstate.rl.set_prompt(self.status.flightmode + "> ") self.mpstate.functions.input_handler = None self.started = False # unlock the port mav = self.master.mav mav.serial_control_send(self.serial_settings.port, ...
[ "def", "stop", "(", "self", ")", ":", "self", ".", "mpstate", ".", "rl", ".", "set_prompt", "(", "self", ".", "status", ".", "flightmode", "+", "\"> \"", ")", "self", ".", "mpstate", ".", "functions", ".", "input_handler", "=", "None", "self", ".", "...
stop nsh input
[ "stop", "nsh", "input" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_nsh.py#L38-L48
249,112
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_nsh.py
NSHModule.cmd_nsh
def cmd_nsh(self, args): '''nsh shell commands''' usage = "Usage: nsh <start|stop|set>" if len(args) < 1: print(usage) return if args[0] == "start": self.mpstate.functions.input_handler = self.send self.started = True self.mpsta...
python
def cmd_nsh(self, args): '''nsh shell commands''' usage = "Usage: nsh <start|stop|set>" if len(args) < 1: print(usage) return if args[0] == "start": self.mpstate.functions.input_handler = self.send self.started = True self.mpsta...
[ "def", "cmd_nsh", "(", "self", ",", "args", ")", ":", "usage", "=", "\"Usage: nsh <start|stop|set>\"", "if", "len", "(", "args", ")", "<", "1", ":", "print", "(", "usage", ")", "return", "if", "args", "[", "0", "]", "==", "\"start\"", ":", "self", "....
nsh shell commands
[ "nsh", "shell", "commands" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_nsh.py#L91-L106
249,113
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_wp.py
WPModule.process_waypoint_request
def process_waypoint_request(self, m, master): '''process a waypoint request from the master''' if (not self.loading_waypoints or time.time() > self.loading_waypoint_lasttime + 10.0): self.loading_waypoints = False self.console.error("not loading waypoints") ...
python
def process_waypoint_request(self, m, master): '''process a waypoint request from the master''' if (not self.loading_waypoints or time.time() > self.loading_waypoint_lasttime + 10.0): self.loading_waypoints = False self.console.error("not loading waypoints") ...
[ "def", "process_waypoint_request", "(", "self", ",", "m", ",", "master", ")", ":", "if", "(", "not", "self", ".", "loading_waypoints", "or", "time", ".", "time", "(", ")", ">", "self", ".", "loading_waypoint_lasttime", "+", "10.0", ")", ":", "self", ".",...
process a waypoint request from the master
[ "process", "a", "waypoint", "request", "from", "the", "master" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_wp.py#L120-L138
249,114
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_wp.py
WPModule.send_all_waypoints
def send_all_waypoints(self): '''send all waypoints to vehicle''' self.master.waypoint_clear_all_send() if self.wploader.count() == 0: return self.loading_waypoints = True self.loading_waypoint_lasttime = time.time() self.master.waypoint_count_send(self.wpload...
python
def send_all_waypoints(self): '''send all waypoints to vehicle''' self.master.waypoint_clear_all_send() if self.wploader.count() == 0: return self.loading_waypoints = True self.loading_waypoint_lasttime = time.time() self.master.waypoint_count_send(self.wpload...
[ "def", "send_all_waypoints", "(", "self", ")", ":", "self", ".", "master", ".", "waypoint_clear_all_send", "(", ")", "if", "self", ".", "wploader", ".", "count", "(", ")", "==", "0", ":", "return", "self", ".", "loading_waypoints", "=", "True", "self", "...
send all waypoints to vehicle
[ "send", "all", "waypoints", "to", "vehicle" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_wp.py#L140-L147
249,115
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_wp.py
WPModule.load_waypoints
def load_waypoints(self, filename): '''load waypoints from a file''' self.wploader.target_system = self.target_system self.wploader.target_component = self.target_component try: self.wploader.load(filename) except Exception as msg: print("Unable to load %s...
python
def load_waypoints(self, filename): '''load waypoints from a file''' self.wploader.target_system = self.target_system self.wploader.target_component = self.target_component try: self.wploader.load(filename) except Exception as msg: print("Unable to load %s...
[ "def", "load_waypoints", "(", "self", ",", "filename", ")", ":", "self", ".", "wploader", ".", "target_system", "=", "self", ".", "target_system", "self", ".", "wploader", ".", "target_component", "=", "self", ".", "target_component", "try", ":", "self", "."...
load waypoints from a file
[ "load", "waypoints", "from", "a", "file" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_wp.py#L149-L159
249,116
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_wp.py
WPModule.update_waypoints
def update_waypoints(self, filename, wpnum): '''update waypoints from a file''' self.wploader.target_system = self.target_system self.wploader.target_component = self.target_component try: self.wploader.load(filename) except Exception as msg: print("Unable...
python
def update_waypoints(self, filename, wpnum): '''update waypoints from a file''' self.wploader.target_system = self.target_system self.wploader.target_component = self.target_component try: self.wploader.load(filename) except Exception as msg: print("Unable...
[ "def", "update_waypoints", "(", "self", ",", "filename", ",", "wpnum", ")", ":", "self", ".", "wploader", ".", "target_system", "=", "self", ".", "target_system", "self", ".", "wploader", ".", "target_component", "=", "self", ".", "target_component", "try", ...
update waypoints from a file
[ "update", "waypoints", "from", "a", "file" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_wp.py#L161-L191
249,117
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_wp.py
WPModule.get_default_frame
def get_default_frame(self): '''default frame for waypoints''' if self.settings.terrainalt == 'Auto': if self.get_mav_param('TERRAIN_FOLLOW',0) == 1: return mavutil.mavlink.MAV_FRAME_GLOBAL_TERRAIN_ALT return mavutil.mavlink.MAV_FRAME_GLOBAL_RELATIVE_ALT i...
python
def get_default_frame(self): '''default frame for waypoints''' if self.settings.terrainalt == 'Auto': if self.get_mav_param('TERRAIN_FOLLOW',0) == 1: return mavutil.mavlink.MAV_FRAME_GLOBAL_TERRAIN_ALT return mavutil.mavlink.MAV_FRAME_GLOBAL_RELATIVE_ALT i...
[ "def", "get_default_frame", "(", "self", ")", ":", "if", "self", ".", "settings", ".", "terrainalt", "==", "'Auto'", ":", "if", "self", ".", "get_mav_param", "(", "'TERRAIN_FOLLOW'", ",", "0", ")", "==", "1", ":", "return", "mavutil", ".", "mavlink", "."...
default frame for waypoints
[ "default", "frame", "for", "waypoints" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_wp.py#L202-L210
249,118
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_wp.py
WPModule.wp_draw_callback
def wp_draw_callback(self, points): '''callback from drawing waypoints''' if len(points) < 3: return from MAVProxy.modules.lib import mp_util home = self.wploader.wp(0) self.wploader.clear() self.wploader.target_system = self.target_system self.wploade...
python
def wp_draw_callback(self, points): '''callback from drawing waypoints''' if len(points) < 3: return from MAVProxy.modules.lib import mp_util home = self.wploader.wp(0) self.wploader.clear() self.wploader.target_system = self.target_system self.wploade...
[ "def", "wp_draw_callback", "(", "self", ",", "points", ")", ":", "if", "len", "(", "points", ")", "<", "3", ":", "return", "from", "MAVProxy", ".", "modules", ".", "lib", "import", "mp_util", "home", "=", "self", ".", "wploader", ".", "wp", "(", "0",...
callback from drawing waypoints
[ "callback", "from", "drawing", "waypoints" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_wp.py#L212-L228
249,119
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_wp.py
WPModule.wp_loop
def wp_loop(self): '''close the loop on a mission''' loader = self.wploader if loader.count() < 2: print("Not enough waypoints (%u)" % loader.count()) return wp = loader.wp(loader.count()-2) if wp.command == mavutil.mavlink.MAV_CMD_DO_JUMP: pri...
python
def wp_loop(self): '''close the loop on a mission''' loader = self.wploader if loader.count() < 2: print("Not enough waypoints (%u)" % loader.count()) return wp = loader.wp(loader.count()-2) if wp.command == mavutil.mavlink.MAV_CMD_DO_JUMP: pri...
[ "def", "wp_loop", "(", "self", ")", ":", "loader", "=", "self", ".", "wploader", "if", "loader", ".", "count", "(", ")", "<", "2", ":", "print", "(", "\"Not enough waypoints (%u)\"", "%", "loader", ".", "count", "(", ")", ")", "return", "wp", "=", "l...
close the loop on a mission
[ "close", "the", "loop", "on", "a", "mission" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_wp.py#L230-L246
249,120
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_wp.py
WPModule.set_home_location
def set_home_location(self): '''set home location from last map click''' try: latlon = self.module('map').click_position except Exception: print("No map available") return lat = float(latlon[0]) lon = float(latlon[1]) if self.wploader.c...
python
def set_home_location(self): '''set home location from last map click''' try: latlon = self.module('map').click_position except Exception: print("No map available") return lat = float(latlon[0]) lon = float(latlon[1]) if self.wploader.c...
[ "def", "set_home_location", "(", "self", ")", ":", "try", ":", "latlon", "=", "self", ".", "module", "(", "'map'", ")", ".", "click_position", "except", "Exception", ":", "print", "(", "\"No map available\"", ")", "return", "lat", "=", "float", "(", "latlo...
set home location from last map click
[ "set", "home", "location", "from", "last", "map", "click" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_wp.py#L248-L267
249,121
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_wp.py
WPModule.cmd_wp_move
def cmd_wp_move(self, args): '''handle wp move''' if len(args) != 1: print("usage: wp move WPNUM") return idx = int(args[0]) if idx < 1 or idx > self.wploader.count(): print("Invalid wp number %u" % idx) return try: latl...
python
def cmd_wp_move(self, args): '''handle wp move''' if len(args) != 1: print("usage: wp move WPNUM") return idx = int(args[0]) if idx < 1 or idx > self.wploader.count(): print("Invalid wp number %u" % idx) return try: latl...
[ "def", "cmd_wp_move", "(", "self", ",", "args", ")", ":", "if", "len", "(", "args", ")", "!=", "1", ":", "print", "(", "\"usage: wp move WPNUM\"", ")", "return", "idx", "=", "int", "(", "args", "[", "0", "]", ")", "if", "idx", "<", "1", "or", "id...
handle wp move
[ "handle", "wp", "move" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_wp.py#L270-L311
249,122
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_wp.py
WPModule.cmd_wp_param
def cmd_wp_param(self, args): '''handle wp parameter change''' if len(args) < 2: print("usage: wp param WPNUM PNUM <VALUE>") return idx = int(args[0]) if idx < 1 or idx > self.wploader.count(): print("Invalid wp number %u" % idx) return ...
python
def cmd_wp_param(self, args): '''handle wp parameter change''' if len(args) < 2: print("usage: wp param WPNUM PNUM <VALUE>") return idx = int(args[0]) if idx < 1 or idx > self.wploader.count(): print("Invalid wp number %u" % idx) return ...
[ "def", "cmd_wp_param", "(", "self", ",", "args", ")", ":", "if", "len", "(", "args", ")", "<", "2", ":", "print", "(", "\"usage: wp param WPNUM PNUM <VALUE>\"", ")", "return", "idx", "=", "int", "(", "args", "[", "0", "]", ")", "if", "idx", "<", "1",...
handle wp parameter change
[ "handle", "wp", "parameter", "change" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_wp.py#L432-L466
249,123
JdeRobot/base
src/libs/comm_py/comm/ros/listenerCamera.py
depthToRGB8
def depthToRGB8(float_img_buff, encoding): ''' Translates from Distance Image format to RGB. Inf values are represented by NaN, when converting to RGB, NaN passed to 0 @param float_img_buff: ROS Image to translate @type img: ros image @return a Opencv RGB image ''' gray_image = None ...
python
def depthToRGB8(float_img_buff, encoding): ''' Translates from Distance Image format to RGB. Inf values are represented by NaN, when converting to RGB, NaN passed to 0 @param float_img_buff: ROS Image to translate @type img: ros image @return a Opencv RGB image ''' gray_image = None ...
[ "def", "depthToRGB8", "(", "float_img_buff", ",", "encoding", ")", ":", "gray_image", "=", "None", "if", "(", "encoding", "[", "-", "3", ":", "-", "2", "]", "==", "\"U\"", ")", ":", "gray_image", "=", "float_img_buff", "else", ":", "float_img", "=", "n...
Translates from Distance Image format to RGB. Inf values are represented by NaN, when converting to RGB, NaN passed to 0 @param float_img_buff: ROS Image to translate @type img: ros image @return a Opencv RGB image
[ "Translates", "from", "Distance", "Image", "format", "to", "RGB", ".", "Inf", "values", "are", "represented", "by", "NaN", "when", "converting", "to", "RGB", "NaN", "passed", "to", "0" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/libs/comm_py/comm/ros/listenerCamera.py#L15-L37
249,124
JdeRobot/base
src/libs/comm_py/comm/ros/listenerCamera.py
ListenerCamera.__callback
def __callback (self, img): ''' Callback function to receive and save Images. @param img: ROS Image received @type img: sensor_msgs.msg.Image ''' image = imageMsg2Image(img, self.bridge) self.lock.acquire() self.data = image self.lock....
python
def __callback (self, img): ''' Callback function to receive and save Images. @param img: ROS Image received @type img: sensor_msgs.msg.Image ''' image = imageMsg2Image(img, self.bridge) self.lock.acquire() self.data = image self.lock....
[ "def", "__callback", "(", "self", ",", "img", ")", ":", "image", "=", "imageMsg2Image", "(", "img", ",", "self", ".", "bridge", ")", "self", ".", "lock", ".", "acquire", "(", ")", "self", ".", "data", "=", "image", "self", ".", "lock", ".", "releas...
Callback function to receive and save Images. @param img: ROS Image received @type img: sensor_msgs.msg.Image
[ "Callback", "function", "to", "receive", "and", "save", "Images", "." ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/libs/comm_py/comm/ros/listenerCamera.py#L89-L102
249,125
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/pymavlink/tools/magfit_delta.py
noise
def noise(): '''a noise vector''' from random import gauss v = Vector3(gauss(0, 1), gauss(0, 1), gauss(0, 1)) v.normalize() return v * args.noise
python
def noise(): '''a noise vector''' from random import gauss v = Vector3(gauss(0, 1), gauss(0, 1), gauss(0, 1)) v.normalize() return v * args.noise
[ "def", "noise", "(", ")", ":", "from", "random", "import", "gauss", "v", "=", "Vector3", "(", "gauss", "(", "0", ",", "1", ")", ",", "gauss", "(", "0", ",", "1", ")", ",", "gauss", "(", "0", ",", "1", ")", ")", "v", ".", "normalize", "(", "...
a noise vector
[ "a", "noise", "vector" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/tools/magfit_delta.py#L30-L35
249,126
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/pymavlink/tools/magfit_delta.py
find_offsets
def find_offsets(data, ofs): '''find mag offsets by applying Bills "offsets revisited" algorithm on the data This is an implementation of the algorithm from: http://gentlenav.googlecode.com/files/MagnetometerOffsetNullingRevisited.pdf ''' # a limit on the maximum change in each ...
python
def find_offsets(data, ofs): '''find mag offsets by applying Bills "offsets revisited" algorithm on the data This is an implementation of the algorithm from: http://gentlenav.googlecode.com/files/MagnetometerOffsetNullingRevisited.pdf ''' # a limit on the maximum change in each ...
[ "def", "find_offsets", "(", "data", ",", "ofs", ")", ":", "# a limit on the maximum change in each step", "max_change", "=", "args", ".", "max_change", "# the gain factor for the algorithm", "gain", "=", "args", ".", "gain", "data2", "=", "[", "]", "for", "d", "in...
find mag offsets by applying Bills "offsets revisited" algorithm on the data This is an implementation of the algorithm from: http://gentlenav.googlecode.com/files/MagnetometerOffsetNullingRevisited.pdf
[ "find", "mag", "offsets", "by", "applying", "Bills", "offsets", "revisited", "algorithm", "on", "the", "data" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/tools/magfit_delta.py#L37-L93
249,127
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/lib/mp_image.py
MPImage.set_menu
def set_menu(self, menu): '''set a MPTopMenu on the frame''' self.menu = menu self.in_queue.put(MPImageMenu(menu))
python
def set_menu(self, menu): '''set a MPTopMenu on the frame''' self.menu = menu self.in_queue.put(MPImageMenu(menu))
[ "def", "set_menu", "(", "self", ",", "menu", ")", ":", "self", ".", "menu", "=", "menu", "self", ".", "in_queue", ".", "put", "(", "MPImageMenu", "(", "menu", ")", ")" ]
set a MPTopMenu on the frame
[ "set", "a", "MPTopMenu", "on", "the", "frame" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/lib/mp_image.py#L145-L148
249,128
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/lib/mp_image.py
MPImage.set_popup_menu
def set_popup_menu(self, menu): '''set a popup menu on the frame''' self.popup_menu = menu self.in_queue.put(MPImagePopupMenu(menu))
python
def set_popup_menu(self, menu): '''set a popup menu on the frame''' self.popup_menu = menu self.in_queue.put(MPImagePopupMenu(menu))
[ "def", "set_popup_menu", "(", "self", ",", "menu", ")", ":", "self", ".", "popup_menu", "=", "menu", "self", ".", "in_queue", ".", "put", "(", "MPImagePopupMenu", "(", "menu", ")", ")" ]
set a popup menu on the frame
[ "set", "a", "popup", "menu", "on", "the", "frame" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/lib/mp_image.py#L150-L153
249,129
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/lib/mp_image.py
MPImagePanel.image_coordinates
def image_coordinates(self, point): '''given a point in window coordinates, calculate image coordinates''' # the dragpos is the top left position in image coordinates ret = wx.Point(int(self.dragpos.x + point.x/self.zoom), int(self.dragpos.y + point.y/self.zoom)) r...
python
def image_coordinates(self, point): '''given a point in window coordinates, calculate image coordinates''' # the dragpos is the top left position in image coordinates ret = wx.Point(int(self.dragpos.x + point.x/self.zoom), int(self.dragpos.y + point.y/self.zoom)) r...
[ "def", "image_coordinates", "(", "self", ",", "point", ")", ":", "# the dragpos is the top left position in image coordinates", "ret", "=", "wx", ".", "Point", "(", "int", "(", "self", ".", "dragpos", ".", "x", "+", "point", ".", "x", "/", "self", ".", "zoom...
given a point in window coordinates, calculate image coordinates
[ "given", "a", "point", "in", "window", "coordinates", "calculate", "image", "coordinates" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/lib/mp_image.py#L254-L259
249,130
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/lib/mp_image.py
MPImagePanel.redraw
def redraw(self): '''redraw the image with current settings''' state = self.state if self.img is None: self.mainSizer.Fit(self) self.Refresh() state.frame.Refresh() self.SetFocus() return # get the current size of the containi...
python
def redraw(self): '''redraw the image with current settings''' state = self.state if self.img is None: self.mainSizer.Fit(self) self.Refresh() state.frame.Refresh() self.SetFocus() return # get the current size of the containi...
[ "def", "redraw", "(", "self", ")", ":", "state", "=", "self", ".", "state", "if", "self", ".", "img", "is", "None", ":", "self", ".", "mainSizer", ".", "Fit", "(", "self", ")", "self", ".", "Refresh", "(", ")", "state", ".", "frame", ".", "Refres...
redraw the image with current settings
[ "redraw", "the", "image", "with", "current", "settings" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/lib/mp_image.py#L261-L315
249,131
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/lib/mp_image.py
MPImagePanel.limit_dragpos
def limit_dragpos(self): '''limit dragpos to sane values''' if self.dragpos.x < 0: self.dragpos.x = 0 if self.dragpos.y < 0: self.dragpos.y = 0 if self.img is None: return if self.dragpos.x >= self.img.GetWidth(): self.dragpos.x = s...
python
def limit_dragpos(self): '''limit dragpos to sane values''' if self.dragpos.x < 0: self.dragpos.x = 0 if self.dragpos.y < 0: self.dragpos.y = 0 if self.img is None: return if self.dragpos.x >= self.img.GetWidth(): self.dragpos.x = s...
[ "def", "limit_dragpos", "(", "self", ")", ":", "if", "self", ".", "dragpos", ".", "x", "<", "0", ":", "self", ".", "dragpos", ".", "x", "=", "0", "if", "self", ".", "dragpos", ".", "y", "<", "0", ":", "self", ".", "dragpos", ".", "y", "=", "0...
limit dragpos to sane values
[ "limit", "dragpos", "to", "sane", "values" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/lib/mp_image.py#L362-L373
249,132
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/lib/mp_image.py
MPImagePanel.on_drag_event
def on_drag_event(self, event): '''handle mouse drags''' state = self.state if not state.can_drag: return newpos = self.image_coordinates(event.GetPosition()) dx = -(newpos.x - self.mouse_down.x) dy = -(newpos.y - self.mouse_down.y) self.dragpos = wx.P...
python
def on_drag_event(self, event): '''handle mouse drags''' state = self.state if not state.can_drag: return newpos = self.image_coordinates(event.GetPosition()) dx = -(newpos.x - self.mouse_down.x) dy = -(newpos.y - self.mouse_down.y) self.dragpos = wx.P...
[ "def", "on_drag_event", "(", "self", ",", "event", ")", ":", "state", "=", "self", ".", "state", "if", "not", "state", ".", "can_drag", ":", "return", "newpos", "=", "self", ".", "image_coordinates", "(", "event", ".", "GetPosition", "(", ")", ")", "dx...
handle mouse drags
[ "handle", "mouse", "drags" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/lib/mp_image.py#L401-L413
249,133
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/lib/mp_image.py
MPImagePanel.show_popup_menu
def show_popup_menu(self, pos): '''show a popup menu''' self.popup_pos = self.image_coordinates(pos) self.frame.PopupMenu(self.wx_popup_menu, pos)
python
def show_popup_menu(self, pos): '''show a popup menu''' self.popup_pos = self.image_coordinates(pos) self.frame.PopupMenu(self.wx_popup_menu, pos)
[ "def", "show_popup_menu", "(", "self", ",", "pos", ")", ":", "self", ".", "popup_pos", "=", "self", ".", "image_coordinates", "(", "pos", ")", "self", ".", "frame", ".", "PopupMenu", "(", "self", ".", "wx_popup_menu", ",", "pos", ")" ]
show a popup menu
[ "show", "a", "popup", "menu" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/lib/mp_image.py#L415-L418
249,134
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/lib/mp_image.py
MPImagePanel.on_key_event
def on_key_event(self, event): '''handle key events''' keycode = event.GetKeyCode() if keycode == wx.WXK_HOME: self.zoom = 1.0 self.dragpos = wx.Point(0, 0) self.need_redraw = True
python
def on_key_event(self, event): '''handle key events''' keycode = event.GetKeyCode() if keycode == wx.WXK_HOME: self.zoom = 1.0 self.dragpos = wx.Point(0, 0) self.need_redraw = True
[ "def", "on_key_event", "(", "self", ",", "event", ")", ":", "keycode", "=", "event", ".", "GetKeyCode", "(", ")", "if", "keycode", "==", "wx", ".", "WXK_HOME", ":", "self", ".", "zoom", "=", "1.0", "self", ".", "dragpos", "=", "wx", ".", "Point", "...
handle key events
[ "handle", "key", "events" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/lib/mp_image.py#L436-L442
249,135
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/lib/mp_image.py
MPImagePanel.on_event
def on_event(self, event): '''pass events to the parent''' state = self.state if isinstance(event, wx.MouseEvent): self.on_mouse_event(event) if isinstance(event, wx.KeyEvent): self.on_key_event(event) if (isinstance(event, wx.MouseEvent) and n...
python
def on_event(self, event): '''pass events to the parent''' state = self.state if isinstance(event, wx.MouseEvent): self.on_mouse_event(event) if isinstance(event, wx.KeyEvent): self.on_key_event(event) if (isinstance(event, wx.MouseEvent) and n...
[ "def", "on_event", "(", "self", ",", "event", ")", ":", "state", "=", "self", ".", "state", "if", "isinstance", "(", "event", ",", "wx", ".", "MouseEvent", ")", ":", "self", ".", "on_mouse_event", "(", "event", ")", "if", "isinstance", "(", "event", ...
pass events to the parent
[ "pass", "events", "to", "the", "parent" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/lib/mp_image.py#L444-L460
249,136
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/lib/mp_image.py
MPImagePanel.on_menu
def on_menu(self, event): '''called on menu event''' state = self.state if self.popup_menu is not None: ret = self.popup_menu.find_selected(event) if ret is not None: ret.popup_pos = self.popup_pos if ret.returnkey == 'fitWindow': ...
python
def on_menu(self, event): '''called on menu event''' state = self.state if self.popup_menu is not None: ret = self.popup_menu.find_selected(event) if ret is not None: ret.popup_pos = self.popup_pos if ret.returnkey == 'fitWindow': ...
[ "def", "on_menu", "(", "self", ",", "event", ")", ":", "state", "=", "self", ".", "state", "if", "self", ".", "popup_menu", "is", "not", "None", ":", "ret", "=", "self", ".", "popup_menu", ".", "find_selected", "(", "event", ")", "if", "ret", "is", ...
called on menu event
[ "called", "on", "menu", "event" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/lib/mp_image.py#L462-L480
249,137
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/lib/mp_image.py
MPImagePanel.set_menu
def set_menu(self, menu): '''add a menu from the parent''' self.menu = menu wx_menu = menu.wx_menu() self.frame.SetMenuBar(wx_menu) self.frame.Bind(wx.EVT_MENU, self.on_menu)
python
def set_menu(self, menu): '''add a menu from the parent''' self.menu = menu wx_menu = menu.wx_menu() self.frame.SetMenuBar(wx_menu) self.frame.Bind(wx.EVT_MENU, self.on_menu)
[ "def", "set_menu", "(", "self", ",", "menu", ")", ":", "self", ".", "menu", "=", "menu", "wx_menu", "=", "menu", ".", "wx_menu", "(", ")", "self", ".", "frame", ".", "SetMenuBar", "(", "wx_menu", ")", "self", ".", "frame", ".", "Bind", "(", "wx", ...
add a menu from the parent
[ "add", "a", "menu", "from", "the", "parent" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/lib/mp_image.py#L482-L487
249,138
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/lib/mp_image.py
MPImagePanel.set_popup_menu
def set_popup_menu(self, menu): '''add a popup menu from the parent''' self.popup_menu = menu if menu is None: self.wx_popup_menu = None else: self.wx_popup_menu = menu.wx_menu() self.frame.Bind(wx.EVT_MENU, self.on_menu)
python
def set_popup_menu(self, menu): '''add a popup menu from the parent''' self.popup_menu = menu if menu is None: self.wx_popup_menu = None else: self.wx_popup_menu = menu.wx_menu() self.frame.Bind(wx.EVT_MENU, self.on_menu)
[ "def", "set_popup_menu", "(", "self", ",", "menu", ")", ":", "self", ".", "popup_menu", "=", "menu", "if", "menu", "is", "None", ":", "self", ".", "wx_popup_menu", "=", "None", "else", ":", "self", ".", "wx_popup_menu", "=", "menu", ".", "wx_menu", "("...
add a popup menu from the parent
[ "add", "a", "popup", "menu", "from", "the", "parent" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/lib/mp_image.py#L489-L496
249,139
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/lib/mp_image.py
MPImagePanel.fit_to_window
def fit_to_window(self): '''fit image to window''' state = self.state self.dragpos = wx.Point(0, 0) client_area = state.frame.GetClientSize() self.zoom = min(float(client_area.x) / self.img.GetWidth(), float(client_area.y) / self.img.GetHeight()) s...
python
def fit_to_window(self): '''fit image to window''' state = self.state self.dragpos = wx.Point(0, 0) client_area = state.frame.GetClientSize() self.zoom = min(float(client_area.x) / self.img.GetWidth(), float(client_area.y) / self.img.GetHeight()) s...
[ "def", "fit_to_window", "(", "self", ")", ":", "state", "=", "self", ".", "state", "self", ".", "dragpos", "=", "wx", ".", "Point", "(", "0", ",", "0", ")", "client_area", "=", "state", ".", "frame", ".", "GetClientSize", "(", ")", "self", ".", "zo...
fit image to window
[ "fit", "image", "to", "window" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/lib/mp_image.py#L498-L505
249,140
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/lib/mp_image.py
MPImagePanel.full_size
def full_size(self): '''show image at full size''' self.dragpos = wx.Point(0, 0) self.zoom = 1.0 self.need_redraw = True
python
def full_size(self): '''show image at full size''' self.dragpos = wx.Point(0, 0) self.zoom = 1.0 self.need_redraw = True
[ "def", "full_size", "(", "self", ")", ":", "self", ".", "dragpos", "=", "wx", ".", "Point", "(", "0", ",", "0", ")", "self", ".", "zoom", "=", "1.0", "self", ".", "need_redraw", "=", "True" ]
show image at full size
[ "show", "image", "at", "full", "size" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/lib/mp_image.py#L507-L511
249,141
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/pymavlink/tools/mavmission.py
mavmission
def mavmission(logfile): '''extract mavlink mission''' mlog = mavutil.mavlink_connection(filename) wp = mavwp.MAVWPLoader() while True: m = mlog.recv_match(type=['MISSION_ITEM','CMD','WAYPOINT']) if m is None: break if m.get_type() == 'CMD': m = mavutil....
python
def mavmission(logfile): '''extract mavlink mission''' mlog = mavutil.mavlink_connection(filename) wp = mavwp.MAVWPLoader() while True: m = mlog.recv_match(type=['MISSION_ITEM','CMD','WAYPOINT']) if m is None: break if m.get_type() == 'CMD': m = mavutil....
[ "def", "mavmission", "(", "logfile", ")", ":", "mlog", "=", "mavutil", ".", "mavlink_connection", "(", "filename", ")", "wp", "=", "mavwp", ".", "MAVWPLoader", "(", ")", "while", "True", ":", "m", "=", "mlog", ".", "recv_match", "(", "type", "=", "[", ...
extract mavlink mission
[ "extract", "mavlink", "mission" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/tools/mavmission.py#L20-L47
249,142
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/pymavlink/generator/mavparse.py
message_checksum
def message_checksum(msg): '''calculate a 8-bit checksum of the key fields of a message, so we can detect incompatible XML changes''' from .mavcrc import x25crc crc = x25crc() crc.accumulate_str(msg.name + ' ') # in order to allow for extensions the crc does not include # any field extens...
python
def message_checksum(msg): '''calculate a 8-bit checksum of the key fields of a message, so we can detect incompatible XML changes''' from .mavcrc import x25crc crc = x25crc() crc.accumulate_str(msg.name + ' ') # in order to allow for extensions the crc does not include # any field extens...
[ "def", "message_checksum", "(", "msg", ")", ":", "from", ".", "mavcrc", "import", "x25crc", "crc", "=", "x25crc", "(", ")", "crc", ".", "accumulate_str", "(", "msg", ".", "name", "+", "' '", ")", "# in order to allow for extensions the crc does not include", "# ...
calculate a 8-bit checksum of the key fields of a message, so we can detect incompatible XML changes
[ "calculate", "a", "8", "-", "bit", "checksum", "of", "the", "key", "fields", "of", "a", "message", "so", "we", "can", "detect", "incompatible", "XML", "changes" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/generator/mavparse.py#L379-L394
249,143
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/pymavlink/generator/mavparse.py
merge_enums
def merge_enums(xml): '''merge enums between XML files''' emap = {} for x in xml: newenums = [] for enum in x.enum: if enum.name in emap: emapitem = emap[enum.name] # check for possible conflicting auto-assigned values after merge i...
python
def merge_enums(xml): '''merge enums between XML files''' emap = {} for x in xml: newenums = [] for enum in x.enum: if enum.name in emap: emapitem = emap[enum.name] # check for possible conflicting auto-assigned values after merge i...
[ "def", "merge_enums", "(", "xml", ")", ":", "emap", "=", "{", "}", "for", "x", "in", "xml", ":", "newenums", "=", "[", "]", "for", "enum", "in", "x", ".", "enum", ":", "if", "enum", ".", "name", "in", "emap", ":", "emapitem", "=", "emap", "[", ...
merge enums between XML files
[ "merge", "enums", "between", "XML", "files" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/generator/mavparse.py#L396-L427
249,144
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/pymavlink/generator/mavparse.py
check_duplicates
def check_duplicates(xml): '''check for duplicate message IDs''' merge_enums(xml) msgmap = {} enummap = {} for x in xml: for m in x.message: key = m.id if key in msgmap: print("ERROR: Duplicate message id %u for %s (%s:%u) also used by %s" % ( ...
python
def check_duplicates(xml): '''check for duplicate message IDs''' merge_enums(xml) msgmap = {} enummap = {} for x in xml: for m in x.message: key = m.id if key in msgmap: print("ERROR: Duplicate message id %u for %s (%s:%u) also used by %s" % ( ...
[ "def", "check_duplicates", "(", "xml", ")", ":", "merge_enums", "(", "xml", ")", "msgmap", "=", "{", "}", "enummap", "=", "{", "}", "for", "x", "in", "xml", ":", "for", "m", "in", "x", ".", "message", ":", "key", "=", "m", ".", "id", "if", "key...
check for duplicate message IDs
[ "check", "for", "duplicate", "message", "IDs" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/generator/mavparse.py#L429-L469
249,145
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/pymavlink/generator/mavparse.py
total_msgs
def total_msgs(xml): '''count total number of msgs''' count = 0 for x in xml: count += len(x.message) return count
python
def total_msgs(xml): '''count total number of msgs''' count = 0 for x in xml: count += len(x.message) return count
[ "def", "total_msgs", "(", "xml", ")", ":", "count", "=", "0", "for", "x", "in", "xml", ":", "count", "+=", "len", "(", "x", ".", "message", ")", "return", "count" ]
count total number of msgs
[ "count", "total", "number", "of", "msgs" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/generator/mavparse.py#L473-L478
249,146
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/pymavlink/generator/mavparse.py
MAVType.base_fields
def base_fields(self): '''return number of non-extended fields''' if self.extensions_start is None: return len(self.fields) return len(self.fields[:self.extensions_start])
python
def base_fields(self): '''return number of non-extended fields''' if self.extensions_start is None: return len(self.fields) return len(self.fields[:self.extensions_start])
[ "def", "base_fields", "(", "self", ")", ":", "if", "self", ".", "extensions_start", "is", "None", ":", "return", "len", "(", "self", ".", "fields", ")", "return", "len", "(", "self", ".", "fields", "[", ":", "self", ".", "extensions_start", "]", ")" ]
return number of non-extended fields
[ "return", "number", "of", "non", "-", "extended", "fields" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/generator/mavparse.py#L125-L129
249,147
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_dataflash_logger.py
dataflash_logger._dataflash_dir
def _dataflash_dir(self, mpstate): '''returns directory path to store DF logs in. May be relative''' if mpstate.settings.state_basedir is None: ret = 'dataflash' else: ret = os.path.join(mpstate.settings.state_basedir,'dataflash') try: os.makedirs(re...
python
def _dataflash_dir(self, mpstate): '''returns directory path to store DF logs in. May be relative''' if mpstate.settings.state_basedir is None: ret = 'dataflash' else: ret = os.path.join(mpstate.settings.state_basedir,'dataflash') try: os.makedirs(re...
[ "def", "_dataflash_dir", "(", "self", ",", "mpstate", ")", ":", "if", "mpstate", ".", "settings", ".", "state_basedir", "is", "None", ":", "ret", "=", "'dataflash'", "else", ":", "ret", "=", "os", ".", "path", ".", "join", "(", "mpstate", ".", "setting...
returns directory path to store DF logs in. May be relative
[ "returns", "directory", "path", "to", "store", "DF", "logs", "in", ".", "May", "be", "relative" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_dataflash_logger.py#L65-L80
249,148
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_dataflash_logger.py
dataflash_logger.new_log_filepath
def new_log_filepath(self): '''returns a filepath to a log which does not currently exist and is suitable for DF logging''' lastlog_filename = os.path.join(self.dataflash_dir,'LASTLOG.TXT') if os.path.exists(lastlog_filename) and os.stat(lastlog_filename).st_size != 0: fh = open(last...
python
def new_log_filepath(self): '''returns a filepath to a log which does not currently exist and is suitable for DF logging''' lastlog_filename = os.path.join(self.dataflash_dir,'LASTLOG.TXT') if os.path.exists(lastlog_filename) and os.stat(lastlog_filename).st_size != 0: fh = open(last...
[ "def", "new_log_filepath", "(", "self", ")", ":", "lastlog_filename", "=", "os", ".", "path", ".", "join", "(", "self", ".", "dataflash_dir", ",", "'LASTLOG.TXT'", ")", "if", "os", ".", "path", ".", "exists", "(", "lastlog_filename", ")", "and", "os", "....
returns a filepath to a log which does not currently exist and is suitable for DF logging
[ "returns", "a", "filepath", "to", "a", "log", "which", "does", "not", "currently", "exist", "and", "is", "suitable", "for", "DF", "logging" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_dataflash_logger.py#L82-L96
249,149
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_dataflash_logger.py
dataflash_logger.start_new_log
def start_new_log(self): '''open a new dataflash log, reset state''' filename = self.new_log_filepath() self.block_cnt = 0 self.logfile = open(filename, 'w+b') print("DFLogger: logging started (%s)" % (filename)) self.prev_cnt = 0 self.download = 0 self.p...
python
def start_new_log(self): '''open a new dataflash log, reset state''' filename = self.new_log_filepath() self.block_cnt = 0 self.logfile = open(filename, 'w+b') print("DFLogger: logging started (%s)" % (filename)) self.prev_cnt = 0 self.download = 0 self.p...
[ "def", "start_new_log", "(", "self", ")", ":", "filename", "=", "self", ".", "new_log_filepath", "(", ")", "self", ".", "block_cnt", "=", "0", "self", ".", "logfile", "=", "open", "(", "filename", ",", "'w+b'", ")", "print", "(", "\"DFLogger: logging start...
open a new dataflash log, reset state
[ "open", "a", "new", "dataflash", "log", "reset", "state" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_dataflash_logger.py#L98-L114
249,150
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_dataflash_logger.py
dataflash_logger.mavlink_packet
def mavlink_packet(self, m): '''handle REMOTE_LOG_DATA_BLOCK packets''' now = time.time() if m.get_type() == 'REMOTE_LOG_DATA_BLOCK': if self.stopped: # send a stop packet every second until the other end gets the idea: if now - self.time_last_stop_pac...
python
def mavlink_packet(self, m): '''handle REMOTE_LOG_DATA_BLOCK packets''' now = time.time() if m.get_type() == 'REMOTE_LOG_DATA_BLOCK': if self.stopped: # send a stop packet every second until the other end gets the idea: if now - self.time_last_stop_pac...
[ "def", "mavlink_packet", "(", "self", ",", "m", ")", ":", "now", "=", "time", ".", "time", "(", ")", "if", "m", ".", "get_type", "(", ")", "==", "'REMOTE_LOG_DATA_BLOCK'", ":", "if", "self", ".", "stopped", ":", "# send a stop packet every second until the o...
handle REMOTE_LOG_DATA_BLOCK packets
[ "handle", "REMOTE_LOG_DATA_BLOCK", "packets" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_dataflash_logger.py#L194-L259
249,151
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/ardupilotmega.py
MAVLink.meminfo_send
def meminfo_send(self, brkval, freemem, force_mavlink1=False): ''' state of APM memory brkval : heap top (uint16_t) freemem : free memory (uint16_t) ''' return self.send(self.meminfo_en...
python
def meminfo_send(self, brkval, freemem, force_mavlink1=False): ''' state of APM memory brkval : heap top (uint16_t) freemem : free memory (uint16_t) ''' return self.send(self.meminfo_en...
[ "def", "meminfo_send", "(", "self", ",", "brkval", ",", "freemem", ",", "force_mavlink1", "=", "False", ")", ":", "return", "self", ".", "send", "(", "self", ".", "meminfo_encode", "(", "brkval", ",", "freemem", ")", ",", "force_mavlink1", "=", "force_mavl...
state of APM memory brkval : heap top (uint16_t) freemem : free memory (uint16_t)
[ "state", "of", "APM", "memory" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/dialects/v10/ardupilotmega.py#L9577-L9585
249,152
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/pymavlink/tools/mavextract.py
older_message
def older_message(m, lastm): '''return true if m is older than lastm by timestamp''' atts = {'time_boot_ms' : 1.0e-3, 'time_unix_usec' : 1.0e-6, 'time_usec' : 1.0e-6} for a in atts.keys(): if hasattr(m, a): mul = atts[a] t1 = m.getattr(a) * mul ...
python
def older_message(m, lastm): '''return true if m is older than lastm by timestamp''' atts = {'time_boot_ms' : 1.0e-3, 'time_unix_usec' : 1.0e-6, 'time_usec' : 1.0e-6} for a in atts.keys(): if hasattr(m, a): mul = atts[a] t1 = m.getattr(a) * mul ...
[ "def", "older_message", "(", "m", ",", "lastm", ")", ":", "atts", "=", "{", "'time_boot_ms'", ":", "1.0e-3", ",", "'time_unix_usec'", ":", "1.0e-6", ",", "'time_usec'", ":", "1.0e-6", "}", "for", "a", "in", "atts", ".", "keys", "(", ")", ":", "if", "...
return true if m is older than lastm by timestamp
[ "return", "true", "if", "m", "is", "older", "than", "lastm", "by", "timestamp" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/tools/mavextract.py#L22-L34
249,153
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/pymavlink/tools/mavextract.py
process
def process(filename): '''process one logfile''' print("Processing %s" % filename) mlog = mavutil.mavlink_connection(filename, notimestamps=args.notimestamps, robust_parsing=args.robust) ext = os.path.splitext(filename)[1] isbin = ext in ['.bin', '.BIN'] i...
python
def process(filename): '''process one logfile''' print("Processing %s" % filename) mlog = mavutil.mavlink_connection(filename, notimestamps=args.notimestamps, robust_parsing=args.robust) ext = os.path.splitext(filename)[1] isbin = ext in ['.bin', '.BIN'] i...
[ "def", "process", "(", "filename", ")", ":", "print", "(", "\"Processing %s\"", "%", "filename", ")", "mlog", "=", "mavutil", ".", "mavlink_connection", "(", "filename", ",", "notimestamps", "=", "args", ".", "notimestamps", ",", "robust_parsing", "=", "args",...
process one logfile
[ "process", "one", "logfile" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/tools/mavextract.py#L36-L108
249,154
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_log.py
LogModule.handle_log_entry
def handle_log_entry(self, m): '''handling incoming log entry''' if m.time_utc == 0: tstring = '' else: tstring = time.ctime(m.time_utc) self.entries[m.id] = m print("Log %u numLogs %u lastLog %u size %u %s" % (m.id, m.num_logs, m.last_log_num, m.size, ts...
python
def handle_log_entry(self, m): '''handling incoming log entry''' if m.time_utc == 0: tstring = '' else: tstring = time.ctime(m.time_utc) self.entries[m.id] = m print("Log %u numLogs %u lastLog %u size %u %s" % (m.id, m.num_logs, m.last_log_num, m.size, ts...
[ "def", "handle_log_entry", "(", "self", ",", "m", ")", ":", "if", "m", ".", "time_utc", "==", "0", ":", "tstring", "=", "''", "else", ":", "tstring", "=", "time", ".", "ctime", "(", "m", ".", "time_utc", ")", "self", ".", "entries", "[", "m", "."...
handling incoming log entry
[ "handling", "incoming", "log", "entry" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_log.py#L32-L39
249,155
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_log.py
LogModule.handle_log_data_missing
def handle_log_data_missing(self): '''handling missing incoming log data''' if len(self.download_set) == 0: return highest = max(self.download_set) diff = set(range(highest)).difference(self.download_set) if len(diff) == 0: self.master.mav.log_request_data...
python
def handle_log_data_missing(self): '''handling missing incoming log data''' if len(self.download_set) == 0: return highest = max(self.download_set) diff = set(range(highest)).difference(self.download_set) if len(diff) == 0: self.master.mav.log_request_data...
[ "def", "handle_log_data_missing", "(", "self", ")", ":", "if", "len", "(", "self", ".", "download_set", ")", "==", "0", ":", "return", "highest", "=", "max", "(", "self", ".", "download_set", ")", "diff", "=", "set", "(", "range", "(", "highest", ")", ...
handling missing incoming log data
[ "handling", "missing", "incoming", "log", "data" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_log.py#L75-L101
249,156
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_log.py
LogModule.log_status
def log_status(self): '''show download status''' if self.download_filename is None: print("No download") return dt = time.time() - self.download_start speed = os.path.getsize(self.download_filename) / (1000.0 * dt) m = self.entries.get(self.download_lognum...
python
def log_status(self): '''show download status''' if self.download_filename is None: print("No download") return dt = time.time() - self.download_start speed = os.path.getsize(self.download_filename) / (1000.0 * dt) m = self.entries.get(self.download_lognum...
[ "def", "log_status", "(", "self", ")", ":", "if", "self", ".", "download_filename", "is", "None", ":", "print", "(", "\"No download\"", ")", "return", "dt", "=", "time", ".", "time", "(", ")", "-", "self", ".", "download_start", "speed", "=", "os", "."...
show download status
[ "show", "download", "status" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_log.py#L104-L123
249,157
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_log.py
LogModule.log_download
def log_download(self, log_num, filename): '''download a log file''' print("Downloading log %u as %s" % (log_num, filename)) self.download_lognum = log_num self.download_file = open(filename, "wb") self.master.mav.log_request_data_send(self.target_system, ...
python
def log_download(self, log_num, filename): '''download a log file''' print("Downloading log %u as %s" % (log_num, filename)) self.download_lognum = log_num self.download_file = open(filename, "wb") self.master.mav.log_request_data_send(self.target_system, ...
[ "def", "log_download", "(", "self", ",", "log_num", ",", "filename", ")", ":", "print", "(", "\"Downloading log %u as %s\"", "%", "(", "log_num", ",", "filename", ")", ")", "self", ".", "download_lognum", "=", "log_num", "self", ".", "download_file", "=", "o...
download a log file
[ "download", "a", "log", "file" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_log.py#L125-L138
249,158
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_log.py
LogModule.idle_task
def idle_task(self): '''handle missing log data''' if self.download_last_timestamp is not None and time.time() - self.download_last_timestamp > 0.7: self.download_last_timestamp = time.time() self.handle_log_data_missing()
python
def idle_task(self): '''handle missing log data''' if self.download_last_timestamp is not None and time.time() - self.download_last_timestamp > 0.7: self.download_last_timestamp = time.time() self.handle_log_data_missing()
[ "def", "idle_task", "(", "self", ")", ":", "if", "self", ".", "download_last_timestamp", "is", "not", "None", "and", "time", ".", "time", "(", ")", "-", "self", ".", "download_last_timestamp", ">", "0.7", ":", "self", ".", "download_last_timestamp", "=", "...
handle missing log data
[ "handle", "missing", "log", "data" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_log.py#L185-L189
249,159
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/lib/rline.py
complete_modules
def complete_modules(text): '''complete mavproxy module names''' import MAVProxy.modules, pkgutil modlist = [x[1] for x in pkgutil.iter_modules(MAVProxy.modules.__path__)] ret = [] loaded = set(complete_loadedmodules('')) for m in modlist: if not m.startswith("mavproxy_"): co...
python
def complete_modules(text): '''complete mavproxy module names''' import MAVProxy.modules, pkgutil modlist = [x[1] for x in pkgutil.iter_modules(MAVProxy.modules.__path__)] ret = [] loaded = set(complete_loadedmodules('')) for m in modlist: if not m.startswith("mavproxy_"): co...
[ "def", "complete_modules", "(", "text", ")", ":", "import", "MAVProxy", ".", "modules", ",", "pkgutil", "modlist", "=", "[", "x", "[", "1", "]", "for", "x", "in", "pkgutil", ".", "iter_modules", "(", "MAVProxy", ".", "modules", ".", "__path__", ")", "]...
complete mavproxy module names
[ "complete", "mavproxy", "module", "names" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/lib/rline.py#L63-L75
249,160
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/lib/rline.py
complete_filename
def complete_filename(text): '''complete a filename''' #ensure directories have trailing slashes: list = glob.glob(text+'*') for idx, val in enumerate(list): if os.path.isdir(val): list[idx] = (val + os.path.sep) return list
python
def complete_filename(text): '''complete a filename''' #ensure directories have trailing slashes: list = glob.glob(text+'*') for idx, val in enumerate(list): if os.path.isdir(val): list[idx] = (val + os.path.sep) return list
[ "def", "complete_filename", "(", "text", ")", ":", "#ensure directories have trailing slashes:", "list", "=", "glob", ".", "glob", "(", "text", "+", "'*'", ")", "for", "idx", ",", "val", "in", "enumerate", "(", "list", ")", ":", "if", "os", ".", "path", ...
complete a filename
[ "complete", "a", "filename" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/lib/rline.py#L77-L86
249,161
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/lib/rline.py
complete_variable
def complete_variable(text): '''complete a MAVLink variable''' if text.find('.') != -1: var = text.split('.')[0] if var in rline_mpstate.status.msgs: ret = [] for f in rline_mpstate.status.msgs[var].get_fieldnames(): ret.append(var + '.' + f) r...
python
def complete_variable(text): '''complete a MAVLink variable''' if text.find('.') != -1: var = text.split('.')[0] if var in rline_mpstate.status.msgs: ret = [] for f in rline_mpstate.status.msgs[var].get_fieldnames(): ret.append(var + '.' + f) r...
[ "def", "complete_variable", "(", "text", ")", ":", "if", "text", ".", "find", "(", "'.'", ")", "!=", "-", "1", ":", "var", "=", "text", ".", "split", "(", "'.'", ")", "[", "0", "]", "if", "var", "in", "rline_mpstate", ".", "status", ".", "msgs", ...
complete a MAVLink variable
[ "complete", "a", "MAVLink", "variable" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/lib/rline.py#L92-L102
249,162
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/lib/rline.py
rule_expand
def rule_expand(component, text): '''expand one rule component''' global rline_mpstate if component[0] == '<' and component[-1] == '>': return component[1:-1].split('|') if component in rline_mpstate.completion_functions: return rline_mpstate.completion_functions[component](text) ret...
python
def rule_expand(component, text): '''expand one rule component''' global rline_mpstate if component[0] == '<' and component[-1] == '>': return component[1:-1].split('|') if component in rline_mpstate.completion_functions: return rline_mpstate.completion_functions[component](text) ret...
[ "def", "rule_expand", "(", "component", ",", "text", ")", ":", "global", "rline_mpstate", "if", "component", "[", "0", "]", "==", "'<'", "and", "component", "[", "-", "1", "]", "==", "'>'", ":", "return", "component", "[", "1", ":", "-", "1", "]", ...
expand one rule component
[ "expand", "one", "rule", "component" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/lib/rline.py#L104-L111
249,163
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/lib/rline.py
rule_match
def rule_match(component, cmd): '''see if one rule component matches''' if component == cmd: return True expanded = rule_expand(component, cmd) if cmd in expanded: return True return False
python
def rule_match(component, cmd): '''see if one rule component matches''' if component == cmd: return True expanded = rule_expand(component, cmd) if cmd in expanded: return True return False
[ "def", "rule_match", "(", "component", ",", "cmd", ")", ":", "if", "component", "==", "cmd", ":", "return", "True", "expanded", "=", "rule_expand", "(", "component", ",", "cmd", ")", "if", "cmd", "in", "expanded", ":", "return", "True", "return", "False"...
see if one rule component matches
[ "see", "if", "one", "rule", "component", "matches" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/lib/rline.py#L113-L120
249,164
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/lib/rline.py
complete_rules
def complete_rules(rules, cmd): '''complete using a list of completion rules''' if not isinstance(rules, list): rules = [rules] ret = [] for r in rules: ret += complete_rule(r, cmd) return ret
python
def complete_rules(rules, cmd): '''complete using a list of completion rules''' if not isinstance(rules, list): rules = [rules] ret = [] for r in rules: ret += complete_rule(r, cmd) return ret
[ "def", "complete_rules", "(", "rules", ",", "cmd", ")", ":", "if", "not", "isinstance", "(", "rules", ",", "list", ")", ":", "rules", "=", "[", "rules", "]", "ret", "=", "[", "]", "for", "r", "in", "rules", ":", "ret", "+=", "complete_rule", "(", ...
complete using a list of completion rules
[ "complete", "using", "a", "list", "of", "completion", "rules" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/lib/rline.py#L137-L144
249,165
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/lib/rline.py
complete
def complete(text, state): '''completion routine for when user presses tab''' global last_clist global rline_mpstate if state != 0 and last_clist is not None: return last_clist[state] # split the command so far cmd = readline.get_line_buffer().split() if len(cmd) == 1: # if...
python
def complete(text, state): '''completion routine for when user presses tab''' global last_clist global rline_mpstate if state != 0 and last_clist is not None: return last_clist[state] # split the command so far cmd = readline.get_line_buffer().split() if len(cmd) == 1: # if...
[ "def", "complete", "(", "text", ",", "state", ")", ":", "global", "last_clist", "global", "rline_mpstate", "if", "state", "!=", "0", "and", "last_clist", "is", "not", "None", ":", "return", "last_clist", "[", "state", "]", "# split the command so far", "cmd", ...
completion routine for when user presses tab
[ "completion", "routine", "for", "when", "user", "presses", "tab" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/lib/rline.py#L149-L180
249,166
JdeRobot/base
src/libs/comm_py/comm/ros/listenerLaser.py
laserScan2LaserData
def laserScan2LaserData(scan): ''' Translates from ROS LaserScan to JderobotTypes LaserData. @param scan: ROS LaserScan to translate @type scan: LaserScan @return a LaserData translated from scan ''' laser = LaserData() laser.values = scan.ranges ''' ROS Angle Map ...
python
def laserScan2LaserData(scan): ''' Translates from ROS LaserScan to JderobotTypes LaserData. @param scan: ROS LaserScan to translate @type scan: LaserScan @return a LaserData translated from scan ''' laser = LaserData() laser.values = scan.ranges ''' ROS Angle Map ...
[ "def", "laserScan2LaserData", "(", "scan", ")", ":", "laser", "=", "LaserData", "(", ")", "laser", ".", "values", "=", "scan", ".", "ranges", "''' \n ROS Angle Map JdeRobot Angle Map\n 0 PI/2\n | |\n ...
Translates from ROS LaserScan to JderobotTypes LaserData. @param scan: ROS LaserScan to translate @type scan: LaserScan @return a LaserData translated from scan
[ "Translates", "from", "ROS", "LaserScan", "to", "JderobotTypes", "LaserData", "." ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/libs/comm_py/comm/ros/listenerLaser.py#L9-L36
249,167
JdeRobot/base
src/libs/comm_py/comm/ros/listenerLaser.py
ListenerLaser.__callback
def __callback (self, scan): ''' Callback function to receive and save Laser Scans. @param scan: ROS LaserScan received @type scan: LaserScan ''' laser = laserScan2LaserData(scan) self.lock.acquire() self.data = laser self.lock.release...
python
def __callback (self, scan): ''' Callback function to receive and save Laser Scans. @param scan: ROS LaserScan received @type scan: LaserScan ''' laser = laserScan2LaserData(scan) self.lock.acquire() self.data = laser self.lock.release...
[ "def", "__callback", "(", "self", ",", "scan", ")", ":", "laser", "=", "laserScan2LaserData", "(", "scan", ")", "self", ".", "lock", ".", "acquire", "(", ")", "self", ".", "data", "=", "laser", "self", ".", "lock", ".", "release", "(", ")" ]
Callback function to receive and save Laser Scans. @param scan: ROS LaserScan received @type scan: LaserScan
[ "Callback", "function", "to", "receive", "and", "save", "Laser", "Scans", "." ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/libs/comm_py/comm/ros/listenerLaser.py#L57-L70
249,168
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/pymavlink/tools/mavkml.py
add_to_linestring
def add_to_linestring(position_data, kml_linestring): '''add a point to the kml file''' global kml # add altitude offset position_data[2] += float(args.aoff) kml_linestring.coords.addcoordinates([position_data])
python
def add_to_linestring(position_data, kml_linestring): '''add a point to the kml file''' global kml # add altitude offset position_data[2] += float(args.aoff) kml_linestring.coords.addcoordinates([position_data])
[ "def", "add_to_linestring", "(", "position_data", ",", "kml_linestring", ")", ":", "global", "kml", "# add altitude offset", "position_data", "[", "2", "]", "+=", "float", "(", "args", ".", "aoff", ")", "kml_linestring", ".", "coords", ".", "addcoordinates", "("...
add a point to the kml file
[ "add", "a", "point", "to", "the", "kml", "file" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/tools/mavkml.py#L30-L36
249,169
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/pymavlink/tools/mavkml.py
sniff_field_spelling
def sniff_field_spelling(mlog, source): '''attempt to detect whether APM or PX4 attributes names are in use''' position_field_type_default = position_field_types[0] # Default to PX4 spelling msg = mlog.recv_match(source) mlog._rewind() # Unfortunately it's either call this or return a mutated objec...
python
def sniff_field_spelling(mlog, source): '''attempt to detect whether APM or PX4 attributes names are in use''' position_field_type_default = position_field_types[0] # Default to PX4 spelling msg = mlog.recv_match(source) mlog._rewind() # Unfortunately it's either call this or return a mutated objec...
[ "def", "sniff_field_spelling", "(", "mlog", ",", "source", ")", ":", "position_field_type_default", "=", "position_field_types", "[", "0", "]", "# Default to PX4 spelling", "msg", "=", "mlog", ".", "recv_match", "(", "source", ")", "mlog", ".", "_rewind", "(", "...
attempt to detect whether APM or PX4 attributes names are in use
[ "attempt", "to", "detect", "whether", "APM", "or", "PX4", "attributes", "names", "are", "in", "use" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/tools/mavkml.py#L153-L162
249,170
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_link.py
LinkModule.cmd_link_ports
def cmd_link_ports(self): '''show available ports''' ports = mavutil.auto_detect_serial(preferred_list=['*FTDI*',"*Arduino_Mega_2560*", "*3D_Robotics*", "*USB_to_UART*", '*PX4*', '*FMU*']) for p in ports: print("%s : %s : %s" % (p.device, p.description, p.hwid))
python
def cmd_link_ports(self): '''show available ports''' ports = mavutil.auto_detect_serial(preferred_list=['*FTDI*',"*Arduino_Mega_2560*", "*3D_Robotics*", "*USB_to_UART*", '*PX4*', '*FMU*']) for p in ports: print("%s : %s : %s" % (p.device, p.description, p.hwid))
[ "def", "cmd_link_ports", "(", "self", ")", ":", "ports", "=", "mavutil", ".", "auto_detect_serial", "(", "preferred_list", "=", "[", "'*FTDI*'", ",", "\"*Arduino_Mega_2560*\"", ",", "\"*3D_Robotics*\"", ",", "\"*USB_to_UART*\"", ",", "'*PX4*'", ",", "'*FMU*'", "]"...
show available ports
[ "show", "available", "ports" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_link.py#L148-L152
249,171
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/lib/textconsole.py
SimpleConsole.writeln
def writeln(self, text, fg='black', bg='white'): '''write to the console with linefeed''' if not isinstance(text, str): text = str(text) self.write(text + '\n', fg=fg, bg=bg)
python
def writeln(self, text, fg='black', bg='white'): '''write to the console with linefeed''' if not isinstance(text, str): text = str(text) self.write(text + '\n', fg=fg, bg=bg)
[ "def", "writeln", "(", "self", ",", "text", ",", "fg", "=", "'black'", ",", "bg", "=", "'white'", ")", ":", "if", "not", "isinstance", "(", "text", ",", "str", ")", ":", "text", "=", "str", "(", "text", ")", "self", ".", "write", "(", "text", "...
write to the console with linefeed
[ "write", "to", "the", "console", "with", "linefeed" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/lib/textconsole.py#L29-L33
249,172
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/pymavlink/tools/MPU6KSearch.py
match_extension
def match_extension(f): '''see if the path matches a extension''' (root,ext) = os.path.splitext(f) return ext.lower() in extensions
python
def match_extension(f): '''see if the path matches a extension''' (root,ext) = os.path.splitext(f) return ext.lower() in extensions
[ "def", "match_extension", "(", "f", ")", ":", "(", "root", ",", "ext", ")", "=", "os", ".", "path", ".", "splitext", "(", "f", ")", "return", "ext", ".", "lower", "(", ")", "in", "extensions" ]
see if the path matches a extension
[ "see", "if", "the", "path", "matches", "a", "extension" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/pymavlink/tools/MPU6KSearch.py#L139-L142
249,173
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_map/mp_tile.py
TileInfo.path
def path(self): '''return relative path of tile image''' (x, y) = self.tile return os.path.join('%u' % self.zoom, '%u' % y, '%u.img' % x)
python
def path(self): '''return relative path of tile image''' (x, y) = self.tile return os.path.join('%u' % self.zoom, '%u' % y, '%u.img' % x)
[ "def", "path", "(", "self", ")", ":", "(", "x", ",", "y", ")", "=", "self", ".", "tile", "return", "os", ".", "path", ".", "join", "(", "'%u'", "%", "self", ".", "zoom", ",", "'%u'", "%", "y", ",", "'%u.img'", "%", "x", ")" ]
return relative path of tile image
[ "return", "relative", "path", "of", "tile", "image" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_map/mp_tile.py#L133-L138
249,174
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_map/mp_tile.py
TileInfo.url
def url(self, service): '''return URL for a tile''' if service not in TILE_SERVICES: raise TileException('unknown tile service %s' % service) url = string.Template(TILE_SERVICES[service]) (x,y) = self.tile tile_info = TileServiceInfo(x, y, self.zoom) return url.substitute(tile_info)
python
def url(self, service): '''return URL for a tile''' if service not in TILE_SERVICES: raise TileException('unknown tile service %s' % service) url = string.Template(TILE_SERVICES[service]) (x,y) = self.tile tile_info = TileServiceInfo(x, y, self.zoom) return url.substitute(tile_info)
[ "def", "url", "(", "self", ",", "service", ")", ":", "if", "service", "not", "in", "TILE_SERVICES", ":", "raise", "TileException", "(", "'unknown tile service %s'", "%", "service", ")", "url", "=", "string", ".", "Template", "(", "TILE_SERVICES", "[", "servi...
return URL for a tile
[ "return", "URL", "for", "a", "tile" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_map/mp_tile.py#L140-L147
249,175
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_map/mp_tile.py
MPTile.tile_to_path
def tile_to_path(self, tile): '''return full path to a tile''' return os.path.join(self.cache_path, self.service, tile.path())
python
def tile_to_path(self, tile): '''return full path to a tile''' return os.path.join(self.cache_path, self.service, tile.path())
[ "def", "tile_to_path", "(", "self", ",", "tile", ")", ":", "return", "os", ".", "path", ".", "join", "(", "self", ".", "cache_path", ",", "self", ".", "service", ",", "tile", ".", "path", "(", ")", ")" ]
return full path to a tile
[ "return", "full", "path", "to", "a", "tile" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_map/mp_tile.py#L227-L229
249,176
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_map/mp_tile.py
MPTile.start_download_thread
def start_download_thread(self): '''start the downloader''' if self._download_thread: return t = threading.Thread(target=self.downloader) t.daemon = True self._download_thread = t t.start()
python
def start_download_thread(self): '''start the downloader''' if self._download_thread: return t = threading.Thread(target=self.downloader) t.daemon = True self._download_thread = t t.start()
[ "def", "start_download_thread", "(", "self", ")", ":", "if", "self", ".", "_download_thread", ":", "return", "t", "=", "threading", ".", "Thread", "(", "target", "=", "self", ".", "downloader", ")", "t", ".", "daemon", "=", "True", "self", ".", "_downloa...
start the downloader
[ "start", "the", "downloader" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_map/mp_tile.py#L307-L314
249,177
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_misc.py
MiscModule.qnh_estimate
def qnh_estimate(self): '''estimate QNH pressure from GPS altitude and scaled pressure''' alt_gps = self.master.field('GPS_RAW_INT', 'alt', 0) * 0.001 pressure2 = self.master.field('SCALED_PRESSURE', 'press_abs', 0) ground_temp = self.get_mav_param('GND_TEMP', 21) temp = ground_t...
python
def qnh_estimate(self): '''estimate QNH pressure from GPS altitude and scaled pressure''' alt_gps = self.master.field('GPS_RAW_INT', 'alt', 0) * 0.001 pressure2 = self.master.field('SCALED_PRESSURE', 'press_abs', 0) ground_temp = self.get_mav_param('GND_TEMP', 21) temp = ground_t...
[ "def", "qnh_estimate", "(", "self", ")", ":", "alt_gps", "=", "self", ".", "master", ".", "field", "(", "'GPS_RAW_INT'", ",", "'alt'", ",", "0", ")", "*", "0.001", "pressure2", "=", "self", ".", "master", ".", "field", "(", "'SCALED_PRESSURE'", ",", "'...
estimate QNH pressure from GPS altitude and scaled pressure
[ "estimate", "QNH", "pressure", "from", "GPS", "altitude", "and", "scaled", "pressure" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_misc.py#L83-L90
249,178
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_misc.py
MiscModule.cmd_up
def cmd_up(self, args): '''adjust TRIM_PITCH_CD up by 5 degrees''' if len(args) == 0: adjust = 5.0 else: adjust = float(args[0]) old_trim = self.get_mav_param('TRIM_PITCH_CD', None) if old_trim is None: print("Existing trim value unknown!") ...
python
def cmd_up(self, args): '''adjust TRIM_PITCH_CD up by 5 degrees''' if len(args) == 0: adjust = 5.0 else: adjust = float(args[0]) old_trim = self.get_mav_param('TRIM_PITCH_CD', None) if old_trim is None: print("Existing trim value unknown!") ...
[ "def", "cmd_up", "(", "self", ",", "args", ")", ":", "if", "len", "(", "args", ")", "==", "0", ":", "adjust", "=", "5.0", "else", ":", "adjust", "=", "float", "(", "args", "[", "0", "]", ")", "old_trim", "=", "self", ".", "get_mav_param", "(", ...
adjust TRIM_PITCH_CD up by 5 degrees
[ "adjust", "TRIM_PITCH_CD", "up", "by", "5", "degrees" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_misc.py#L107-L122
249,179
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_misc.py
MiscModule.cmd_time
def cmd_time(self, args): '''show autopilot time''' tusec = self.master.field('SYSTEM_TIME', 'time_unix_usec', 0) if tusec == 0: print("No SYSTEM_TIME time available") return print("%s (%s)\n" % (time.ctime(tusec * 1.0e-6), time.ctime()))
python
def cmd_time(self, args): '''show autopilot time''' tusec = self.master.field('SYSTEM_TIME', 'time_unix_usec', 0) if tusec == 0: print("No SYSTEM_TIME time available") return print("%s (%s)\n" % (time.ctime(tusec * 1.0e-6), time.ctime()))
[ "def", "cmd_time", "(", "self", ",", "args", ")", ":", "tusec", "=", "self", ".", "master", ".", "field", "(", "'SYSTEM_TIME'", ",", "'time_unix_usec'", ",", "0", ")", "if", "tusec", "==", "0", ":", "print", "(", "\"No SYSTEM_TIME time available\"", ")", ...
show autopilot time
[ "show", "autopilot", "time" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_misc.py#L128-L134
249,180
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_misc.py
MiscModule.cmd_changealt
def cmd_changealt(self, args): '''change target altitude''' if len(args) < 1: print("usage: changealt <relaltitude>") return relalt = float(args[0]) self.master.mav.mission_item_send(self.settings.target_system, self.setti...
python
def cmd_changealt(self, args): '''change target altitude''' if len(args) < 1: print("usage: changealt <relaltitude>") return relalt = float(args[0]) self.master.mav.mission_item_send(self.settings.target_system, self.setti...
[ "def", "cmd_changealt", "(", "self", ",", "args", ")", ":", "if", "len", "(", "args", ")", "<", "1", ":", "print", "(", "\"usage: changealt <relaltitude>\"", ")", "return", "relalt", "=", "float", "(", "args", "[", "0", "]", ")", "self", ".", "master",...
change target altitude
[ "change", "target", "altitude" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_misc.py#L136-L149
249,181
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_misc.py
MiscModule.cmd_land
def cmd_land(self, args): '''auto land commands''' if len(args) < 1: self.master.mav.command_long_send(self.settings.target_system, 0, mavutil.mavlink.MAV_CMD_DO_LAND_START, ...
python
def cmd_land(self, args): '''auto land commands''' if len(args) < 1: self.master.mav.command_long_send(self.settings.target_system, 0, mavutil.mavlink.MAV_CMD_DO_LAND_START, ...
[ "def", "cmd_land", "(", "self", ",", "args", ")", ":", "if", "len", "(", "args", ")", "<", "1", ":", "self", ".", "master", ".", "mav", ".", "command_long_send", "(", "self", ".", "settings", ".", "target_system", ",", "0", ",", "mavutil", ".", "ma...
auto land commands
[ "auto", "land", "commands" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_misc.py#L151-L164
249,182
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_misc.py
MiscModule.cmd_rcbind
def cmd_rcbind(self, args): '''start RC bind''' if len(args) < 1: print("Usage: rcbind <dsmmode>") return self.master.mav.command_long_send(self.settings.target_system, self.settings.target_component, ...
python
def cmd_rcbind(self, args): '''start RC bind''' if len(args) < 1: print("Usage: rcbind <dsmmode>") return self.master.mav.command_long_send(self.settings.target_system, self.settings.target_component, ...
[ "def", "cmd_rcbind", "(", "self", ",", "args", ")", ":", "if", "len", "(", "args", ")", "<", "1", ":", "print", "(", "\"Usage: rcbind <dsmmode>\"", ")", "return", "self", ".", "master", ".", "mav", ".", "command_long_send", "(", "self", ".", "settings", ...
start RC bind
[ "start", "RC", "bind" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_misc.py#L174-L183
249,183
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_misc.py
MiscModule.cmd_repeat
def cmd_repeat(self, args): '''repeat a command at regular intervals''' if len(args) == 0: if len(self.repeats) == 0: print("No repeats") return for i in range(len(self.repeats)): print("%u: %s" % (i, self.repeats[i])) r...
python
def cmd_repeat(self, args): '''repeat a command at regular intervals''' if len(args) == 0: if len(self.repeats) == 0: print("No repeats") return for i in range(len(self.repeats)): print("%u: %s" % (i, self.repeats[i])) r...
[ "def", "cmd_repeat", "(", "self", ",", "args", ")", ":", "if", "len", "(", "args", ")", "==", "0", ":", "if", "len", "(", "self", ".", "repeats", ")", "==", "0", ":", "print", "(", "\"No repeats\"", ")", "return", "for", "i", "in", "range", "(", ...
repeat a command at regular intervals
[ "repeat", "a", "command", "at", "regular", "intervals" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_misc.py#L185-L212
249,184
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_map/__init__.py
MapModule.show_position
def show_position(self): '''show map position click information''' pos = self.click_position dms = (mp_util.degrees_to_dms(pos[0]), mp_util.degrees_to_dms(pos[1])) msg = "Coordinates in WGS84\n" msg += "Decimal: %.6f %.6f\n" % (pos[0], pos[1]) msg += "DMS: %s %s\n" %...
python
def show_position(self): '''show map position click information''' pos = self.click_position dms = (mp_util.degrees_to_dms(pos[0]), mp_util.degrees_to_dms(pos[1])) msg = "Coordinates in WGS84\n" msg += "Decimal: %.6f %.6f\n" % (pos[0], pos[1]) msg += "DMS: %s %s\n" %...
[ "def", "show_position", "(", "self", ")", ":", "pos", "=", "self", ".", "click_position", "dms", "=", "(", "mp_util", ".", "degrees_to_dms", "(", "pos", "[", "0", "]", ")", ",", "mp_util", ".", "degrees_to_dms", "(", "pos", "[", "1", "]", ")", ")", ...
show map position click information
[ "show", "map", "position", "click", "information" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_map/__init__.py#L79-L92
249,185
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_map/__init__.py
MapModule.display_fence
def display_fence(self): '''display the fence''' from MAVProxy.modules.mavproxy_map import mp_slipmap self.fence_change_time = self.module('fence').fenceloader.last_change points = self.module('fence').fenceloader.polygon() self.mpstate.map.add_object(mp_slipmap.SlipClearLayer('F...
python
def display_fence(self): '''display the fence''' from MAVProxy.modules.mavproxy_map import mp_slipmap self.fence_change_time = self.module('fence').fenceloader.last_change points = self.module('fence').fenceloader.polygon() self.mpstate.map.add_object(mp_slipmap.SlipClearLayer('F...
[ "def", "display_fence", "(", "self", ")", ":", "from", "MAVProxy", ".", "modules", ".", "mavproxy_map", "import", "mp_slipmap", "self", ".", "fence_change_time", "=", "self", ".", "module", "(", "'fence'", ")", ".", "fenceloader", ".", "last_change", "points",...
display the fence
[ "display", "the", "fence" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_map/__init__.py#L152-L163
249,186
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_map/__init__.py
MapModule.closest_waypoint
def closest_waypoint(self, latlon): '''find closest waypoint to a position''' (lat, lon) = latlon best_distance = -1 closest = -1 for i in range(self.module('wp').wploader.count()): w = self.module('wp').wploader.wp(i) distance = mp_util.gps_distance(lat, ...
python
def closest_waypoint(self, latlon): '''find closest waypoint to a position''' (lat, lon) = latlon best_distance = -1 closest = -1 for i in range(self.module('wp').wploader.count()): w = self.module('wp').wploader.wp(i) distance = mp_util.gps_distance(lat, ...
[ "def", "closest_waypoint", "(", "self", ",", "latlon", ")", ":", "(", "lat", ",", "lon", ")", "=", "latlon", "best_distance", "=", "-", "1", "closest", "=", "-", "1", "for", "i", "in", "range", "(", "self", ".", "module", "(", "'wp'", ")", ".", "...
find closest waypoint to a position
[ "find", "closest", "waypoint", "to", "a", "position" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_map/__init__.py#L166-L180
249,187
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_map/__init__.py
MapModule.selection_index_to_idx
def selection_index_to_idx(self, key, selection_index): '''return a mission idx from a selection_index''' a = key.split(' ') if a[0] != 'mission' or len(a) != 2: print("Bad mission object %s" % key) return None midx = int(a[1]) if midx < 0 or midx >= len(s...
python
def selection_index_to_idx(self, key, selection_index): '''return a mission idx from a selection_index''' a = key.split(' ') if a[0] != 'mission' or len(a) != 2: print("Bad mission object %s" % key) return None midx = int(a[1]) if midx < 0 or midx >= len(s...
[ "def", "selection_index_to_idx", "(", "self", ",", "key", ",", "selection_index", ")", ":", "a", "=", "key", ".", "split", "(", "' '", ")", "if", "a", "[", "0", "]", "!=", "'mission'", "or", "len", "(", "a", ")", "!=", "2", ":", "print", "(", "\"...
return a mission idx from a selection_index
[ "return", "a", "mission", "idx", "from", "a", "selection_index" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_map/__init__.py#L200-L215
249,188
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_map/__init__.py
MapModule.move_mission
def move_mission(self, key, selection_index): '''move a mission point''' idx = self.selection_index_to_idx(key, selection_index) self.moving_wp = idx print("Moving wp %u" % idx)
python
def move_mission(self, key, selection_index): '''move a mission point''' idx = self.selection_index_to_idx(key, selection_index) self.moving_wp = idx print("Moving wp %u" % idx)
[ "def", "move_mission", "(", "self", ",", "key", ",", "selection_index", ")", ":", "idx", "=", "self", ".", "selection_index_to_idx", "(", "key", ",", "selection_index", ")", "self", ".", "moving_wp", "=", "idx", "print", "(", "\"Moving wp %u\"", "%", "idx", ...
move a mission point
[ "move", "a", "mission", "point" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_map/__init__.py#L217-L221
249,189
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_map/__init__.py
MapModule.remove_mission
def remove_mission(self, key, selection_index): '''remove a mission point''' idx = self.selection_index_to_idx(key, selection_index) self.mpstate.functions.process_stdin('wp remove %u' % idx)
python
def remove_mission(self, key, selection_index): '''remove a mission point''' idx = self.selection_index_to_idx(key, selection_index) self.mpstate.functions.process_stdin('wp remove %u' % idx)
[ "def", "remove_mission", "(", "self", ",", "key", ",", "selection_index", ")", ":", "idx", "=", "self", ".", "selection_index_to_idx", "(", "key", ",", "selection_index", ")", "self", ".", "mpstate", ".", "functions", ".", "process_stdin", "(", "'wp remove %u'...
remove a mission point
[ "remove", "a", "mission", "point" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_map/__init__.py#L223-L226
249,190
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_map/__init__.py
MapModule.create_vehicle_icon
def create_vehicle_icon(self, name, colour, follow=False, vehicle_type=None): '''add a vehicle to the map''' from MAVProxy.modules.mavproxy_map import mp_slipmap if vehicle_type is None: vehicle_type = self.vehicle_type_name if name in self.have_vehicle and self.have_vehicle[...
python
def create_vehicle_icon(self, name, colour, follow=False, vehicle_type=None): '''add a vehicle to the map''' from MAVProxy.modules.mavproxy_map import mp_slipmap if vehicle_type is None: vehicle_type = self.vehicle_type_name if name in self.have_vehicle and self.have_vehicle[...
[ "def", "create_vehicle_icon", "(", "self", ",", "name", ",", "colour", ",", "follow", "=", "False", ",", "vehicle_type", "=", "None", ")", ":", "from", "MAVProxy", ".", "modules", ".", "mavproxy_map", "import", "mp_slipmap", "if", "vehicle_type", "is", "None...
add a vehicle to the map
[ "add", "a", "vehicle", "to", "the", "map" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_map/__init__.py#L338-L348
249,191
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_map/__init__.py
MapModule.drawing_update
def drawing_update(self): '''update line drawing''' from MAVProxy.modules.mavproxy_map import mp_slipmap if self.draw_callback is None: return self.draw_line.append(self.click_position) if len(self.draw_line) > 1: self.mpstate.map.add_object(mp_slipmap.Sli...
python
def drawing_update(self): '''update line drawing''' from MAVProxy.modules.mavproxy_map import mp_slipmap if self.draw_callback is None: return self.draw_line.append(self.click_position) if len(self.draw_line) > 1: self.mpstate.map.add_object(mp_slipmap.Sli...
[ "def", "drawing_update", "(", "self", ")", ":", "from", "MAVProxy", ".", "modules", ".", "mavproxy_map", "import", "mp_slipmap", "if", "self", ".", "draw_callback", "is", "None", ":", "return", "self", ".", "draw_line", ".", "append", "(", "self", ".", "cl...
update line drawing
[ "update", "line", "drawing" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_map/__init__.py#L350-L358
249,192
JdeRobot/base
src/libs/config_py/config/config.py
load
def load(filename): ''' Returns the configuration as dict @param filename: Name of the file @type filename: String @return a dict with propierties reader from file ''' filepath = findConfigFile(filename) prop= None if (filepath): print ('loading Config file %s' %(filepath...
python
def load(filename): ''' Returns the configuration as dict @param filename: Name of the file @type filename: String @return a dict with propierties reader from file ''' filepath = findConfigFile(filename) prop= None if (filepath): print ('loading Config file %s' %(filepath...
[ "def", "load", "(", "filename", ")", ":", "filepath", "=", "findConfigFile", "(", "filename", ")", "prop", "=", "None", "if", "(", "filepath", ")", ":", "print", "(", "'loading Config file %s'", "%", "(", "filepath", ")", ")", "with", "open", "(", "filep...
Returns the configuration as dict @param filename: Name of the file @type filename: String @return a dict with propierties reader from file
[ "Returns", "the", "configuration", "as", "dict" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/libs/config_py/config/config.py#L50-L73
249,193
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_param.py
ParamState.fetch_check
def fetch_check(self, master): '''check for missing parameters periodically''' if self.param_period.trigger(): if master is None: return if len(self.mav_param_set) == 0: master.param_fetch_all() elif self.mav_param_count != 0 and len(se...
python
def fetch_check(self, master): '''check for missing parameters periodically''' if self.param_period.trigger(): if master is None: return if len(self.mav_param_set) == 0: master.param_fetch_all() elif self.mav_param_count != 0 and len(se...
[ "def", "fetch_check", "(", "self", ",", "master", ")", ":", "if", "self", ".", "param_period", ".", "trigger", "(", ")", ":", "if", "master", "is", "None", ":", "return", "if", "len", "(", "self", ".", "mav_param_set", ")", "==", "0", ":", "master", ...
check for missing parameters periodically
[ "check", "for", "missing", "parameters", "periodically" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_param.py#L46-L60
249,194
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/lib/wxsettings.py
WXSettings.watch_thread
def watch_thread(self): '''watch for settings changes from child''' from mp_settings import MPSetting while True: setting = self.child_pipe.recv() if not isinstance(setting, MPSetting): break try: self.settings.set(setting.name,...
python
def watch_thread(self): '''watch for settings changes from child''' from mp_settings import MPSetting while True: setting = self.child_pipe.recv() if not isinstance(setting, MPSetting): break try: self.settings.set(setting.name,...
[ "def", "watch_thread", "(", "self", ")", ":", "from", "mp_settings", "import", "MPSetting", "while", "True", ":", "setting", "=", "self", ".", "child_pipe", ".", "recv", "(", ")", "if", "not", "isinstance", "(", "setting", ",", "MPSetting", ")", ":", "br...
watch for settings changes from child
[ "watch", "for", "settings", "changes", "from", "child" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/lib/wxsettings.py#L36-L46
249,195
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_sensors.py
SensorsModule.report
def report(self, name, ok, msg=None, deltat=20): '''report a sensor error''' r = self.reports[name] if time.time() < r.last_report + deltat: r.ok = ok return r.last_report = time.time() if ok and not r.ok: self.say("%s OK" % name) r.ok ...
python
def report(self, name, ok, msg=None, deltat=20): '''report a sensor error''' r = self.reports[name] if time.time() < r.last_report + deltat: r.ok = ok return r.last_report = time.time() if ok and not r.ok: self.say("%s OK" % name) r.ok ...
[ "def", "report", "(", "self", ",", "name", ",", "ok", ",", "msg", "=", "None", ",", "deltat", "=", "20", ")", ":", "r", "=", "self", ".", "reports", "[", "name", "]", "if", "time", ".", "time", "(", ")", "<", "r", ".", "last_report", "+", "de...
report a sensor error
[ "report", "a", "sensor", "error" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_sensors.py#L82-L93
249,196
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_sensors.py
SensorsModule.report_change
def report_change(self, name, value, maxdiff=1, deltat=10): '''report a sensor change''' r = self.reports[name] if time.time() < r.last_report + deltat: return r.last_report = time.time() if math.fabs(r.value - value) < maxdiff: return r.value = va...
python
def report_change(self, name, value, maxdiff=1, deltat=10): '''report a sensor change''' r = self.reports[name] if time.time() < r.last_report + deltat: return r.last_report = time.time() if math.fabs(r.value - value) < maxdiff: return r.value = va...
[ "def", "report_change", "(", "self", ",", "name", ",", "value", ",", "maxdiff", "=", "1", ",", "deltat", "=", "10", ")", ":", "r", "=", "self", ".", "reports", "[", "name", "]", "if", "time", ".", "time", "(", ")", "<", "r", ".", "last_report", ...
report a sensor change
[ "report", "a", "sensor", "change" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_sensors.py#L95-L104
249,197
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_map/mp_slipmap.py
MPSlipMap.close
def close(self): '''close the window''' self.close_window.release() count=0 while self.child.is_alive() and count < 30: # 3 seconds to die... time.sleep(0.1) #? count+=1 if self.child.is_alive(): self.child.terminate() self.child.join...
python
def close(self): '''close the window''' self.close_window.release() count=0 while self.child.is_alive() and count < 30: # 3 seconds to die... time.sleep(0.1) #? count+=1 if self.child.is_alive(): self.child.terminate() self.child.join...
[ "def", "close", "(", "self", ")", ":", "self", ".", "close_window", ".", "release", "(", ")", "count", "=", "0", "while", "self", ".", "child", ".", "is_alive", "(", ")", "and", "count", "<", "30", ":", "# 3 seconds to die...", "time", ".", "sleep", ...
close the window
[ "close", "the", "window" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_map/mp_slipmap.py#L97-L108
249,198
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_map/mp_slipmap.py
MPSlipMap.hide_object
def hide_object(self, key, hide=True): '''hide an object on the map by key''' self.object_queue.put(SlipHideObject(key, hide))
python
def hide_object(self, key, hide=True): '''hide an object on the map by key''' self.object_queue.put(SlipHideObject(key, hide))
[ "def", "hide_object", "(", "self", ",", "key", ",", "hide", "=", "True", ")", ":", "self", ".", "object_queue", ".", "put", "(", "SlipHideObject", "(", "key", ",", "hide", ")", ")" ]
hide an object on the map by key
[ "hide", "an", "object", "on", "the", "map", "by", "key" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_map/mp_slipmap.py#L122-L124
249,199
JdeRobot/base
src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_map/mp_slipmap.py
MPSlipMap.set_position
def set_position(self, key, latlon, layer=None, rotation=0): '''move an object on the map''' self.object_queue.put(SlipPosition(key, latlon, layer, rotation))
python
def set_position(self, key, latlon, layer=None, rotation=0): '''move an object on the map''' self.object_queue.put(SlipPosition(key, latlon, layer, rotation))
[ "def", "set_position", "(", "self", ",", "key", ",", "latlon", ",", "layer", "=", "None", ",", "rotation", "=", "0", ")", ":", "self", ".", "object_queue", ".", "put", "(", "SlipPosition", "(", "key", ",", "latlon", ",", "layer", ",", "rotation", ")"...
move an object on the map
[ "move", "an", "object", "on", "the", "map" ]
303b18992785b2fe802212f2d758a60873007f1f
https://github.com/JdeRobot/base/blob/303b18992785b2fe802212f2d758a60873007f1f/src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_map/mp_slipmap.py#L126-L128