@@ -60,8 +60,8 @@ def check_coords(value, robot_limit, class_name, exception_class):
60
60
for idx , coord in enumerate (value ):
61
61
if not robot_limit [class_name ]["coords_min" ][idx ] <= coord <= robot_limit [class_name ]["coords_max" ][idx ]:
62
62
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
65
65
)
66
66
)
67
67
@@ -132,11 +132,11 @@ def public_check(parameter_list, kwargs, robot_limit, class_name, exception_clas
132
132
)
133
133
elif parameter == 'angle' :
134
134
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 ]:
137
137
raise exception_class (
138
138
"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
140
140
)
141
141
)
142
142
elif parameter == 'encoders' :
@@ -193,11 +193,11 @@ def calibration_parameters(**kwargs):
193
193
check_id (value , robot_limit [class_name ][parameter ], CobotXDataException )
194
194
elif parameter == 'angle' :
195
195
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 ]:
198
198
raise CobotXDataException (
199
199
"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
201
201
)
202
202
)
203
203
# elif parameter == 'angles':
@@ -212,11 +212,12 @@ def calibration_parameters(**kwargs):
212
212
# )
213
213
214
214
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 ]:
217
218
raise CobotXDataException (
218
219
"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
220
221
)
221
222
)
222
223
elif parameter == 'coords' :
0 commit comments