Mujoco KDL Wrapper  0.5.1
MuJoCo + KDL bridge for robot kinematics and dynamics
Loading...
Searching...
No Matches
mj_kdl::SceneObject Struct Reference

#include <mj_kdl_wrapper.hpp>

Public Attributes

std::string name
std::string mjcf_path
std::string prefix
AttachTarget attach_to
Shape shape = Shape::Unspecified
double size [3] = { NAN, NAN, NAN }
double pos [3] = { 0.0, 0.0, 0.0 }
double quat [4] = { 0.0, 0.0, 0.0, 1.0 }
float rgba [4] = { NAN, NAN, NAN, NAN }
bool has_rgba = false
bool fixed = false
double mass = NAN
Condim condim = Condim::Tangential
double friction [3] = { NAN, NAN, NAN }

Detailed Description

A free-floating or fixed rigid body to place in the scene.

Names: an MJCF asset's elements keep their authored names, with prefix prepended when set; its root body is renamed to name. The same asset used twice needs distinct prefixes, or the build fails on the repeated names.

size: BOX - half-extents (x, y, z) SPHERE - {radius, 0, 0} CYLINDER - {radius, half-length, 0} Ignored when mjcf_path is set.

attach_to: Parent in the accumulated scene spec. Default is the worldbody. A child object must appear after its parent in SceneSpec::objects. MuJoCo constraint: a body that carries a freejoint must be a direct child of the worldbody. So a non-fixed primitive (fixed == false) and any mjcf_path asset whose root body owns a freejoint must use AttachKind::World. Fixed primitives and articulated subtrees (no freejoint on the root) may use any kind. mj_compile reports the violation if this rule is broken.

pos: Offset in the resolved parent frame. For MJCF assets, this is the placement frame for the asset's first root body.

fixed: If true the body is welded to its parent (no freejoint); useful for static obstacles or fixtures. If false, an MJCF asset whose root has no joint gets a freejoint named <name>_free.

size, rgba, mass and friction start unset (NaN) and must be set explicitly by the caller; build_scene() fails on a primitive that leaves one unset. They are arbitrary visual/material/dynamic choices, not neutral identities, so the API refuses to invent placeholder values. A fixed primitive may leave mass unset.

rgba / has_rgba: A primitive's colour, required. On an MJCF asset it is optional: with has_rgba set, every geom under the asset's root body takes it, so a scene can state the colour an object is drawn in without editing the asset.

Definition at line 248 of file mj_kdl_wrapper.hpp.

Member Data Documentation

◆ attach_to

AttachTarget mj_kdl::SceneObject::attach_to

Definition at line 253 of file mj_kdl_wrapper.hpp.

◆ condim

Condim mj_kdl::SceneObject::condim = Condim::Tangential

Definition at line 263 of file mj_kdl_wrapper.hpp.

Referenced by mj_kdl_examples::cube_object().

◆ fixed

bool mj_kdl::SceneObject::fixed = false

Definition at line 261 of file mj_kdl_wrapper.hpp.

Referenced by TEST(), and TEST_F().

◆ friction

double mj_kdl::SceneObject::friction[3] = { NAN, NAN, NAN }

Definition at line 264 of file mj_kdl_wrapper.hpp.

Referenced by mj_kdl_examples::cube_object(), and TEST().

◆ has_rgba

bool mj_kdl::SceneObject::has_rgba = false

Definition at line 260 of file mj_kdl_wrapper.hpp.

◆ mass

double mj_kdl::SceneObject::mass = NAN

Definition at line 262 of file mj_kdl_wrapper.hpp.

Referenced by mj_kdl_examples::cube_object().

◆ mjcf_path

std::string mj_kdl::SceneObject::mjcf_path

Definition at line 251 of file mj_kdl_wrapper.hpp.

Referenced by main(), SceneStateTest::SetUp(), TEST(), and TEST_F().

◆ name

std::string mj_kdl::SceneObject::name

◆ pos

double mj_kdl::SceneObject::pos[3] = { 0.0, 0.0, 0.0 }

◆ prefix

std::string mj_kdl::SceneObject::prefix

Definition at line 252 of file mj_kdl_wrapper.hpp.

◆ quat

double mj_kdl::SceneObject::quat[4] = { 0.0, 0.0, 0.0, 1.0 }

Definition at line 258 of file mj_kdl_wrapper.hpp.

Referenced by TEST().

◆ rgba

float mj_kdl::SceneObject::rgba[4] = { NAN, NAN, NAN, NAN }

Definition at line 259 of file mj_kdl_wrapper.hpp.

Referenced by mj_kdl_examples::cube_object().

◆ shape

Shape mj_kdl::SceneObject::shape = Shape::Unspecified

Definition at line 254 of file mj_kdl_wrapper.hpp.

Referenced by mj_kdl_examples::cube_object(), and TEST_F().

◆ size

double mj_kdl::SceneObject::size[3] = { NAN, NAN, NAN }

Definition at line 256 of file mj_kdl_wrapper.hpp.

Referenced by mj_kdl_examples::cube_object().


The documentation for this struct was generated from the following file: