Make seed fixed for random number generator when using <texture mark="random"/>

Also improve documentation regarding texture height and width attributes.

PiperOrigin-RevId: 648427167
Change-Id: I59a0fe75d3526f8563a5252584ed60ef7fb8fd70
This commit is contained in:
Yuval Tassa
2024-07-01 11:10:24 -07:00
committed by Copybara-Service
parent c1ade85490
commit f2c3be470f
3 changed files with 56 additions and 20 deletions
+20
View File
@@ -815,6 +815,26 @@ TEST_F(MjCHFieldTest, PngMap) {
mj_deleteModel(model);
}
// ------------- test textures -------------------------------------------------
using MjCTextureTest = MujocoTest;
TEST_F(MjCTextureTest, TexturesLoad) {
static constexpr char xml[] = R"(
<mujoco>
<asset>
<texture name="body" type="cube" builtin="flat" mark="cross" width="8"
rgb1="0.8 0.6 0.4" rgb2="0.8 0.6 0.4" markrgb="1 1 1"/>
</asset>
</mujoco>
)";
std::array<char, 1024> error;
mjModel* m = LoadModelFromString(xml, error.data(), error.size());
ASSERT_THAT(m, NotNull()) << error.data();
mj_deleteModel(m);
}
// ------------- test quaternion normalization----------------------------------
using QuatNorm = MujocoTest;