mirror of
https://github.com/AtsushiSakai/PythonRobotics.git
synced 2026-04-22 03:00:22 -04:00
fix code for coveralls
This commit is contained in:
@@ -241,7 +241,7 @@ class NLinkArm(object):
|
||||
|
||||
self.end_effector = np.array(self.points[self.n_links]).T
|
||||
|
||||
def plot(self, obstacles=[]):
|
||||
def plot(self, obstacles=[]): # pragma: no cover
|
||||
plt.cla()
|
||||
|
||||
for obstacle in obstacles:
|
||||
|
||||
@@ -272,7 +272,7 @@ class NLinkArm(object):
|
||||
|
||||
self.end_effector = np.array(self.points[self.n_links]).T
|
||||
|
||||
def plot(self, myplt, obstacles=[]):
|
||||
def plot(self, myplt, obstacles=[]): # pragma: no cover
|
||||
myplt.cla()
|
||||
|
||||
for obstacle in obstacles:
|
||||
|
||||
@@ -49,7 +49,7 @@ class NLinkArm(object):
|
||||
if self.show_animation:
|
||||
self.plot()
|
||||
|
||||
def plot(self):
|
||||
def plot(self): # pragma: no cover
|
||||
plt.cla()
|
||||
|
||||
for i in range(self.n_links + 1):
|
||||
|
||||
@@ -159,5 +159,5 @@ def ang_diff(theta1, theta2):
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
# animation()
|
||||
# main()
|
||||
animation()
|
||||
@@ -39,8 +39,8 @@ def two_joint_arm(GOAL_TH=0.0, theta1=0.0, theta2=0.0):
|
||||
try:
|
||||
theta2_goal = np.arccos(
|
||||
(x**2 + y**2 - l1**2 - l2**2) / (2 * l1 * l2))
|
||||
theta1_goal = np.math.atan2(y, x) - np.math.atan2(l2 *
|
||||
np.sin(theta2_goal), (l1 + l2 * np.cos(theta2_goal)))
|
||||
theta1_goal = np.math.atan2(y, x) - np.math.atan2(l2
|
||||
* np.sin(theta2_goal), (l1 + l2 * np.cos(theta2_goal)))
|
||||
|
||||
if theta1_goal < 0:
|
||||
theta2_goal = -theta2_goal
|
||||
@@ -61,7 +61,7 @@ def two_joint_arm(GOAL_TH=0.0, theta1=0.0, theta2=0.0):
|
||||
return theta1, theta2
|
||||
|
||||
|
||||
def plot_arm(theta1, theta2, x, y):
|
||||
def plot_arm(theta1, theta2, x, y): # pragma: no cover
|
||||
shoulder = np.array([0, 0])
|
||||
elbow = shoulder + np.array([l1 * np.cos(theta1), l1 * np.sin(theta1)])
|
||||
wrist = elbow + \
|
||||
|
||||
Reference in New Issue
Block a user