PyRep icon indicating copy to clipboard operation
PyRep copied to clipboard

PR for RuntimeWarning: divide by zero encountered in scalar divide

Open auee028 opened this issue 1 year ago • 4 comments

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.

auee028 avatar Aug 01 '24 17:08 auee028

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

MurakamiNatsuki avatar Aug 22 '24 01:08 MurakamiNatsuki

Hi, Unfortunately I still have the same error

On Thu, Aug 22, 2024 at 3:51 AM MurakamiNatsuki @.***> wrote:

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

— Reply to this email directly, view it on GitHub https://github.com/stepjam/PyRep/issues/383#issuecomment-2303517892, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALDNI6ZJ62P4MDGCGT2MH2TZSU7Z5AVCNFSM6AAAAABL27FRXWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBTGUYTOOBZGI . You are receiving this because you authored the thread.Message ID: @.***>

auee028 avatar Aug 22 '24 11:08 auee028

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.

MurakamiNatsuki avatar Aug 23 '24 00:08 MurakamiNatsuki

Thanks, I will also try to figure out and update if I find a solution.

auee028 avatar Aug 23 '24 00:08 auee028

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 26 '25 02:04 stale[bot]