litchi_wp.gimbal

Module for litchi waypoint gimbal settings

 1"""
 2Module for litchi waypoint gimbal settings
 3"""
 4# pylint: disable=import-error
 5from litchi_wp.enums import GimbalMode
 6
 7
 8class Gimbal:
 9    """
10    Class representing litchi waypoint gimbal settings
11
12    Attributes:
13            mode (GimbalMode): The mode for the gimbal setting
14            pitchangle (int): The gimbal angle in degrees
15
16    """
17
18    def __init__(self, mode: GimbalMode = GimbalMode.DISABLED, pitchangle: float = 0):
19        """
20        Constructor
21
22        Args:
23            mode (GimbalMode): The mode for the gimbal (disabled, focus poi or interpolate)
24            pitchangle (float): The gimbal angle in degrees
25
26        Raises:
27            ValueError: If mode is no valid GimbalMode or pitchangle cannot be float
28
29        """
30        self.mode = GimbalMode(mode)
31        self.pitchangle = float(pitchangle)
32
33    def set_focus_poi(self):
34        """
35        Setter for focus poi mode
36        """
37        self.set_mode(GimbalMode.FOCUS_POI)
38
39    def set_interpolate(self, pitchangle: float):
40        """
41        Setter for interpolate mode
42
43        Raises:
44            ValueError: If pitchangle cannot be float
45
46        """
47        self.set_mode(GimbalMode.INTERPOLATE)
48        self.set_pitchangle(pitchangle)
49
50    def set_mode(self, mode: GimbalMode):
51        """
52        Setter for mode
53
54        Args:
55            mode (GimbalMode): The mode for the gimbal (disabled, focus poi or interpolate)
56
57        Raises:
58            ValueError: If mode is no valid GimbalMode
59
60        """
61        self.mode = GimbalMode(mode)
62
63    def set_pitchangle(self, pitchangle: float):
64        """
65        Setter for pitchangle
66
67        Args:
68            pitchangle (float): The gimbal angle in degrees
69
70        Raises:
71            ValueError: If pitchangle cannot be float or pitchangle < -90 or pitchangle > 30
72
73        """
74        if float(pitchangle) < -90 or float(pitchangle) > 30:
75            raise ValueError('allowed range is -90 to 30')
76        self.pitchangle = float(pitchangle)
class Gimbal:
 9class Gimbal:
10    """
11    Class representing litchi waypoint gimbal settings
12
13    Attributes:
14            mode (GimbalMode): The mode for the gimbal setting
15            pitchangle (int): The gimbal angle in degrees
16
17    """
18
19    def __init__(self, mode: GimbalMode = GimbalMode.DISABLED, pitchangle: float = 0):
20        """
21        Constructor
22
23        Args:
24            mode (GimbalMode): The mode for the gimbal (disabled, focus poi or interpolate)
25            pitchangle (float): The gimbal angle in degrees
26
27        Raises:
28            ValueError: If mode is no valid GimbalMode or pitchangle cannot be float
29
30        """
31        self.mode = GimbalMode(mode)
32        self.pitchangle = float(pitchangle)
33
34    def set_focus_poi(self):
35        """
36        Setter for focus poi mode
37        """
38        self.set_mode(GimbalMode.FOCUS_POI)
39
40    def set_interpolate(self, pitchangle: float):
41        """
42        Setter for interpolate mode
43
44        Raises:
45            ValueError: If pitchangle cannot be float
46
47        """
48        self.set_mode(GimbalMode.INTERPOLATE)
49        self.set_pitchangle(pitchangle)
50
51    def set_mode(self, mode: GimbalMode):
52        """
53        Setter for mode
54
55        Args:
56            mode (GimbalMode): The mode for the gimbal (disabled, focus poi or interpolate)
57
58        Raises:
59            ValueError: If mode is no valid GimbalMode
60
61        """
62        self.mode = GimbalMode(mode)
63
64    def set_pitchangle(self, pitchangle: float):
65        """
66        Setter for pitchangle
67
68        Args:
69            pitchangle (float): The gimbal angle in degrees
70
71        Raises:
72            ValueError: If pitchangle cannot be float or pitchangle < -90 or pitchangle > 30
73
74        """
75        if float(pitchangle) < -90 or float(pitchangle) > 30:
76            raise ValueError('allowed range is -90 to 30')
77        self.pitchangle = float(pitchangle)

Class representing litchi waypoint gimbal settings

Attributes:
  • mode (GimbalMode): The mode for the gimbal setting
  • pitchangle (int): The gimbal angle in degrees
Gimbal( mode: litchi_wp.enums.GimbalMode = <GimbalMode.DISABLED: 0>, pitchangle: float = 0)
19    def __init__(self, mode: GimbalMode = GimbalMode.DISABLED, pitchangle: float = 0):
20        """
21        Constructor
22
23        Args:
24            mode (GimbalMode): The mode for the gimbal (disabled, focus poi or interpolate)
25            pitchangle (float): The gimbal angle in degrees
26
27        Raises:
28            ValueError: If mode is no valid GimbalMode or pitchangle cannot be float
29
30        """
31        self.mode = GimbalMode(mode)
32        self.pitchangle = float(pitchangle)

Constructor

Arguments:
  • mode (GimbalMode): The mode for the gimbal (disabled, focus poi or interpolate)
  • pitchangle (float): The gimbal angle in degrees
Raises:
  • ValueError: If mode is no valid GimbalMode or pitchangle cannot be float
def set_focus_poi(self) -> None:
34    def set_focus_poi(self):
35        """
36        Setter for focus poi mode
37        """
38        self.set_mode(GimbalMode.FOCUS_POI)

Setter for focus poi mode

def set_interpolate(self, pitchangle: float):
40    def set_interpolate(self, pitchangle: float):
41        """
42        Setter for interpolate mode
43
44        Raises:
45            ValueError: If pitchangle cannot be float
46
47        """
48        self.set_mode(GimbalMode.INTERPOLATE)
49        self.set_pitchangle(pitchangle)

Setter for interpolate mode

Raises:
  • ValueError: If pitchangle cannot be float
def set_mode(self, mode: litchi_wp.enums.GimbalMode):
51    def set_mode(self, mode: GimbalMode):
52        """
53        Setter for mode
54
55        Args:
56            mode (GimbalMode): The mode for the gimbal (disabled, focus poi or interpolate)
57
58        Raises:
59            ValueError: If mode is no valid GimbalMode
60
61        """
62        self.mode = GimbalMode(mode)

Setter for mode

Arguments:
  • mode (GimbalMode): The mode for the gimbal (disabled, focus poi or interpolate)
Raises:
  • ValueError: If mode is no valid GimbalMode
def set_pitchangle(self, pitchangle: float):
64    def set_pitchangle(self, pitchangle: float):
65        """
66        Setter for pitchangle
67
68        Args:
69            pitchangle (float): The gimbal angle in degrees
70
71        Raises:
72            ValueError: If pitchangle cannot be float or pitchangle < -90 or pitchangle > 30
73
74        """
75        if float(pitchangle) < -90 or float(pitchangle) > 30:
76            raise ValueError('allowed range is -90 to 30')
77        self.pitchangle = float(pitchangle)

Setter for pitchangle

Arguments:
  • pitchangle (float): The gimbal angle in degrees
Raises:
  • ValueError: If pitchangle cannot be float or pitchangle < -90 or pitchangle > 30