Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Google deepmind Mujoco User Objects

From Leeroopedia
Revision as of 12:47, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Google_deepmind_Mujoco_User_Objects.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Sources
Domains Physics Simulation, Model Objects
Last Updated 2026-02-15 04:00 GMT

Overview

Implements the C++ classes for all MuJoCo model objects including bodies, joints, geoms, textures, materials, sensors, and actuators.

Description

user_objects.cc is the largest file in the user module (8206 lines) and implements the concrete behavior of all MuJoCo specification object types. It includes PNGImage loading via lodepng, and provides the implementation for classes such as mjCBody, mjCJoint, mjCGeom, mjCSite, mjCCamera, mjCLight, mjCTexture, mjCMaterial, mjCSensor, mjCActuator, and many more. Each class handles its own compilation, validation, and conversion to the runtime format.

Usage

Used throughout the model compilation pipeline as the implementations of all model object types, from initial creation through parsing to final compilation into an mjModel.

Code Reference

Source Location

Key Functions

class PNGImage {
 public:
  static PNGImage Load(const mjCBase* obj, mjResource* resource,
                       LodePNGColorType color_type);
  int Width() const;
  int Height() const;
  bool IsSRGB() const;
  mjByteVec&& MoveData() &&;
};

Import

#include "user/user_objects.h"
#include "lodepng.h"
#include <mujoco/mujoco.h>

I/O Contract

Inputs

Name Type Required Description
obj const mjCBase* Yes Base object providing context for resource loading
resource mjResource* Yes Resource handle for file data
color_type LodePNGColorType Yes PNG color type for texture loading

Outputs

Name Type Description
PNGImage PNGImage Loaded PNG image with width, height, sRGB flag, and pixel data
compiled objects various Compiled model objects ready for runtime use

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment