update.ini: Make sure that [TRAJ]MAX_LINEAR_VELOCITY exists
Joints Axes expects MAX_LINEAR_VELOCITY but most existing configs use MAX_VELOCITY. This change attempts to use whichever exists as MAX_LINEAR_VELOCITY Signed-off-by: andypugh <andy@bodgesoc.org>
This commit is contained in:
parent
30429d703a
commit
3a16c15754
1 changed files with 17 additions and 1 deletions
|
|
@ -205,7 +205,23 @@ if version == "$Revision$" or version < "1.0":
|
||||||
copysection("TASK")
|
copysection("TASK")
|
||||||
copysection("HAL")
|
copysection("HAL")
|
||||||
copysection("HALUI")
|
copysection("HALUI")
|
||||||
copysection("TRAJ")
|
|
||||||
|
# In JA [TRAJ] expects MAX_LINEAR_VELOCITY not MAX_VELOCITY
|
||||||
|
all_sections.remove("TRAJ")
|
||||||
|
section = re.search("\[TRAJ\](.+?)\n\[", inistring, re.DOTALL)
|
||||||
|
if section: section = section.group(1)
|
||||||
|
newini.write("[TRAJ]\n")
|
||||||
|
if section != None:
|
||||||
|
if not re.search("MAX_LINEAR_VELOCITY", section):
|
||||||
|
section = re.sub("MAX_VELOCITY", "MAX_LINEAR_VELOCITY", section)
|
||||||
|
if not re.search("DEFAULT_LINEAR_VELOCITY", section):
|
||||||
|
section = re.sub("DEFAULT_VELOCITY", "DEFAULT_LINEAR_VELOCITY", section)
|
||||||
|
if not re.search("MAX_LINEAR_ACCELERATION", section):
|
||||||
|
section = re.sub("MAX_ACCELERATION", "MAX_LINEAR_ACCELERATION", section)
|
||||||
|
if not re.search("DEFAULT_ACCELERATION", section):
|
||||||
|
section = re.sub("DEFAULT_ACCELERATION", "DEFAULT_LINEAR_ACCELERATION", section)
|
||||||
|
newini.write(section)
|
||||||
|
|
||||||
copysection("EMCIO")
|
copysection("EMCIO")
|
||||||
|
|
||||||
# Insert the new-fangled [KINS] section
|
# Insert the new-fangled [KINS] section
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue