gazebosim / docs

High-level Gazebo documentation that gets published to https://gazebosim.org/docs/
https://gazebosim.org/docs
44 stars 80 forks source link

Fix examples and files with invalid extra diffuse values #419

Closed PixnBits closed 6 months ago

PixnBits commented 6 months ago

🦟 Bug fix

Fixes #

Summary

Following the Building Your Own Robot tutorial I encountered an error when adding the caster wheel:

pixnbits@n2023ubu:~/my-robots$ gz sim tutorial.sdf 
Error [Param.cc:1288] Error Code 34: Msg: The value <diffuse>0.0 1 0.0 1 1</diffuse> is invalid.
[Err] [Server.cc:198] Error Code 9: [/sdf/world[@name="car_world"]/model[@name="vehicle_blue"]/link[@name="caster"]/visual[@name="visual"]/material/diffuse:/home/pixnbits/my-robots/tutorial.sdf:L263]: Msg: Error reading element <diffuse>

It appears an extra 1 is at the end, removing it allows Gazebo to run. I used grep -rl "<diffuse>0.0 1 0.0 1 1</diffuse>" to find instances where this was present and removed the trailing 1 from them.

I've tested this by attempting to run Gazeebo with the SDF files, both after and before the changes of this PR (though citadel/tutorials/sensors/sensor_tutorial.sdf appears to be unusable either way). E.g.:

Error [Param.cc:1288] Error Code 34: Msg: The value <diffuse>0.0 1 0.0 1 1</diffuse> is invalid.
[Err] [Server.cc:198] Error Code 9: [/sdf/world[@name="sensor_world"]/model[@name="vehicle_blue"]/link[@name="caster"]/visual[@name="visual"]/material/diffuse:/home/pixnbits/projects/docs-1/dome/tutorials/sensors/sensor_tutorial.sdf:L320]: Msg: Error reading element <diffuse>

It might be useful to add a test to use gz to parse the SDF files, but I'm not sure where the test setup is for this repository (I don't want to ignore it and cause unintended maintenance issues :sweat_smile:)

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.

PixnBits commented 6 months ago

Ah! FWIW it appears this was fixed in newer documentation via #161

iche033 commented 6 months ago

thanks for the fix