HelperA2GMeasurements
Communication between the nodes handler
Bases: object
Python class for handling the interaction between the multiple devices available in the system: gps, gimbal and rfsoc.
It creates instances of each class handling one of those devices (i.e. GimbalRS2, GpsSignaling).
It creates a wireless TCP connection between the host computers of both nodes (air and ground node) to control devices and retrieve information from them.
It creates a thread (called here communication thread) to handle the communication between the host computers of both nodes.
-
MAX_TIME_EMPTY_SOCKETS: the maximum allowed time to wait if no information was sent over a socket. -
CONN_MUST_OVER_FLAG: a (boolean) flag indicating whether to close or not the connection between the host computers. -
drone_fm_flag: a (boolean) flag set at the GUI indicating whether the air node's gimbal should follow the ground node. In all our documentation, a gimbal is said to be in "follow mode" (don't confuse with DJI's RS2 camera-based follow mode) if it follows the other node. -
PAP_TO_PLOT: a numpy array (of size defined in the methodpipeline_operations_rfsoc_rx_ndarrayof the classRFSoCRemoteControlFromHost) used to plot the Power Angular Profile (PAP) of the wireless channel in GUI's PAP Panel.
Source code in a2gmeasurements.py
1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 | |
HelperA2GStopCom(DISC_WHAT='ALL', stream=1)
Stops connection with all the devices or the specified ones in the variable 'DISC_WHAT.
When called, no matter which is the value of DISC_WHAT, always close the TCP socket.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
DISC_WHAT |
str
|
specifies with which/s device/s the connection must be ended. Options are: |
'ALL'
|
stream |
int
|
gps stream to be closed. Assuming there is only one gps stream created at |
1
|
Source code in a2gmeasurements.py
2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 | |
HelperStartA2GCom(PORT=10000)
Starts the socket binding, listening and accepting for server side, or connecting for client side. The ground node works as the server while the drone as the client.
Creates and starts the thread handling the socket messages.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
PORT |
int
|
TCP port. Defaults to 10000. |
10000
|
Source code in a2gmeasurements.py
__init__(ID, SERVER_ADDRESS, DBG_LVL_0=False, DBG_LVL_1=False, IsGimbal=False, IsGPS=False, IsSignalGenerator=False, IsRFSoC=False, rfsoc_static_ip_address=None, F0=None, L0=None, SPEED=0, GPS_Stream_Interval='msec500', AVG_CALLBACK_TIME_SOCKET_RECEIVE_FCN=0.001, operating_freq=57510000000.0, heading_offset=0)
Creates instances of classes GimbalRS2 (or GimbalGremsyH16), GpsSignaling, RFSoCRemoteControlFromHost to control these devices.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ID |
str
|
either 'DRONE' or 'GND'. |
required |
SERVER_ADDRESS |
str
|
the IP address of the ground station. |
required |
DBG_LVL_0 |
bool
|
if set, prints some low-level messages usefull for debugging. Defaults to False. |
False
|
DBG_LVL_1 |
bool
|
if set, prints some higher-level messages usefull for debugging. Defaults to False. |
False
|
IsGimbal |
bool
|
0 or FALSE, when no gimbal is physically connected to this host computer; 1, when a Ronin RS2 is physically connected; 2, when a Gremsy H16 is physically connected. Defaults to False. |
False
|
IsGPS |
bool
|
True if a gps is physically connected to this host computer. False otherwise. Defaults to False. |
False
|
IsSignalGenerator |
bool
|
True if a signal generator controlled by pyvisa commands is physically connected to this host computer. False otherwise. Defaults to False. |
False
|
IsRFSoC |
bool
|
True if an RFSoC is physically connected to this host computer. False otherwise. Defaults to False. |
False
|
rfsoc_static_ip_address |
str
|
IP address of the RFSoC connected to this host computer. Defaults to None. |
None
|
L0 |
float
|
parameter of the signal generator. Defaults to None. |
None
|
SPEED |
int
|
the speed of the node in m/s. If this node is GROUND it should be 0 (gnd node does not move) as it is by default. This parameter ONLY incides in raising a warning debug print when the speed of the node is higher than the time difference between consecutive SBF sentences. NOT a crutial parameter at all. Stays here for back compatibility. Defaults to 0. |
0
|
GPS_Stream_Interval |
str
|
time interval used for the retrieving of the configured SBF sentences in Septentrio's receiver connected to this host computer. A list of available options is shown in |
'msec500'
|
AVG_CALLBACK_TIME_SOCKET_RECEIVE_FCN |
float
|
approximated time between calls of the communication thread. This parameter is used in conjunction with |
0.001
|
operating_freq |
_type_
|
operating frequency of the Sivers RF-frontend. The range of defined frequencies is defined in the "User Manual EVK06002" of the Sivers EVK (57-71 GHz). Defaults to 57.51e9. |
57510000000.0
|
heading_offset |
int
|
heading offset (check its definition in the |
0
|
Source code in a2gmeasurements.py
1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 | |
az_rot_gnd_gimbal_toggle_sig_generator(Naz, meas_time=10, filename=None)
Rotates the ground gimbal into "Naz" azimuth steps, while stopping at each angle step, to turn on the signal generator, wait for it "meas_time"[seconds] to send signal, and turn it off again.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
az_now |
int
|
angle where to start the count. It lies between -1800 and 1800 |
required |
Naz |
int
|
number of sectors in azimuth circle |
required |
Source code in a2gmeasurements.py
2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 | |
decode_message(data)
Parses an incoming TCP message and calls the appropriate function to handle it.
This function is called by socket_receive (the communication thread callback).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data |
bytes
|
raw data to be decoded |
required |
Source code in a2gmeasurements.py
1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 | |
do_closed_gui_action()
Callback function when this node receives a CLOSEDGUI command.
This comand is unidirectional. It is always sent by the ground node to the drone node.
Sets a flag indicating (the drone node) that it can end its main script, since the GUI was closed by the user at the ground node.
Source code in a2gmeasurements.py
do_finish_meas_drone_rfsoc()
Callback function when this node receives a FINISHDRONERFSOC command.
This comand is unidirectional. It is always sent by the ground node to the drone node.
The purpose is to finish the experiment (as defined in "Manual A2GMeasurements"). When the experiment is finished the GUI allows the user to end (disconnect) the connection between both nodes.
Source code in a2gmeasurements.py
do_follow_mode_gimbal(fmode=0)
Callback function when this node receives a FOLLOWGIMBAL command.
The FOLLOWGIMBAL command is sent when the other node asks for this node's GPS information to be able to follow this node's movement.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fmode |
hexadecimal
|
specifies whether the other node shall follow this node's movement in: 0x00, Elevation and azimuth; 0x01, Only elevation; 0x02, Only azimuth. Defaults to 0x00. |
0
|
Source code in a2gmeasurements.py
do_getgps_action(follow_mode_gimbal=False, fmode=0)
Callback function when this node receives a GETGPS command.
The GETGPS commmand differentiates from FOLLOWGIMBAL in that when the other node only request GPS information from this node (i.e. for display the coordinates on a panel of the GUI), the follow_mode_gimbal is False as well as the FMODE key of the sent dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
follow_mode_gimbal |
bool
|
True if other node's gimbal must follow this node's movement. Defaults to False. |
False
|
fmode |
hexadecimal
|
specifies whether the other node shall follow this node's movement in: 0x00, Elevation and azimuth; 0x01, Only elevation; 0x02, Only azimuth. Defaults to 0x00. |
0
|
Source code in a2gmeasurements.py
1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 | |
do_set_irf_action(msg_data)
Callback function when this node receives a SETIRF command.
This comand is unidirectional. It is always sent by the drone node to the ground node.
Receives from the drone a subsampled version of the Power Angular Profile for it to be used by the GUI to continuously plot it in its PAP panel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
msg_data |
ndarray
|
attribute value |
required |
Source code in a2gmeasurements.py
do_set_remote_fm_flag(data=None)
Callback function when this node receives a SETREMOTEFMFLAG command.
This comand is unidirectional. It is always sent by the ground node to the drone node.
Sets the drone_fm_flag. When this flag is set, the drone node can start sending FOLLOWGIMBALL commands to the ground node to get ground node's coordinates and be able to follow (drone node) it (ground node).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data |
dict
|
dictionary with keys 'X', 'Y', 'Z', 'FMODE', 'MOBILITY', corresponding to geocentric coordinates. The mentioned keys and their corresponding values refer to the ground node. The coordinates will be available if the ground node |
None
|
Source code in a2gmeasurements.py
do_set_remote_stop_fm()
Callback function when this node receives a SETREMOTESTOPFM command.
This comand is unidirectional. It is always sent by the ground node to the drone node.
Unsets the drone_fm_flag flag.
Source code in a2gmeasurements.py
do_setgimbal_action(msg_data)
Callback function when this node receives a SETGIMBAL command.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
msg_data |
dict
|
dictionary with keys 'YAW', 'PITCH' and 'MODE'. The 'YAW' values range between [-1800, 1800]. The 'PITCH' values are restricted (by software) to the interval [-600, 600] to avoid hits between the case and the gimbal. The 'MODE' values are: 0x00, consider 'YAW' and/or 'PITCH' values as relative to the actual position of the gimbal; 0x01, consider 'YAW' and/or 'PITCH' values as relative to the absolute 0 (in both azimuth and elevation) position. |
required |
Source code in a2gmeasurements.py
do_start_meas_drone_rfsoc(msg_data)
Callback function when this node receives a STARTDRONERFSOC command.
This comand is unidirectional. It is always sent by the ground node to the drone node.
The purpose is to start the RFSoC thread (created in RFSoCRemoteControlFromHost class) responsible for retrieving the measured Channel Impulse Response from the RFSoC.
It is assumed that prior to this callback, the ground rfsoc (tx) has started sending the its sounding signal and there were no issues.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
msg_data |
dict
|
dictionary with keys 'carrier_freq', 'rx_gain_ctrl_bb1', 'rx_gain_ctrl_bb2', 'rx_gain_ctrl_bb3', 'rx_gain_ctrl_bfrf'. More information about these keys can be found in method |
required |
Source code in a2gmeasurements.py
do_stop_meas_drone_rfsoc()
Callback function when this node receives a STOPDRONERFSOC command.
This comand is unidirectional. It is always sent by the ground node to the drone node.
The purpose is to stop the RFSoC thread.
It is assumed that prior to this function, the ground rfsoc (tx) has started sending the its sounding signal and there were no issues.
Source code in a2gmeasurements.py
encode_message(source_id, destination_id, message_type, cmd, data=None)
Encodes a TCP message to be sent. More information about the specific commands is in the section "Communication Protocol" of the "Manual A2GMeasurements".
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source_id |
int
|
identifies the sender node with a number (this parameter is provided for -potential- future improvements but does not have any functionality). |
required |
destination_id |
int
|
identifies the receiver node with a number (this parameter is provided for -potential- future improvements but does not have any functionality). |
required |
message_type |
hexadecimal
|
0x01, for a short type of message; 0x02, for a long type of message; 0x03, to answer/acknowledge a received request. More information about this is in "Manual A2GMeasurements". |
required |
cmd |
hexadecimal
|
one of the supported requests/commands for each |
required |
data |
dict
|
additional data required by the request/command. The particular data sent depends on the |
None
|
Returns: message (bytes): the bytes object representing the message to be sent.
Source code in a2gmeasurements.py
2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 | |
gimbal_follows_drone(heading=None, lat_ground=None, lon_ground=None, height_ground=None, lat_drone=None, lon_drone=None, height_drone=None, fmode=0)
Computes the yaw, pitch and roll angles required to move the gimbal in this node towards the other node.
The caller of this function must guarantee that if self.ID == 'GROUND', the arguments passed to this function are drone coords. The ground coords SHOULD NOT be passed as they will be obtained from this node Septentrio's receiver.
The caller of this function must guarantee that if self.ID == 'DRONE', the arguments passed to this function are ground coords. The drone coords SHOULD NOT be passed as they will be obtained from this node Septentrio's receiver.
If IsGPS is False (no GPS connected), then heading, lat_ground, lon_ground, height_ground, lat_drone, lon_drone, height_drone must be provided.
In that case, all coordinates provided must be geodetic (lat, lon, alt).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
heading |
float
|
angle between [0, 2*pi] (rads) corresponding to the heading of the line between the two antennas connected to Septentrio's receiver in this node. Defaults to None. |
None
|
lat_ground |
float
|
latitude of the GPS antenna 1 connected to Septentrio's receiver at the GROUND node. Defaults to None. |
None
|
lon_ground |
float
|
longitude of the GPS antenna 1 connected to Septentrio's receiver at the GROUND node. Defaults to None. |
None
|
height_ground |
float
|
height of the GPS antenna 1 connected to Septentrio's receiver at the GROUND node. Assuming both antennas are placed at the same height, is the altitude (in meters above sea level) of the either of the antennas. Defaults to None. |
None
|
lat_drone |
float
|
latitude of the GPS antenna 1 connected to Septentrio's receiver at the DRONE node. Defaults to None. |
None
|
lon_drone |
float
|
longitude of the GPS antenna 1 connected to Septentrio's receiver at the DRONE node. Defaults to None. |
None
|
height_drone |
float
|
height of the GPS antenna 1 connected to Septentrio's receiver at the DRONE node. Assuming both antennas are placed at the same height, is the altitude (in meters above sea level) of the either of the antennas. Defaults to None. |
None
|
fmode |
hexadecimal
|
defines if the gimbal will follow the other node in Azimuth, elevation or both of them. Options are: 0x00, for Azimuth and elevation; 0x01, for Elevation, 0x02, for Azimuth. Defaults to 0x00. |
0
|
Returns:
| Name | Type | Description |
|---|---|---|
yaw_to_set |
(int, optional)
|
yaw angle to be set at the gimbal of this node, in degrees multiplied by 10 and rounded to the closest integer (i.e. a yaw to set of 45.78 degrees is returned as the yaw value 458) |
pitch_to_set |
(int, optional)
|
pitch angle to be set at the gimbal of this node, to follow the other node. The actual value is the angle value in degrees multiplied by 10 and rounded to the closest integer (i.e. a yaw to set of 45.78 degrees is returned as the yaw value 458). |
Source code in a2gmeasurements.py
1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 | |
process_answer_get_gps(data)
Callback function when this node receives an ANS type of message (the equivalent to an acknowledment) from the other node, after this node sent to the other node a GETGPS or a FOLLOWGIMBAL command.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data |
dict
|
dictionary with keys 'X', 'Y', 'Z', 'FMODE', 'FOLLOW_GIMBAL'. The values of 'X', 'Y', 'Z' are the geocentric coordinates from the other node. 'FMODE' is either 0x00 (Elevation and Azimuth), 0x01 (Elevation) or 0x02 (Azimuth). 'FOLLOW_GIMBAL' is either True (when the sent command by this node was |
required |
Source code in a2gmeasurements.py
1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 | |
socket_receive(stop_event)
The communication thread callback. Calls the parser to decode the most recent TCP message received.
The time between calls of this function is OS and hardware dependent.
As both nodes can send and receive messages, this thread
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stop_event |
Event
|
when this is set, this function has nothing to execute. |
required |
Source code in a2gmeasurements.py
socket_send_cmd(type_cmd=None, data=None)
Creates a message by the name of the request/command. Wrapper to encode_message.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
type_cmd |
int
|
refers to the |
None
|
data |
int
|
refers to the |
None
|