Preferences

Preferences is a method to load/save preferences files, or to add a key in them.

Read the preference chapter below for more details.

Warning:

Preferences files are not something to change unless it is necessary. A bad configuration parameter may damage the robot. Using this method, you can add your own configuration parameter, but do not change the one already set, unless you are asked to.

Note:

Do a pause between a calibration change and the preference save.

Note:

A save in the chest board will result of a stop of USB communication for a few seconds. If the robot is standing, it will certainly fall!

Method

/** * Save or load the pref file or a sub pref file, or change one parameter on the pref file * * @param pAction is a string that could be: "Save" "Load" or "Add" * Save is to save the new configuration value either in a file (Head) or in the chest board (chest) * Load is to read the configuration file again (Device_Head.xml or Device_Body.xml) * Add is to add/chage a new key/value in the pref file. It's only in the DCM memory, and a save is needed after. * @param pWhere is the name of the pref/subpref files used. It could be "Body", "Head", "Main", "All" * @param pKeyName is case of a add, this is the key name to add in the specific pref file. "" if this is not add. * @param pKeyValue this is the value to save for the key name. * */ int DCM::preference(string pAction, string pWhere, string pKeyName, ALValue pKeyValue)

Example of use

Python:

import time import naoqi from naoqi import ALProxy dcm = ALProxy("DCM","127.0.0.1",9559) # Manual calibration on the mechanical stop dcm.calibration(["RHipRoll/Position/Actuator/Value","Manual","InLimit" ]) time.sleep(1) dcm.preferences("Save", "Body", "", 0.0) # to save new calibration

This script changes a calibration and saves it back in the chest board.

Warning:

This is a very dangerous script! Wrong calibration could damage robot articulation.

Python:

import time import naoqi from naoqi import ALProxy dcm = ALProxy("DCM","127.0.0.1",9559) dcm.preferences("Load", "Body", "", 0.0) # to load a new Device_Body.xml file time.sleep(1) dcm.preferences("Save", "Body", "", 0.0) # to save new calibration

This script may be used to download a new sub pref file in the chest board.

Warning:

This is a very dangerous script! Wrong calibration could damage the robot articulation.





Copyright © 2010 Aldebaran-Robotics - All rights reserved