File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
clearpath_generator_common/clearpath_generator_common Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -336,7 +336,8 @@ def __init__(self,
336
336
setup_path : str = '/etc/clearpath/' ) -> None :
337
337
# Define paths
338
338
self .config_path = os .path .join (setup_path , 'robot.yaml' )
339
- assert os .path .exists (self .config_path )
339
+ if not os .path .exists (self .config_path ):
340
+ raise FileNotFoundError (f'Config path { self .config_path } does not exist' )
340
341
341
342
self .setup_path = setup_path
342
343
self .sensors_params_path = os .path .join (
Original file line number Diff line number Diff line change 31
31
# of Clearpath Robotics.
32
32
from typing import List
33
33
34
+ from clearpath_config .common .types .exception import (
35
+ UnsupportedAccessoryException ,
36
+ )
34
37
from clearpath_config .manipulators .types .arms import (
35
38
BaseArm ,
36
39
Franka ,
@@ -145,7 +148,10 @@ def __init__(self, gripper: FrankaGripper):
145
148
class BaseRobotiqGripperDescription (BaseDescription ):
146
149
147
150
def __init__ (self , gripper : BaseGripper ):
148
- assert isinstance (gripper , Robotiq2F85 ) or isinstance (gripper , Robotiq2F140 )
151
+ if not (isinstance (gripper , Robotiq2F85 ) or isinstance (gripper , Robotiq2F140 )):
152
+ raise UnsupportedAccessoryException (
153
+ f'Gripper must be of type "Robotiq2F85" or "Robotiq2F140", not "{ type (gripper )} "' # noqa: E501
154
+ )
149
155
super ().__init__ (gripper )
150
156
if (gripper .arm .MANIPULATOR_MODEL == KinovaGen3Dof6 .MANIPULATOR_MODEL or
151
157
gripper .arm .MANIPULATOR_MODEL == KinovaGen3Dof7 .MANIPULATOR_MODEL ):
You can’t perform that action at this time.
0 commit comments