Add defaults to SDF plugin attributes.

Expose diameter and number of teeth for the gear SDF.

PiperOrigin-RevId: 577779297
Change-Id: Iec5890ab7f39080b395cf06a76f9c2216f4f39ed
This commit is contained in:
Alessio Quaglino
2023-10-30 03:08:41 -07:00
committed by Copybara-Service
parent c921c3956e
commit 50843cad30
18 changed files with 341 additions and 97 deletions
+8 -3
View File
@@ -25,6 +25,13 @@
namespace mujoco::plugin::sdf {
struct BowlAttribute {
static constexpr int nattribute = 3;
static constexpr char const* names[nattribute] = {"height", "radius",
"thickness"};
static constexpr mjtNum defaults[nattribute] = {.4, 1., .02};
};
class Bowl {
public:
// Creates a new Bowl instance (allocated with `new`) or
@@ -42,9 +49,7 @@ class Bowl {
static void RegisterPlugin();
mjtNum radius;
mjtNum height;
mjtNum thick;
mjtNum attribute[BowlAttribute::nattribute];
mjtNum width;
private: