Skip to content

Commit

Permalink
fix: "Link" has no attribute "a"
Browse files Browse the repository at this point in the history
  • Loading branch information
engnadeau committed Aug 23, 2022
1 parent 4f441f3 commit b1ede13
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
5 changes: 3 additions & 2 deletions tests/test_optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ def test_optimization() -> None:
"""Test."""
# init robot model and error wrt nominal
actual_robot = Robot.from_parameters(ur10())
actual_robot.tool.position = [0.1, 0, 0]
actual_robot.kinematic_chain.links[0].a += 0.1
# FIXME: "Link" has no attribute "a"
# TODO: review abstract inheritance
actual_robot.kinematic_chain.links[0].a += 0.1 # type: ignore

# calculate fk
qs = np.tile(
Expand Down
18 changes: 12 additions & 6 deletions tests/test_robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,11 @@ def test_compute_joint_torques(planar_robot: Robot):
joint_angles = np.deg2rad([30, 60, 0])

# get link lengths
# FIXME: "Link" has no attribute "a"
# TODO: review abstract inheritance
lengths = [
planar_robot.kinematic_chain.links[1].a,
planar_robot.kinematic_chain.links[2].a,
planar_robot.kinematic_chain.links[1].a, # type: ignore
planar_robot.kinematic_chain.links[2].a, # type: ignore
]

# calculate expected torques
Expand Down Expand Up @@ -118,9 +120,11 @@ def test_compute_joint_torques(planar_robot: Robot):
def test_jacobian_world(q: np.ndarray, planar_robot: Robot):
"""Test."""
# get link lengths
# FIXME: "Link" has no attribute "a"
# TODO: review abstract inheritance
lengths = [
planar_robot.kinematic_chain.links[1].a,
planar_robot.kinematic_chain.links[2].a,
planar_robot.kinematic_chain.links[1].a, # type: ignore
planar_robot.kinematic_chain.links[2].a, # type: ignore
]

# example from Craig has last joint set to 0
Expand Down Expand Up @@ -151,9 +155,11 @@ def test_jacobian_world(q: np.ndarray, planar_robot: Robot):
def test_jacobian_flange(q: np.ndarray, planar_robot: Robot):
"""Test."""
# get link lengths
# FIXME: "Link" has no attribute "a"
# TODO: review abstract inheritance
lengths = [
planar_robot.kinematic_chain.links[1].a,
planar_robot.kinematic_chain.links[2].a,
planar_robot.kinematic_chain.links[1].a, # type: ignore
planar_robot.kinematic_chain.links[2].a, # type: ignore
]

# example from Craig has last joint set to 0
Expand Down

0 comments on commit b1ede13

Please sign in to comment.