Module: MJQPosStateData
-
class MJQPosStateData : public StateData
- #include <MJQPosStateData.h>
Class representing the entire joint state data in a MuJoCo simulation.
This class manages the position states (
qpos
) and their derivatives in a MuJoCo simulation. It extendsStateData
to include specific configurations and propagation logic for position states.Public Functions
-
inline MJQPosStateData(std::string inName, const Eigen::MatrixXd &newState)
Constructs an MJQPosStateData object.
- Parameters:
inName – The name of the state.
newState – The initial state matrix.
-
virtual std::unique_ptr<StateData> clone() const override
Creates a clone of the current state data object.
- Returns:
A unique pointer to the cloned
StateData
object.
-
void configure(mjModel *mujocoModel)
Configures the state data with the given MuJoCo model.
This method initializes the state and derivative sizes based on the given MuJoCo model.
- Parameters:
mujocoModel – Pointer to the MuJoCo model.
-
void propagateState(double dt) override
Propagates the state over a time step.
This method integrates the position state using the state derivative over the given time step.
- Parameters:
dt – The time step for propagation.
Protected Attributes
-
mjModel *mujocoModel
Pointer to the MuJoCo model associated with the state.
-
inline MJQPosStateData(std::string inName, const Eigen::MatrixXd &newState)