Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subproblem 2 Gives wrong results / errors for the single solution case #23

Open
burakaksoy opened this issue Aug 5, 2024 · 1 comment

Comments

@burakaksoy
Copy link

burakaksoy commented Aug 5, 2024

In the code of Subproblem 2, for single-solution case, order of the parameters to subproblem 1 is wrong.

This is the test to verify the issue:

# subproblem2 another test
a3_2 = rox.subproblem2(z, x, x, y) # Passes (apparently by luck)
a3_22 = rox.subproblem2([0, 0, 0.01851852], [0.01851852, 0, 0], x, y) # This gives the error below

"""
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/burak/.local/lib/python3.8/site-packages/general_robotics_toolbox/general_robotics_toolbox.py", line 766, in subproblem2
    # theta1 = -subproblem1(k1, q, c1)
File "/home/burak/.local/lib/python3.8/site-packages/general_robotics_toolbox/general_robotics_toolbox.py", line 706, in subproblem1
    theta = subproblem0(epp, eqp, k)
File "/home/burak/.local/lib/python3.8/site-packages/general_robotics_toolbox/general_robotics_toolbox.py", line 660, in subproblem0
    assert (np.dot(k,p) < eps) and (np.dot(k,q) < eps), \
AssertionError: k must be perpendicular to p and q
"""

assert len(a3_2) == 1
assert len(a3_22) == 1
a3_2_check = [(0.0, 1.5707963267948966)]
np.testing.assert_allclose(a3_2, a3_2_check, atol=1e-4)
np.testing.assert_allclose(a3_22, a3_2_check, atol=1e-4)
@burakaksoy
Copy link
Author

PR #24 resolves the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant