uav.vehicles.px4_modes#

Attributes#

Classes#

FloatEnum

Create a collection of name/value pairs.

PX4CustomMainMode

Create a collection of name/value pairs.

PX4CustomSubModeAuto

Create a collection of name/value pairs.

PX4CustomSubModePosctl

Create a collection of name/value pairs.

PX4CustomMode

Functions#

get_px4_custom_mode(→ PX4CustomMode)

Translate a navigation state into a PX4 custom mode.

Module Contents#

class FloatEnum(*args, **kwds)#

Bases: enum.Enum

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

    >>> Color.RED
    <Color.RED: 1>
    
  • value lookup:

    >>> Color(1)
    <Color.RED: 1>
    
  • name lookup:

    >>> Color['RED']
    <Color.RED: 1>
    

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

class PX4CustomMainMode(*args, **kwds)#

Bases: FloatEnum

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

    >>> Color.RED
    <Color.RED: 1>
    
  • value lookup:

    >>> Color(1)
    <Color.RED: 1>
    
  • name lookup:

    >>> Color['RED']
    <Color.RED: 1>
    

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

MANUAL = 1.0#
ALTCTL = 2.0#
POSCTL = 3.0#
AUTO = 4.0#
ACRO = 5.0#
OFFBOARD = 6.0#
STABILIZED = 7.0#
RATTITUDE_LEGACY = 8.0#
SIMPLE = 9.0#
TERMINATION = 10.0#
class PX4CustomSubModeAuto(*args, **kwds)#

Bases: FloatEnum

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

    >>> Color.RED
    <Color.RED: 1>
    
  • value lookup:

    >>> Color(1)
    <Color.RED: 1>
    
  • name lookup:

    >>> Color['RED']
    <Color.RED: 1>
    

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

READY = 1.0#
TAKEOFF = 2.0#
LOITER = 3.0#
MISSION = 4.0#
RTL = 5.0#
LAND = 6.0#
RESERVED_DO_NOT_USE = 7.0#
FOLLOW_TARGET = 8.0#
PRECLAND = 9.0#
VTOL_TAKEOFF = 10.0#
EXTERNAL1 = 11.0#
EXTERNAL2 = 12.0#
EXTERNAL3 = 13.0#
EXTERNAL4 = 14.0#
EXTERNAL5 = 15.0#
EXTERNAL6 = 16.0#
EXTERNAL7 = 17.0#
EXTERNAL8 = 18.0#
class PX4CustomSubModePosctl(*args, **kwds)#

Bases: FloatEnum

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

    >>> Color.RED
    <Color.RED: 1>
    
  • value lookup:

    >>> Color(1)
    <Color.RED: 1>
    
  • name lookup:

    >>> Color['RED']
    <Color.RED: 1>
    

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

POSCTL = 0.0#
ORBIT = 1.0#
SLOW = 2.0#
type PX4ModeValue = int | float | PX4CustomMainMode | PX4CustomSubModeAuto | PX4CustomSubModePosctl#
class PX4CustomMode(main_mode: PX4ModeValue = 0, sub_mode: PX4ModeValue = 0, reserved: int = 0)#
reserved = 0#
main_mode = 0#
sub_mode = 0#
__repr__() str#
NAVIGATION_STATE_MANUAL = 0.0#
NAVIGATION_STATE_ALTCTL = 1.0#
NAVIGATION_STATE_POSCTL = 2.0#
NAVIGATION_STATE_POSITION_SLOW = 3.0#
NAVIGATION_STATE_AUTO_MISSION = 4.0#
NAVIGATION_STATE_AUTO_LOITER = 5.0#
NAVIGATION_STATE_AUTO_RTL = 6.0#
NAVIGATION_STATE_ACRO = 7.0#
NAVIGATION_STATE_DESCEND = 8.0#
NAVIGATION_STATE_TERMINATION = 9.0#
NAVIGATION_STATE_OFFBOARD = 10.0#
NAVIGATION_STATE_STAB = 11.0#
NAVIGATION_STATE_AUTO_TAKEOFF = 12.0#
NAVIGATION_STATE_AUTO_LAND = 13.0#
NAVIGATION_STATE_AUTO_FOLLOW_TARGET = 14.0#
NAVIGATION_STATE_AUTO_PRECLAND = 15.0#
NAVIGATION_STATE_ORBIT = 16.0#
NAVIGATION_STATE_AUTO_VTOL_TAKEOFF = 17.0#
NAVIGATION_STATE_EXTERNAL1 = 18.0#
NAVIGATION_STATE_EXTERNAL2 = 19.0#
NAVIGATION_STATE_EXTERNAL3 = 20.0#
NAVIGATION_STATE_EXTERNAL4 = 21.0#
NAVIGATION_STATE_EXTERNAL5 = 22.0#
NAVIGATION_STATE_EXTERNAL6 = 23.0#
NAVIGATION_STATE_EXTERNAL7 = 24.0#
NAVIGATION_STATE_EXTERNAL8 = 25.0#
get_px4_custom_mode(nav_state: float) PX4CustomMode#

Translate a navigation state into a PX4 custom mode.

nav_state = 4.0#