Generate posit_n parameters from posn attributes in the motor configuration CSV files.
This commit is contained in:
@ -197,7 +197,9 @@ foreach mn [lsort -dictionary [array names motor_attcnt]] {
|
||||
#TODO Sort posits by value can we take into acount if cnts_per_x is -ve or +ve?
|
||||
set posit_nameval_list {}
|
||||
foreach att [setdiff $mot_attlist $ALL_ATTRIBUTES] {
|
||||
lappend posit_nameval_list "$att [set ${mn}_attarr($att)]"
|
||||
if [regexp {^pos\d\d*$} $att] {
|
||||
lappend posit_nameval_list "$att [set ${mn}_attarr($att)]"
|
||||
}
|
||||
}
|
||||
if {[llength $posit_nameval_list] > 0} {
|
||||
set posnum 0
|
||||
@ -248,15 +250,15 @@ foreach mn [lsort -dictionary [array names motor_attcnt]] {
|
||||
}
|
||||
}
|
||||
if {[info exists ::${mn}_attarr(dflt_speed_steps)] && ![info exists ${mn}_attarr(speed)]} {
|
||||
set speed_phys_units [ expr double([set ::${mn}_attarr(dflt_speed_steps)]) / abs([set ::${mn}_attarr(steps_per_x)]) ]
|
||||
set speed_phys_units [ expr abs(double([set ::${mn}_attarr(dflt_speed_steps)]) / [set ::${mn}_attarr(steps_per_x)]) ]
|
||||
lappend ::autogen_attarr($mn) "${mn}_speed,[format "%.4f" $speed_phys_units]"
|
||||
}
|
||||
if {[info exists ::${mn}_attarr(dflt_accel_steps)] && ![info exists ${mn}_attarr(accel)]} {
|
||||
set accel_phys_units [ expr double([set ::${mn}_attarr(dflt_accel_steps)]) / abs([set ::${mn}_attarr(steps_per_x)]) ]
|
||||
set accel_phys_units [ expr abs(double([set ::${mn}_attarr(dflt_accel_steps)]) / [set ::${mn}_attarr(steps_per_x)]) ]
|
||||
lappend ::autogen_attarr($mn) "${mn}_accel,[format "%.4f" $accel_phys_units]"
|
||||
}
|
||||
if {[info exists ::${mn}_attarr(dflt_decel_steps)] && ![info exists ${mn}_attarr(decel)]} {
|
||||
set decel_phys_units [ expr double([set ::${mn}_attarr(dflt_decel_steps)]) / abs([set ::${mn}_attarr(steps_per_x)]) ]
|
||||
set decel_phys_units [ expr abs(double([set ::${mn}_attarr(dflt_decel_steps)]) / [set ::${mn}_attarr(steps_per_x)]) ]
|
||||
lappend ::autogen_attarr($mn) "${mn}_decel,[format "%.4f" $decel_phys_units]"
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user