gazebosim / gz-mujoco

27 stars 4 forks source link

Set spotlight inner/outer angles and falloff to match Gazebo #83

Closed azeey closed 2 years ago

azeey commented 2 years ago

🦟 Bug fix

Summary

For the following mjcf file,

<mujoco model="light_test">
  <asset>
    <texture name="grid" type="2d" builtin="flat" mark="cross" width="256" height="256"/>
    <material name="grid" texture="grid" texrepeat="2 2" texuniform="true"/>
  </asset>
  <worldbody>
    <geom name="floor" size="4 4 0.005" type="plane" material="grid"/>
    <light name="spotlight" pos="0 0 2" dir="0 0 -1" cutoff="45" castshadow="false" exponent="0"/>
    <geom name="box" size="0.5 0.5 0.5" type="box" pos="0 0 0.5" rgba="0 1 0 1"/>
  </worldbody>
</mujoco>

Mujoco displays: image

And before the fix, gz-sim displays: image

After this PR, gz-sim displays: image

With exponent set to 10, Mujoco displays: image

Before the fix, gz-sim displays the same image as before. After this PR, it displays: image

Checklist

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸

codecov[bot] commented 2 years ago

Codecov Report

Merging #83 (95a0875) into main (8e199b5) will increase coverage by 0.03%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #83      +/-   ##
==========================================
+ Coverage   95.14%   95.17%   +0.03%     
==========================================
  Files          24       24              
  Lines        1092     1099       +7     
==========================================
+ Hits         1039     1046       +7     
  Misses         53       53              
Impacted Files Coverage Δ
...sdformat_mjcf/mjcf_to_sdformat/converters/light.py 100.00% <100.00%> (ø)
...ormat_mjcf/mjcf_to_sdformat/converters/material.py 95.45% <100.00%> (+0.45%) :arrow_up:
sdformat_mjcf/src/sdformat_mjcf/utils/sdf_utils.py 90.51% <100.00%> (+0.33%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 9a4f4e6...95a0875. Read the comment docs.