@@ -60,8 +60,8 @@ def check_coords(value, robot_limit, class_name, exception_class):
6060 for idx , coord in enumerate (value ):
6161 if not robot_limit [class_name ]["coords_min" ][idx ] <= coord <= robot_limit [class_name ]["coords_max" ][idx ]:
6262 raise exception_class (
63- "Has invalid coord value, error on index {0}. angle should be {1} ~ {2}." .format (
64- idx , robot_limit [class_name ]["coords_min" ][idx ], robot_limit [class_name ]["coords_max" ][idx ]
63+ "Has invalid coord value, error on index {0}. received {3} .but angle should be {1} ~ {2}." .format (
64+ idx , robot_limit [class_name ]["coords_min" ][idx ], robot_limit [class_name ]["coords_max" ][idx ], coord
6565 )
6666 )
6767
@@ -132,11 +132,11 @@ def public_check(parameter_list, kwargs, robot_limit, class_name, exception_clas
132132 )
133133 elif parameter == 'angle' :
134134 id = kwargs .get ('id' , None )
135- index = robot_limit [class_name ]['id' ][id - 1 ]
136- if index < robot_limit [class_name ]["angles_min" ][index ] or index > robot_limit [class_name ]["angles_max" ][index ]:
135+ index = robot_limit [class_name ]['id' ][id - 1 ] - 1
136+ if value < robot_limit [class_name ]["angles_min" ][index ] or value > robot_limit [class_name ]["angles_max" ][index ]:
137137 raise exception_class (
138138 "angle value not right, should be {0} ~ {1}, but received {2}" .format (
139- robot_limit [class_name ]["angles_min" ], robot_limit [class_name ]["angles_max" ][index ], value
139+ robot_limit [class_name ]["angles_min" ][ index ] , robot_limit [class_name ]["angles_max" ][index ], value
140140 )
141141 )
142142 elif parameter == 'encoders' :
@@ -193,11 +193,11 @@ def calibration_parameters(**kwargs):
193193 check_id (value , robot_limit [class_name ][parameter ], CobotXDataException )
194194 elif parameter == 'angle' :
195195 id = kwargs .get ('id' , None )
196- index = robot_limit [class_name ]['id' ][id - 1 ]
197- if index < robot_limit [class_name ]["angles_min" ][index ] or index > robot_limit [class_name ]["angles_max" ][index ]:
196+ index = robot_limit [class_name ]['id' ][id - 1 ] - 1
197+ if value < robot_limit [class_name ]["angles_min" ][index ] or value > robot_limit [class_name ]["angles_max" ][index ]:
198198 raise CobotXDataException (
199199 "angle value not right, should be {0} ~ {1}, but received {2}" .format (
200- robot_limit [class_name ]["angles_min" ], robot_limit [class_name ]["angles_max" ][index ], value
200+ robot_limit [class_name ]["angles_min" ][ index ] , robot_limit [class_name ]["angles_max" ][index ], value
201201 )
202202 )
203203 # elif parameter == 'angles':
@@ -212,11 +212,12 @@ def calibration_parameters(**kwargs):
212212 # )
213213
214214 elif parameter == 'coord' :
215- index = robot_limit [class_name ][kwargs .get ('id' , None )- 1 ]
216- if index < robot_limit [class_name ]["coords_min" ][index ] or index > robot_limit [class_name ]["coords_max" ][index ]:
215+
216+ index = kwargs .get ('id' , None ) - 1
217+ if value < robot_limit [class_name ]["coords_min" ][index ] or value > robot_limit [class_name ]["coords_max" ][index ]:
217218 raise CobotXDataException (
218219 "coord value not right, should be {0} ~ {1}, but received {2}" .format (
219- robot_limit [class_name ]["coords_min" ], robot_limit [class_name ]["coords_max" ][index ], value
220+ robot_limit [class_name ]["coords_min" ][ index ] , robot_limit [class_name ]["coords_max" ][index ], value
220221 )
221222 )
222223 elif parameter == 'coords' :
0 commit comments