Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions examples/parameters/persistent_params_from_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,25 @@
"""
import argparse
import logging
import os

import cflib.crtp
from cflib.crazyflie import Crazyflie
from cflib.crazyflie.syncCrazyflie import SyncCrazyflie
from cflib.utils import uri_helper
from cflib.utils.param_file_helper import ParamFileHelper


uri = uri_helper.uri_from_env(default='radio://0/80/2M/E7E7E7E7E7')

# Only output errors from the logging framework
logging.basicConfig(level=logging.ERROR)

default_file = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'persistent_params_from_file.yaml')

if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('-f', '--file', type=str, help='The yaml file containing the arguments. ')
parser.add_argument('-f', '--file', type=str, default=default_file,
help='The yaml file containing the arguments. (default: params.yaml)')
args = parser.parse_args()

cflib.crtp.init_drivers()
Expand Down
8 changes: 8 additions & 0 deletions examples/parameters/persistent_params_from_file.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Example file for writing persistent parameters using a file
params:
Comment thread
ArisMorgens marked this conversation as resolved.
activeMarker.back:
default_value: 3
is_stored: true
stored_value: 30
type: persistent_param_state
version: '1'
Loading