NVlabs / curobo

CUDA Accelerated Robot Library
https://curobo.org
Other
796 stars 125 forks source link

fix quaternion's gradients in PoseInverse, and a few other warp kernels #393

Closed YuhengZhi closed 6 days ago

YuhengZhi commented 1 month ago
  1. The current conversions from wp.quaternion to wp.vec4 would stop gradients from properly propagating. This has caused the issue mentioned in #392.

    Instead of

    out_v = wp.vec4()
    out_v[0] = out_q[3]
    out_v[1] = out_q[0]
    out_v[2] = out_q[1]
    out_v[3] = out_q[2]

    , this commit does the conversion from quaterniom to vec4 as

    out_v = wp.vec4(out_q[3], out_q[0], out_q[1], out_q[2])

    which seems to produce correct results in the example used in #392 .

  2. A few other wp.kernel's in the same file were using the same conversion method, so are all modified accordingly.

  3. Fixed missing/extra None's in a few backward functions, mentioned in #382 .

Please feel free to let me know if there are any issues.

balakumar-s commented 6 days ago

Thanks for the fix!