2626
2727
2828class TorqueCalculator :
29- def __init__ (self , robot_description : Union [ str , Path ] ):
29+ def __init__ (self , robot_description : str ):
3030 """
3131 Initialize the Torques_calculator with the URDF model or XML format provided by robot_description topic.
3232
33- :param urdf_path: Path to the URDF file of the robot.
34- :param robot_description: Robot description in XML format provided by /robot_description topic or path of URDF file.
33+ :param robot_description: Robot description in XML format provided by /robot_description topic.
3534 """
3635
3736 # Load the robot model from path or XML string
@@ -56,8 +55,8 @@ def __init__(self, robot_description : Union[str, Path]):
5655
5756 os .unlink (temp_urdf_path )
5857
59- elif isinstance ( robot_description , Path ) :
60- self . model = pin . buildModelFromUrdf ( str ( robot_description . resolve ()) )
58+ else :
59+ raise ValueError ( " robot_description must be a string containing the URDF XML or the path to the URDF file" )
6160
6261 # create data for the robot model
6362 self .data = self .model .createData ()
@@ -69,7 +68,8 @@ def __init__(self, robot_description : Union[str, Path]):
6968 # compute main trees of the robot model
7069 self .compute_subtrees ()
7170
72-
71+ # array to store all analyzed points
72+ self .analyzed_points = np .array ([], dtype = object )
7373
7474 # array to store all configurations for the robot model
7575 self .configurations = np .array ([], dtype = object )
0 commit comments