Skip to content

[Feature]: Add get_quat(..., relative=True) #2730

@Oya-Tomo

Description

@Oya-Tomo

What feature or enhancement are you proposing?

  • Add a relative parameter to the get_quat() method.
  • This feature allows users to directly retrieve the relative quaternion.

Motivation

Currently, the set_quat() method has a relative parameter that determines whether the applied quaternion is absolute or relative to the initial quaternion.
This is particularly useful for tasks like domain randomization, where random orientations are set relative to the initial pose.
Therefore, it would be highly beneficial to have a built-in way to retrieve this relative quaternion directly, without requiring manual calculations in user scripts.

Potential Benefit

  • API Consistency: Ensures symmetry with the existing set_quat(relative=True), providing a more intuitive and consistent developer experience.
  • Simplified Implementation: Eliminates the need for manual quaternion math (e.g., $q_{rel} = q_{curr} \otimes q_{init}^{-1}$), reducing boilerplate code and potential calculation errors.
  • Efficient RL Workflows: Streamlines domain randomization and observation handling by allowing direct access to relative orientations from the initial state.

What is the expected outcome of the implementation work?

  • Add a relative boolean parameter to the get_quat() method (defaulting to False).
  • When relative=True, the method should compute and return the entity's current orientation relative to its initial state.
  • Add unit tests to verify the mathematical correctness of the returned relative quaternion.

Additional information

  • Related Feature: This directly complements the existing set_quat(relative=True) method. Aligning the internal state tracking ($q_{init}$) with the existing setter implementation will ensure consistent behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions