Mapper feature#

event message olympe.messages.mapper.active_product(product=None, _policy='check_wait', _float_tol=(1e-07, 1e-09))#

mapper.active_product

This event notifies the application about the currently active product, thus allowing the application to diplay and edit the current mapping without having to guess from other sources.

Parameters:
  • product (u16) – Product (see libARDiscovery for list)

  • _policy (olympe.arsdkng.expectations.ExpectPolicy) – specify how to check the expectation. Possible values are ‘check’, ‘wait’ and ‘check_wait’ (defaults to ‘check_wait’)

  • _float_tol (tuple) – specify the float comparison tolerance, a 2-tuple containing a relative tolerance float value and an absolute tolerate float value (default to (1e-07, 1e-09)). See python 3 stdlib math.isclose documentation for more information

Supported by:

SkyController3:

with an up to date firmware

Triggered when the active product changes

event message olympe.messages.mapper.application_axis_event(action=None, value=None, _policy='check_wait', _float_tol=(1e-07, 1e-09))#

mapper.application_axis_event

This event signals the controller application when an application specific axis_event is triggered. Application specific actions are typically used for UI interaction which does not involves the drone.

Parameters:
  • action (olympe.enums.mapper.axis_action) –

  • value (i8) – The current value of the axis.

  • _policy (olympe.arsdkng.expectations.ExpectPolicy) – specify how to check the expectation. Possible values are ‘check’, ‘wait’ and ‘check_wait’ (defaults to ‘check_wait’)

  • _float_tol (tuple) – specify the float comparison tolerance, a 2-tuple containing a relative tolerance float value and an absolute tolerate float value (default to (1e-07, 1e-09)). See python 3 stdlib math.isclose documentation for more information

Supported by:

SkyController3:

with an up to date firmware

Triggered when any axis action set to application_action is triggered.

event message olympe.messages.mapper.application_button_event(action=None, _policy='check_wait', _float_tol=(1e-07, 1e-09))#

mapper.application_button_event

This event signals the controller application when an application specific button_event is triggered. Application specific actions are typically used for UI interaction which does not involves the drone.

Parameters:
  • action (olympe.enums.mapper.button_action) –

  • _policy (olympe.arsdkng.expectations.ExpectPolicy) – specify how to check the expectation. Possible values are ‘check’, ‘wait’ and ‘check_wait’ (defaults to ‘check_wait’)

  • _float_tol (tuple) – specify the float comparison tolerance, a 2-tuple containing a relative tolerance float value and an absolute tolerate float value (default to (1e-07, 1e-09)). See python 3 stdlib math.isclose documentation for more information

Supported by:

SkyController3:

with an up to date firmware

Triggered when any button action set to application_action is triggered.

event message olympe.messages.mapper.axis_mapping_item(uid=None, product=None, action=None, axis=None, buttons=None, list_flags=None, _policy='check_wait', _float_tol=(1e-07, 1e-09))#

mapper.axis_mapping_item

The resulting map describes all active axis mappings of the mapper. Each action can only be mapped once per product.

Parameters:
  • uid (u32) – Unique ID of the mapping.

  • product (u16) – Product (see libARDiscovery for list)

  • action (olympe.enums.mapper.axis_action) –

  • axis (i32) – The axis number on which the action is mapped.

  • buttons (u32) – Buttons combination mapped to the action (bitfield).

  • list_flags (BitfieldOf(olympe.enums.mapper.list_flags, u8)) –

  • _policy (olympe.arsdkng.expectations.ExpectPolicy) – specify how to check the expectation. Possible values are ‘check’, ‘wait’ and ‘check_wait’ (defaults to ‘check_wait’)

  • _float_tol (tuple) – specify the float comparison tolerance, a 2-tuple containing a relative tolerance float value and an absolute tolerate float value (default to (1e-07, 1e-09)). See python 3 stdlib math.isclose documentation for more information

Supported by:

SkyController3:

with an up to date firmware

Triggered by a map_button_action() or a map_axis_action() command

event message olympe.messages.mapper.button_mapping_item(uid=None, product=None, action=None, buttons=None, list_flags=None, _policy='check_wait', _float_tol=(1e-07, 1e-09))#

mapper.button_mapping_item

The resulting map describes all active button mappings of the mapper. Each action can only be mapped once per product.

Parameters:
  • uid (u32) – Unique ID of the mapping.

  • product (u16) – Product (see libARDiscovery for list)

  • action (olympe.enums.mapper.button_action) –

  • buttons (u32) – Buttons combination mapped to the action (bitfield).

  • list_flags (BitfieldOf(olympe.enums.mapper.list_flags, u8)) –

  • _policy (olympe.arsdkng.expectations.ExpectPolicy) – specify how to check the expectation. Possible values are ‘check’, ‘wait’ and ‘check_wait’ (defaults to ‘check_wait’)

  • _float_tol (tuple) – specify the float comparison tolerance, a 2-tuple containing a relative tolerance float value and an absolute tolerate float value (default to (1e-07, 1e-09)). See python 3 stdlib math.isclose documentation for more information

Supported by:

SkyController3:

with an up to date firmware

Triggered by a map_button_action() or a map_axis_action() command

command message olympe.messages.mapper.enter_volatile_mapping(_timeout=10, _no_expect=False, _float_tol=(1e-07, 1e-09))#

mapper.enter_volatile_mapping

All mappings in this mode will disappear when exit will be called or when device is unplugged.

Parameters:
  • _timeout (int) – command message timeout (defaults to 10)

  • _no_expect (bool) – if True for,do not expect the usual command expectation (defaults to False)

  • _float_tol (tuple) – specify the float comparison tolerance, a 2-tuple containing a relative tolerance float value and an absolute tolerate float value (default to (1e-07, 1e-09)). See python 3 stdlib math.isclose documentation for more information

Supported by:

SkyController3:

with an up to date firmware

Result: Event volatile_mapping_state()

Expectations: volatile_mapping_state(active=1, _policy='wait')

command message olympe.messages.mapper.exit_volatile_mapping(_timeout=10, _no_expect=False, _float_tol=(1e-07, 1e-09))#

mapper.exit_volatile_mapping

Destroy volatile mapping. Any current action is canceled, for example PCMD will become null even if PCMD axis are pushed, the user has to release the axis to recover PCMD control.

Parameters:
  • _timeout (int) – command message timeout (defaults to 10)

  • _no_expect (bool) – if True for,do not expect the usual command expectation (defaults to False)

  • _float_tol (tuple) – specify the float comparison tolerance, a 2-tuple containing a relative tolerance float value and an absolute tolerate float value (default to (1e-07, 1e-09)). See python 3 stdlib math.isclose documentation for more information

Supported by:

SkyController3:

with an up to date firmware

Result: Event volatile_mapping_state()

Expectations: volatile_mapping_state(active=0, _policy='wait')

event message olympe.messages.mapper.expo_map_item(uid=None, product=None, axis=None, expo=None, list_flags=None, _policy='check_wait', _float_tol=(1e-07, 1e-09))#

mapper.expo_map_item

By default, each axis can have a different expo value. For some products/mappings configuration, the expo values of two axes belonging to the same physical joystick can be locked to the same value. In this case, setting the value for one axis will automatically change both values.

Parameters:
  • uid (u32) – Unique ID (for MAP_ITEM type)

  • product (u16) – Product (see libARDiscovery for list)

  • axis (i32) – Axis number

  • expo (olympe.enums.mapper.expo_type) –

  • list_flags (BitfieldOf(olympe.enums.mapper.list_flags, u8)) –

  • _policy (olympe.arsdkng.expectations.ExpectPolicy) – specify how to check the expectation. Possible values are ‘check’, ‘wait’ and ‘check_wait’ (defaults to ‘check_wait’)

  • _float_tol (tuple) – specify the float comparison tolerance, a 2-tuple containing a relative tolerance float value and an absolute tolerate float value (default to (1e-07, 1e-09)). See python 3 stdlib math.isclose documentation for more information

Supported by:

SkyController3:

with an up to date firmware

Triggered by a set_expo() command

command message olympe.messages.mapper.grab(buttons, axes, _timeout=10, _no_expect=False, _float_tol=(1e-07, 1e-09))#

mapper.grab

Grabbed buttons are sent to the app and are not handled by the mapper

Parameters:
  • buttons (u32) – Buttons to grab/ungrab (bitfield)

  • axes (u32) – Axes to grab/ungrab (bitfield)

  • _timeout (int) – command message timeout (defaults to 10)

  • _no_expect (bool) – if True for,do not expect the usual command expectation (defaults to False)

  • _float_tol (tuple) – specify the float comparison tolerance, a 2-tuple containing a relative tolerance float value and an absolute tolerate float value (default to (1e-07, 1e-09)). See python 3 stdlib math.isclose documentation for more information

Supported by:

SkyController3:

with an up to date firmware

Result: The mapper will send a grab_state() command

Expectations: grab_state(buttons=self.buttons, axes=self.axes, _policy='wait')

event message olympe.messages.mapper.grab_axis_event(axis=None, value=None, _policy='check_wait', _float_tol=(1e-07, 1e-09))#

mapper.grab_axis_event

The state of a grabbed axis changes

Parameters:
  • axis (u32) – Axis id

  • value (i8) – Value in range [-100; 100].

  • _policy (olympe.arsdkng.expectations.ExpectPolicy) – specify how to check the expectation. Possible values are ‘check’, ‘wait’ and ‘check_wait’ (defaults to ‘check_wait’)

  • _float_tol (tuple) – specify the float comparison tolerance, a 2-tuple containing a relative tolerance float value and an absolute tolerate float value (default to (1e-07, 1e-09)). See python 3 stdlib math.isclose documentation for more information

Supported by:

SkyController3:

with an up to date firmware

Triggered when the value of a grabbed axis changes

event message olympe.messages.mapper.grab_button_event(button=None, event=None, _policy='check_wait', _float_tol=(1e-07, 1e-09))#

mapper.grab_button_event

The state of a grabbed button changes

Parameters:
  • button (u32) – Button id

  • event (olympe.enums.mapper.button_event) –

  • _policy (olympe.arsdkng.expectations.ExpectPolicy) – specify how to check the expectation. Possible values are ‘check’, ‘wait’ and ‘check_wait’ (defaults to ‘check_wait’)

  • _float_tol (tuple) – specify the float comparison tolerance, a 2-tuple containing a relative tolerance float value and an absolute tolerate float value (default to (1e-07, 1e-09)). See python 3 stdlib math.isclose documentation for more information

Supported by:

SkyController3:

with an up to date firmware

Triggered when a grabbed button is pressed/released

event message olympe.messages.mapper.grab_state(buttons=None, axes=None, buttons_state=None, _policy='check_wait', _float_tol=(1e-07, 1e-09))#

mapper.grab_state

Grabbed buttons are sent to the app and are not handled by the mapper

Parameters:
  • buttons (u32) – Grabbed buttons (bitfield)

  • axes (u32) – Grabbed axes (bitfield)

  • buttons_state (u32) – For grabbed buttons only. State of the button when the grab starts (bitfield)

  • _policy (olympe.arsdkng.expectations.ExpectPolicy) – specify how to check the expectation. Possible values are ‘check’, ‘wait’ and ‘check_wait’ (defaults to ‘check_wait’)

  • _float_tol (tuple) – specify the float comparison tolerance, a 2-tuple containing a relative tolerance float value and an absolute tolerate float value (default to (1e-07, 1e-09)). See python 3 stdlib math.isclose documentation for more information

Supported by:

SkyController3:

with an up to date firmware

Triggered by a grab() command

event message olympe.messages.mapper.inverted_map_item(uid=None, product=None, axis=None, inverted=None, list_flags=None, _policy='check_wait', _float_tol=(1e-07, 1e-09))#

mapper.inverted_map_item

Axis inversion has no effect on grabbed axes, nor on virtual buttons that might be generated from axes.

Parameters:
  • uid (u32) – Unique ID (for MAP_ITEM type)

  • product (u16) – Product (see libARDiscovery for list)

  • axis (i32) – Axis number

  • inverted (u8) – 0 : Axis not inverted. 1 : Axis inverted

  • list_flags (BitfieldOf(olympe.enums.mapper.list_flags, u8)) –

  • _policy (olympe.arsdkng.expectations.ExpectPolicy) – specify how to check the expectation. Possible values are ‘check’, ‘wait’ and ‘check_wait’ (defaults to ‘check_wait’)

  • _float_tol (tuple) – specify the float comparison tolerance, a 2-tuple containing a relative tolerance float value and an absolute tolerate float value (default to (1e-07, 1e-09)). See python 3 stdlib math.isclose documentation for more information

Supported by:

SkyController3:

with an up to date firmware

Triggered by a set_inverted() command

command message olympe.messages.mapper.map_axis_action(product, action, axis, buttons, _timeout=10, _no_expect=False, _float_tol=(1e-07, 1e-09))#

mapper.map_axis_action

An action can only be mapped to one axis/button set. Each action can be mapped to different axes/buttons for different products.

Parameters:
  • product (u16) – Product (see libARDiscovery for list)

  • action (olympe.enums.mapper.axis_action) –

  • axis (i32) – The axis number on which the action will be mapped. Set a negative value to unmap the action.

  • buttons (u32) – Buttons combination mapped to the action (bitfield). Can be zero if no buttons are required.

  • _timeout (int) – command message timeout (defaults to 10)

  • _no_expect (bool) – if True for,do not expect the usual command expectation (defaults to False)

  • _float_tol (tuple) – specify the float comparison tolerance, a 2-tuple containing a relative tolerance float value and an absolute tolerate float value (default to (1e-07, 1e-09)). See python 3 stdlib math.isclose documentation for more information

Supported by:

SkyController3:

with an up to date firmware

Result: The mapper will send button_mapping_item() and axis_mapping_item() according to the request.

Expectations: button_mapping_item(product=self.product, action=self.action, buttons=self.buttons, _policy='wait') & axis_mapping_item(product=self.product, action=self.action, buttons=self.buttons, _policy='wait')

command message olympe.messages.mapper.map_button_action(product, action, buttons, _timeout=10, _no_expect=False, _float_tol=(1e-07, 1e-09))#

mapper.map_button_action

An action can only be mapped to one button set. Each action can be mapped to different buttons for different products.

Parameters:
  • product (u16) – Product (see libARDiscovery for list)

  • action (olympe.enums.mapper.button_action) –

  • buttons (u32) – Buttons combination mapped to the action (bitfield). Set 0 (no button) to unmap an action

  • _timeout (int) – command message timeout (defaults to 10)

  • _no_expect (bool) – if True for,do not expect the usual command expectation (defaults to False)

  • _float_tol (tuple) – specify the float comparison tolerance, a 2-tuple containing a relative tolerance float value and an absolute tolerate float value (default to (1e-07, 1e-09)). See python 3 stdlib math.isclose documentation for more information

Supported by:

SkyController3:

with an up to date firmware

Result: The mapper will send button_mapping_item() and axis_mapping_item() according to the request.

Expectations: (button_mapping_item(list_flags='Last', _policy='wait') | button_mapping_item(list_flags='Empty', _policy='wait')) & (axis_mapping_item(list_flags='Last', _policy='wait') | axis_mapping_item(list_flags='Empty', _policy='wait'))

command message olympe.messages.mapper.reset_mapping(product, _timeout=10, _no_expect=False, _float_tol=(1e-07, 1e-09))#

mapper.reset_mapping

Resets the mappings, axis exponential parameters, and axis inversion for the given product. If the product is given as 0 (zero), the all products are reset.

Parameters:
  • product (u16) – The product to reset, or 0 to reset all products.

  • _timeout (int) – command message timeout (defaults to 10)

  • _no_expect (bool) – if True for,do not expect the usual command expectation (defaults to False)

  • _float_tol (tuple) – specify the float comparison tolerance, a 2-tuple containing a relative tolerance float value and an absolute tolerate float value (default to (1e-07, 1e-09)). See python 3 stdlib math.isclose documentation for more information

Supported by:

SkyController3:

with an up to date firmware

Result: The mapper will send button_mapping_item(), axis_mapping_item(), expo_map_item() and inverted_map_item() according to the request.

command message olympe.messages.mapper.set_expo(product, axis, expo, _timeout=10, _no_expect=False, _float_tol=(1e-07, 1e-09))#

mapper.set_expo

By default, each axis can have a different expo value. For some products/mappings configuration, the expo values of two axes belonging to the same physical joystick can be locked to the same value. In this case, setting the value for one axis will automatically change both values.

Parameters:
  • product (u16) – Product (see libARDiscovery for list). Set to 0 to apply to all products

  • axis (i32) – Axis number. Set to -1 to apply to all axes.

  • expo (olympe.enums.mapper.expo_type) –

  • _timeout (int) – command message timeout (defaults to 10)

  • _no_expect (bool) – if True for,do not expect the usual command expectation (defaults to False)

  • _float_tol (tuple) – specify the float comparison tolerance, a 2-tuple containing a relative tolerance float value and an absolute tolerate float value (default to (1e-07, 1e-09)). See python 3 stdlib math.isclose documentation for more information

Supported by:

SkyController3:

with an up to date firmware

Result: The mapper will send expo_map_item()

Expectations: (expo_map_item(list_flags='Last', _policy='wait') | expo_map_item(list_flags='Empty', _policy='wait'))

command message olympe.messages.mapper.set_inverted(product, axis, inverted, _timeout=10, _no_expect=False, _float_tol=(1e-07, 1e-09))#

mapper.set_inverted

Axis inversion has no effect on grabbed axes, nor on virtual buttons that might be generated from axes.

Parameters:
  • product (u16) – Product (see libARDiscovery for list). Set to 0 to apply to all products

  • axis (i32) – Axis number

  • inverted (u8) – 0 : Axis not inverted. 1 : Axis inverted

  • _timeout (int) – command message timeout (defaults to 10)

  • _no_expect (bool) – if True for,do not expect the usual command expectation (defaults to False)

  • _float_tol (tuple) – specify the float comparison tolerance, a 2-tuple containing a relative tolerance float value and an absolute tolerate float value (default to (1e-07, 1e-09)). See python 3 stdlib math.isclose documentation for more information

Supported by:

SkyController3:

with an up to date firmware

Result: The mapper will send inverted_map_item()

Expectations: (inverted_map_item(list_flags='Last', _policy='wait') | inverted_map_item(list_flags='Empty', _policy='wait'))

event message olympe.messages.mapper.volatile_mapping_state(active=None, _policy='check_wait', _float_tol=(1e-07, 1e-09))#

mapper.volatile_mapping_state

Volatile mapping state

Parameters:
  • active (u8) – 0 : Volatile mapping is not active. 1 : Volatile mapping is active.

  • _policy (olympe.arsdkng.expectations.ExpectPolicy) – specify how to check the expectation. Possible values are ‘check’, ‘wait’ and ‘check_wait’ (defaults to ‘check_wait’)

  • _float_tol (tuple) – specify the float comparison tolerance, a 2-tuple containing a relative tolerance float value and an absolute tolerate float value (default to (1e-07, 1e-09)). See python 3 stdlib math.isclose documentation for more information

Supported by:

SkyController3:

with an up to date firmware

Triggered During connection, by enter_volatile_mapping() and exit_volatile_mapping()

enum olympe.enums.mapper.axis_action#

The action (mapped on an axis)

app_0:

Action handled by the application (0)

app_1:

Action handled by the application (1)

app_2:

Action handled by the application (2)

app_3:

Action handled by the application (3)

app_4:

Action handled by the application (4)

app_5:

Action handled by the application (5)

app_6:

Action handled by the application (6)

app_7:

Action handled by the application (7)

app_8:

Action handled by the application (8)

app_9:

Action handled by the application (9)

app_10:

Action handled by the application (10)

app_11:

Action handled by the application (11)

app_12:

Action handled by the application (12)

app_13:

Action handled by the application (13)

app_14:

Action handled by the application (14)

app_15:

Action handled by the application (15)

roll:

roll (16)

pitch:

pitch (17)

yaw:

yaw (18)

gaz:

gaz (19)

camera_pan:

camera pan (20)

camera_tilt:

camera tilt (21)

camera_zoom:

camera zoom (22)

enum olympe.enums.mapper.button_action#

The action (mapped on a button)

app_0:

Action handled by the application (0)

app_1:

Action handled by the application (1)

app_2:

Action handled by the application (2)

app_3:

Action handled by the application (3)

app_4:

Action handled by the application (4)

app_5:

Action handled by the application (5)

app_6:

Action handled by the application (6)

app_7:

Action handled by the application (7)

app_8:

Action handled by the application (8)

app_9:

Action handled by the application (9)

app_10:

Action handled by the application (10)

app_11:

Action handled by the application (11)

app_12:

Action handled by the application (12)

app_13:

Action handled by the application (13)

app_14:

Action handled by the application (14)

app_15:

Action handled by the application (15)

return_home:

Return to home (16)

takeoff_land:

Take off or land (17)

video_record:

Start/stop video record (18)

take_picture:

Take a picture (19)

camera_exposition_inc:

Increment camera exposition (20)

camera_exposition_dec:

Decrement camera exposition (21)

flip_left:

Flip left (22)

flip_right:

Flip right (23)

flip_front:

Flip front (24)

flip_back:

Flip back (25)

emergency:

Emergency motors shutdown (26)

center_camera:

Reset camera to its default position (27)

cycle_hud:

Cycle between different hud configurations on HDMI (Skycontroller 1 only) (28)

camera_auto:

In picture mode: take a picture In record mode: start/stop record (29)

debug_tag:

Add a debug tag to logs, and send it to the drone (30)

smart_takeoff_land:

Smart take off or land (Drone will decide what to do) (31)

toggle_antenna:

toggle between internal and external antenna (32)

enum olympe.enums.mapper.button_event#

Button event

release:

button released (0)

press:

button pressed (1)

enum olympe.enums.mapper.expo_type#

Expo type

linear:

No expo applied, axis is linear (0)

expo_0:

Light exponential curve (1)

expo_1:

Medium exponential curve (2)

expo_2:

Heavy exponential curve (3)

expo_4:

Maximum exponential curve (4)

enum olympe.enums.mapper.list_flags#

Arsdk built-in “list_flags” enum that is used to in “LIST_ITEM” event messages

First:

Arsdk built-in “list_flags” enum that is used to in “LIST_ITEM” event messages (0)

Last:

Arsdk built-in “list_flags” enum that is used to in “LIST_ITEM” event messages (1)

Empty:

Arsdk built-in “list_flags” enum that is used to in “LIST_ITEM” event messages (2)

Remove:

Arsdk built-in “list_flags” enum that is used to in “LIST_ITEM” event messages (3)