mj-kdl-wrapper  0.1.0
MuJoCo + KDL bridge for robot kinematics and dynamics
Loading...
Searching...
No Matches
Advanced / Internal Helpers

Low-level mjSpec helpers exposed for custom scene assembly. More...

Functions

void mj_kdl::add_skybox_to_spec (mjSpec *spec)
 
void mj_kdl::add_floor_to_spec (mjSpec *spec)
 
void mj_kdl::add_table_to_spec (mjSpec *spec, const TableSpec &t)
 
void mj_kdl::add_objects_to_spec (mjSpec *spec, const std::vector< SceneObject > &objects)
 
void mj_kdl::configure_spec (mjSpec *spec, const SceneSpec *sc)
 
bool mj_kdl::compile_and_make_data (mjSpec *spec, mjModel **out_model, mjData **out_data)
 
void mj_kdl::ensure_plugins_loaded ()
 

Detailed Description

Low-level mjSpec helpers exposed for custom scene assembly.

These are used internally by build_scene() and configure_spec(). They are not part of the stable public API and may change between releases.

Function Documentation

◆ add_floor_to_spec()

void mj_kdl::add_floor_to_spec ( mjSpec *  spec)

Add a checker groundplane texture, material, and floor plane geom to spec. Corresponds to SceneSpec::add_floor.

◆ add_objects_to_spec()

void mj_kdl::add_objects_to_spec ( mjSpec *  spec,
const std::vector< SceneObject > &  objects 
)

Add free-floating or fixed rigid bodies to the world body of spec.

Parameters
specMuJoCo spec to modify.
objectsList of objects to add.

◆ add_skybox_to_spec()

void mj_kdl::add_skybox_to_spec ( mjSpec *  spec)

Internal spec-building helpers.

These are used internally by build_scene() and configure_spec(), but are exposed here for advanced callers that construct mjSpec objects directly. They are not part of the stable public API and may change between releases.

Add a sky gradient texture and overhead directional light to spec. Corresponds to SceneSpec::add_skybox.

◆ add_table_to_spec()

void mj_kdl::add_table_to_spec ( mjSpec *  spec,
const TableSpec t 
)

Add a table (tabletop + four legs) to the world body of spec.

Parameters
specMuJoCo spec to modify.
tTable geometry, size, and colour.

◆ compile_and_make_data()

bool mj_kdl::compile_and_make_data ( mjSpec *  spec,
mjModel **  out_model,
mjData **  out_data 
)

Compile spec into a model and create its data buffer. spec is always deleted (on success and failure).

Parameters
[in]specMuJoCo spec to compile; always freed by this call.
[out]out_modelNewly allocated model on success; null on failure.
[out]out_dataNewly allocated data on success; null on failure.
Returns
true on success.

◆ configure_spec()

void mj_kdl::configure_spec ( mjSpec *  spec,
const SceneSpec sc 
)

Apply all SceneSpec settings to a parsed mjSpec: physics options (timestep, gravity), compiler flags, and scene decorations (skybox, floor, table, objects) according to the flags in sc.

◆ ensure_plugins_loaded()

void mj_kdl::ensure_plugins_loaded ( )

Load MuJoCo decoder plugins (STL, OBJ, ...) once at first use. Required since MuJoCo 3.6.0 moved mesh decoders to plugin libraries. Called automatically by all scene-building functions; call explicitly only when building a scene via raw mjSpec APIs without going through the library.