mrtautopilot 9__tar.gz → 10__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mrtautopilot-9 → mrtautopilot-10}/PKG-INFO +1 -1
- {mrtautopilot-9 → mrtautopilot-10}/mrtautopilot/__init__.py +1 -1
- {mrtautopilot-9 → mrtautopilot-10}/mrtautopilot/autopilot.py +46 -0
- {mrtautopilot-9 → mrtautopilot-10}/mrtautopilot.egg-info/PKG-INFO +1 -1
- {mrtautopilot-9 → mrtautopilot-10}/README.md +0 -0
- {mrtautopilot-9 → mrtautopilot-10}/mrtautopilot/mission.py +0 -0
- {mrtautopilot-9 → mrtautopilot-10}/mrtautopilot.egg-info/SOURCES.txt +0 -0
- {mrtautopilot-9 → mrtautopilot-10}/mrtautopilot.egg-info/dependency_links.txt +0 -0
- {mrtautopilot-9 → mrtautopilot-10}/mrtautopilot.egg-info/requires.txt +0 -0
- {mrtautopilot-9 → mrtautopilot-10}/mrtautopilot.egg-info/top_level.txt +0 -0
- {mrtautopilot-9 → mrtautopilot-10}/pyproject.toml +0 -0
- {mrtautopilot-9 → mrtautopilot-10}/setup.cfg +0 -0
- {mrtautopilot-9 → mrtautopilot-10}/tests/test_mission.py +0 -0
|
@@ -460,6 +460,7 @@ class MavlinkThread:
|
|
|
460
460
|
):
|
|
461
461
|
self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
|
462
462
|
self.sock.setblocking(False)
|
|
463
|
+
self.msg_callback: Callable[[mrtmavlink.MAVLink_message], None] = lambda x: None
|
|
463
464
|
|
|
464
465
|
if multicast_group:
|
|
465
466
|
self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
|
@@ -561,7 +562,13 @@ class MavlinkThread:
|
|
|
561
562
|
self.ack_result = result
|
|
562
563
|
self.ack_cond.notify()
|
|
563
564
|
|
|
565
|
+
def register_message_callback(
|
|
566
|
+
self, callback: Callable[[mrtmavlink.MAVLink_message], None]
|
|
567
|
+
):
|
|
568
|
+
self.msg_callback = callback
|
|
569
|
+
|
|
564
570
|
def _msg_callback(self, msg: mrtmavlink.MAVLink_message):
|
|
571
|
+
self.msg_callback(msg)
|
|
565
572
|
sys_id = msg.get_srcSystem()
|
|
566
573
|
logging.debug(f"Received: {msg.msgname}, sys_id={sys_id}, {msg}")
|
|
567
574
|
if self.system_id != sys_id:
|
|
@@ -1070,3 +1077,42 @@ class MavlinkThread:
|
|
|
1070
1077
|
|
|
1071
1078
|
finally:
|
|
1072
1079
|
self.is_sending_mission = False
|
|
1080
|
+
|
|
1081
|
+
def set_attitude(
|
|
1082
|
+
self,
|
|
1083
|
+
roll_rad: float = 0,
|
|
1084
|
+
pitch_rad: float = 0,
|
|
1085
|
+
yaw_rad: float = 0,
|
|
1086
|
+
roll_rate_rps: float = 0,
|
|
1087
|
+
pitch_rate_rps: float = 0,
|
|
1088
|
+
yaw_rate_rps: float = 0,
|
|
1089
|
+
):
|
|
1090
|
+
self.loop.call_soon_threadsafe(
|
|
1091
|
+
lambda: self._set_attitude(
|
|
1092
|
+
roll_rad,
|
|
1093
|
+
pitch_rad,
|
|
1094
|
+
yaw_rad,
|
|
1095
|
+
roll_rate_rps,
|
|
1096
|
+
pitch_rate_rps,
|
|
1097
|
+
yaw_rate_rps,
|
|
1098
|
+
)
|
|
1099
|
+
)
|
|
1100
|
+
|
|
1101
|
+
def _set_attitude(
|
|
1102
|
+
self,
|
|
1103
|
+
roll_rad: float,
|
|
1104
|
+
pitch_rad: float,
|
|
1105
|
+
yaw_rad: float,
|
|
1106
|
+
roll_rate_rps: float,
|
|
1107
|
+
pitch_rate_rps: float,
|
|
1108
|
+
yaw_rate_rps: float,
|
|
1109
|
+
):
|
|
1110
|
+
self.conn.attitude_send(
|
|
1111
|
+
0,
|
|
1112
|
+
roll_rad,
|
|
1113
|
+
pitch_rad,
|
|
1114
|
+
yaw_rad,
|
|
1115
|
+
roll_rate_rps,
|
|
1116
|
+
pitch_rate_rps,
|
|
1117
|
+
yaw_rate_rps,
|
|
1118
|
+
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|