Skip to content

Initial joints configuration #427

Discussion options

You must be logged in to vote

Now yes 😃 The initial joint configuration was exposed on the Python side, but not handled by the Bullet C++ spine as discussed here. It has now been added in #428 and released with v5.2.0. For instance:

import gymnasium as gym
import numpy as np
from scipy.spatial.transform import Rotation as ScipyRotation

import upkie.envs
from upkie.utils.robot_state import RobotState

if __name__ == "__main__":
    upkie.envs.register()
    with gym.make(
        "UpkieServoPositions-v4",
        frequency=200.0,
        init_state=RobotState(
            orientation_base_in_world=ScipyRotation.from_quat(
                [0.0, 0.0, -0.707, 0.707],  # SciPy convention: (x, y, z, w))
            ),
    …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by stephane-caron
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants