prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Robot Model-Specific Parameters Should be in External Files
  Robot Model-Specific Parameters (e.g., MDH, joint limits, etc) Should be in External Files (e.g., csv, json, etc). This way, new models and modifications to models are not tied to the codebase. `robot_model.py` should be deprecated and example models should be saved in a separate `example` folder in the repo.
  
  </issue>
  <code>
  [start of pybotics/__init__.py]
  1 # make the follow accessible from pybotics namespace
  2 from . import geometry
  3 from . import kinematics
  4 from .robot import *
  5 from . import robot_model
  6
  [end of pybotics/__init__.py]
  [start of pybotics/robot_model.py]
  1 import numpy as np
  2 
  3 '''
  4 Modified DH parameter matrices of various robots (rx, tx, rz, tz) aka (alpha, a, theta, d)
  5 '''
  6 
  7 
  8 def ur10():
  9     model = np.array([
  10         [0, 0, 0, 118.0],
  11         [np.pi / 2.0, 0, np.pi, 0],
  12         [0, 612.7, 0, 0],
  13         [0, 571.6, 0, 163.9],
  14         [-np.pi / 2.0, 0, 0, 115.7],
  15         [np.pi / 2.0, 0, np.pi, 92.2]
  16     ])
  17     return model
  18 
  19 
  20 def puma_560():
  21     model = np.array([
  22         [0, 0, 0, 0],
  23         [-np.pi / 2.0, 0, 0, 0],
  24         [0, 612.7, 0, 0],
  25         [0, 571.6, 0, 163.9],
  26         [-np.pi / 2.0, 0, 0, 115.7],
  27         [np.pi / 2.0, 0, np.pi, 92.2]
  28     ])
  29     return model
  30 
  31 
  32 def kuka_lbr_iiwa_7():
  33     model = np.array([
  34         [0, 0, 0, 340],
  35         [-np.pi / 2.0, 0, 0, 0],
  36         [np.pi / 2.0, 0, 0, 400],
  37         [np.pi / 2.0, 0, 0, 0],
  38         [-np.pi / 2.0, 0, 0, 400],
  39         [-np.pi / 2.0, 0, 0, 0],
  40         [np.pi / 2.0, 0, 0, 126]
  41     ])
  42     return model
  43
  [end of pybotics/robot_model.py]
  [start of examples/example_robot.py]
  1 import copy
  2 
  3 import pybotics as py
  4 import numpy as np
  5 
  6 # set numpy print options
  7 np.set_printoptions(precision=3)
  8 np.set_printoptions(suppress=True)
  9 
  10 # create robot
  11 ideal_robot = py.Robot()
  12 ideal_robot.robot_model = py.robot_model.ur10()
  13 
  14 # create pseudo-realistic robot with kinematic errors
  15 real_robot = copy.deepcopy(ideal_robot)
  16 real_robot.impair_robot_model()
  17 
  18 print('Ideal Robot Model:\n', ideal_robot.robot_model, '\n')
  19 print('Pseudo-Real Robot Model:\n', real_robot.robot_model, '\n')
  20 
  21 # demonstrate forward kinematics
  22 joints = [0, 0, 0, 0, 0, 0]
  23 
  24 print('Ideal Pose:\n', ideal_robot.fk(joints), '\n')
  25 print('Pseudo-Real Pose:\n', real_robot.fk(joints), '\n')
  26
  [end of examples/example_robot.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/examples/example_robot.py b/examples/example_robot.py
  --- a/examples/example_robot.py
  +++ b/examples/example_robot.py
  @@ -8,18 +8,17 @@
   np.set_printoptions(suppress=True)
   
   # create robot
  -ideal_robot = py.Robot()
  -ideal_robot.robot_model = py.robot_model.ur10()
  +model = np.loadtxt('ur10-mdh.csv', delimiter=',')
  +robot = py.Robot(model)
   
  -# create pseudo-realistic robot with kinematic errors
  -real_robot = copy.deepcopy(ideal_robot)
  -real_robot.impair_robot_model()
  -
  -print('Ideal Robot Model:\n', ideal_robot.robot_model, '\n')
  -print('Pseudo-Real Robot Model:\n', real_robot.robot_model, '\n')
  +print('Robot Model:\n{}\n'.format(robot.robot_model))
   
   # demonstrate forward kinematics
  -joints = [0, 0, 0, 0, 0, 0]
  +joints = [0] * robot.num_dof()
  +pose = robot.fk(joints)
  +
  +print('Pose:\n{}\n'.format(pose))
   
  -print('Ideal Pose:\n', ideal_robot.fk(joints), '\n')
  -print('Pseudo-Real Pose:\n', real_robot.fk(joints), '\n')
  +# demonstrate inverse kinematics
  +new_joints = robot.ik(pose)
  +print('Solved Joints:\n{}\n'.format(new_joints))
  diff --git a/pybotics/__init__.py b/pybotics/__init__.py
  --- a/pybotics/__init__.py
  +++ b/pybotics/__init__.py
  @@ -1,5 +1,4 @@
   # make the follow accessible from pybotics namespace
   from . import geometry
   from . import kinematics
  -from .robot import *
  -from . import robot_model
  +from .robot import Robot
  diff --git a/pybotics/robot_model.py b/pybotics/robot_model.py
  deleted file mode 100644
  --- a/pybotics/robot_model.py
  +++ /dev/null
  @@ -1,42 +0,0 @@
  -import numpy as np
  -
  -'''
  -Modified DH parameter matrices of various robots (rx, tx, rz, tz) aka (alpha, a, theta, d)
  -'''
  -
  -
  -def ur10():
  -    model = np.array([
  -        [0, 0, 0, 118.0],
  -        [np.pi / 2.0, 0, np.pi, 0],
  -        [0, 612.7, 0, 0],
  -        [0, 571.6, 0, 163.9],
  -        [-np.pi / 2.0, 0, 0, 115.7],
  -        [np.pi / 2.0, 0, np.pi, 92.2]
  -    ])
  -    return model
  -
  -
  -def puma_560():
  -    model = np.array([
  -        [0, 0, 0, 0],
  -        [-np.pi / 2.0, 0, 0, 0],
  -        [0, 612.7, 0, 0],
  -        [0, 571.6, 0, 163.9],
  -        [-np.pi / 2.0, 0, 0, 115.7],
  -        [np.pi / 2.0, 0, np.pi, 92.2]
  -    ])
  -    return model
  -
  -
  -def kuka_lbr_iiwa_7():
  -    model = np.array([
  -        [0, 0, 0, 340],
  -        [-np.pi / 2.0, 0, 0, 0],
  -        [np.pi / 2.0, 0, 0, 400],
  -        [np.pi / 2.0, 0, 0, 0],
  -        [-np.pi / 2.0, 0, 0, 400],
  -        [-np.pi / 2.0, 0, 0, 0],
  -        [np.pi / 2.0, 0, 0, 126]
  -    ])
  -    return model
  
verification_info: {"golden_diff": "diff --git a/examples/example_robot.py b/examples/example_robot.py\n--- a/examples/example_robot.py\n+++ b/examples/example_robot.py\n@@ -8,18 +8,17 @@\n np.set_printoptions(suppress=True)\n \n # create robot\n-ideal_robot = py.Robot()\n-ideal_robot.robot_model = py.robot_model.ur10()\n+model = np.loadtxt('ur10-mdh.csv', delimiter=',')\n+robot = py.Robot(model)\n \n-# create pseudo-realistic robot with kinematic errors\n-real_robot = copy.deepcopy(ideal_robot)\n-real_robot.impair_robot_model()\n-\n-print('Ideal Robot Model:\\n', ideal_robot.robot_model, '\\n')\n-print('Pseudo-Real Robot Model:\\n', real_robot.robot_model, '\\n')\n+print('Robot Model:\\n{}\\n'.format(robot.robot_model))\n \n # demonstrate forward kinematics\n-joints = [0, 0, 0, 0, 0, 0]\n+joints = [0] * robot.num_dof()\n+pose = robot.fk(joints)\n+\n+print('Pose:\\n{}\\n'.format(pose))\n \n-print('Ideal Pose:\\n', ideal_robot.fk(joints), '\\n')\n-print('Pseudo-Real Pose:\\n', real_robot.fk(joints), '\\n')\n+# demonstrate inverse kinematics\n+new_joints = robot.ik(pose)\n+print('Solved Joints:\\n{}\\n'.format(new_joints))\ndiff --git a/pybotics/__init__.py b/pybotics/__init__.py\n--- a/pybotics/__init__.py\n+++ b/pybotics/__init__.py\n@@ -1,5 +1,4 @@\n # make the follow accessible from pybotics namespace\n from . import geometry\n from . import kinematics\n-from .robot import *\n-from . import robot_model\n+from .robot import Robot\ndiff --git a/pybotics/robot_model.py b/pybotics/robot_model.py\ndeleted file mode 100644\n--- a/pybotics/robot_model.py\n+++ /dev/null\n@@ -1,42 +0,0 @@\n-import numpy as np\n-\n-'''\n-Modified DH parameter matrices of various robots (rx, tx, rz, tz) aka (alpha, a, theta, d)\n-'''\n-\n-\n-def ur10():\n-    model = np.array([\n-        [0, 0, 0, 118.0],\n-        [np.pi / 2.0, 0, np.pi, 0],\n-        [0, 612.7, 0, 0],\n-        [0, 571.6, 0, 163.9],\n-        [-np.pi / 2.0, 0, 0, 115.7],\n-        [np.pi / 2.0, 0, np.pi, 92.2]\n-    ])\n-    return model\n-\n-\n-def puma_560():\n-    model = np.array([\n-        [0, 0, 0, 0],\n-        [-np.pi / 2.0, 0, 0, 0],\n-        [0, 612.7, 0, 0],\n-        [0, 571.6, 0, 163.9],\n-        [-np.pi / 2.0, 0, 0, 115.7],\n-        [np.pi / 2.0, 0, np.pi, 92.2]\n-    ])\n-    return model\n-\n-\n-def kuka_lbr_iiwa_7():\n-    model = np.array([\n-        [0, 0, 0, 340],\n-        [-np.pi / 2.0, 0, 0, 0],\n-        [np.pi / 2.0, 0, 0, 400],\n-        [np.pi / 2.0, 0, 0, 0],\n-        [-np.pi / 2.0, 0, 0, 400],\n-        [-np.pi / 2.0, 0, 0, 0],\n-        [np.pi / 2.0, 0, 0, 126]\n-    ])\n-    return model\n", "issue": "Robot Model-Specific Parameters Should be in External Files\nRobot Model-Specific Parameters (e.g., MDH, joint limits, etc) Should be in External Files (e.g., csv, json, etc). This way, new models and modifications to models are not tied to the codebase. `robot_model.py` should be deprecated and example models should be saved in a separate `example` folder in the repo.\n", "before_files": [{"content": "# make the follow accessible from pybotics namespace\nfrom . import geometry\nfrom . import kinematics\nfrom .robot import *\nfrom . import robot_model\n", "path": "pybotics/__init__.py"}, {"content": "import numpy as np\n\n'''\nModified DH parameter matrices of various robots (rx, tx, rz, tz) aka (alpha, a, theta, d)\n'''\n\n\ndef ur10():\n    model = np.array([\n        [0, 0, 0, 118.0],\n        [np.pi / 2.0, 0, np.pi, 0],\n        [0, 612.7, 0, 0],\n        [0, 571.6, 0, 163.9],\n        [-np.pi / 2.0, 0, 0, 115.7],\n        [np.pi / 2.0, 0, np.pi, 92.2]\n    ])\n    return model\n\n\ndef puma_560():\n    model = np.array([\n        [0, 0, 0, 0],\n        [-np.pi / 2.0, 0, 0, 0],\n        [0, 612.7, 0, 0],\n        [0, 571.6, 0, 163.9],\n        [-np.pi / 2.0, 0, 0, 115.7],\n        [np.pi / 2.0, 0, np.pi, 92.2]\n    ])\n    return model\n\n\ndef kuka_lbr_iiwa_7():\n    model = np.array([\n        [0, 0, 0, 340],\n        [-np.pi / 2.0, 0, 0, 0],\n        [np.pi / 2.0, 0, 0, 400],\n        [np.pi / 2.0, 0, 0, 0],\n        [-np.pi / 2.0, 0, 0, 400],\n        [-np.pi / 2.0, 0, 0, 0],\n        [np.pi / 2.0, 0, 0, 126]\n    ])\n    return model\n", "path": "pybotics/robot_model.py"}, {"content": "import copy\n\nimport pybotics as py\nimport numpy as np\n\n# set numpy print options\nnp.set_printoptions(precision=3)\nnp.set_printoptions(suppress=True)\n\n# create robot\nideal_robot = py.Robot()\nideal_robot.robot_model = py.robot_model.ur10()\n\n# create pseudo-realistic robot with kinematic errors\nreal_robot = copy.deepcopy(ideal_robot)\nreal_robot.impair_robot_model()\n\nprint('Ideal Robot Model:\\n', ideal_robot.robot_model, '\\n')\nprint('Pseudo-Real Robot Model:\\n', real_robot.robot_model, '\\n')\n\n# demonstrate forward kinematics\njoints = [0, 0, 0, 0, 0, 0]\n\nprint('Ideal Pose:\\n', ideal_robot.fk(joints), '\\n')\nprint('Pseudo-Real Pose:\\n', real_robot.fk(joints), '\\n')\n", "path": "examples/example_robot.py"}]}