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

PR for RuntimeWarning: divide by zero encountered in scalar divide #383

Open
auee028 opened this issue Aug 1, 2024 · 4 comments
Open

PR for RuntimeWarning: divide by zero encountered in scalar divide #383

auee028 opened this issue Aug 1, 2024 · 4 comments

Comments

@auee028
Copy link

auee028 commented Aug 1, 2024

I got an error of zero division error as below:

/home/user/.../anaconda3/envs/.../lib/python3.9/site-packages/pyrep/robots/configuration_paths/arm_configuration_path.py:172: RuntimeWarning:

divide by zero encountered in scalar divide

/home/user/.../anaconda3/envs/.../lib/python3.9/site-packages/pyrep/robots/configuration_paths/arm_configuration_path.py:181: RuntimeWarning:

invalid value encountered in multiply

To avoid such error, it seems necessary to do something e.g. to change line 172 from t = (pos - lengths[i]) / (lengths[i + 1] - lengths[i]) to t = (pos - lengths[i]) / (lengths[i + 1] - lengths[i]) if (lengths[i + 1] - lengths[i]) else 0.

@MurakamiNatsuki
Copy link

Hi! I got same error.
Did you manage to solve it as in your example? Or is it still unresolved?

@auee028
Copy link
Author

auee028 commented Aug 22, 2024 via email

@MurakamiNatsuki
Copy link

Thank you for your prompt reply!
I suspected it might be an issue with the version, but it seems that’s not the case.
If you find out anything else, please let me know. I’ll also do some research on my end.

@auee028
Copy link
Author

auee028 commented Aug 23, 2024 via email

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

2 participants