Skip to content

[FEATURE] expose joint position query #1385

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Kashu7100
Copy link
Collaborator

Description

Add two new API get_joints_anchor_pos and get_joints_anchor_axis that returns the joint position in world coordinate and the axis direction in unit vector.

Related Issue

Resolves Genesis-Embodied-AI/Genesis#

Motivation and Context

How Has This Been / Can This Be Tested?

Screenshots (if appropriate):

Checklist:

  • I read the CONTRIBUTING document.
  • I followed the Submitting Code Changes section of CONTRIBUTING document.
  • I tagged the title correctly (including BUG FIX/FEATURE/MISC/BREAKING)
  • [] I updated the documentation accordingly or no change is needed.
  • I tested my changes and added instructions on how to test it for reviewers.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@duburcqa
Copy link
Collaborator

Can you explain what is the use-case for this?

As already discussed several times in the past, I think exposing the “position” of joints is a bad idea because it is error prone. Most of the user will not understand what this is and will use it incorrectly. In my view, only link and geom poses should be exposed to the user.

@Kashu7100
Copy link
Collaborator Author

I was thinking of using this when I convert some code using different simulator but I think I can use the links to do the same!

@Kashu7100 Kashu7100 closed this Jul 12, 2025
@Kashu7100
Copy link
Collaborator Author

(Maybe) get_joints_anchor_pos is still worth keeping it. Feel free to reopen if needed.

@duburcqa
Copy link
Collaborator

Now that I remember, there is already RigidJoint.get_anchor_pos and RigidJoint.get_anchor_axis.

@gs.assert_built
def get_joints_anchor_pos(self, joints_idx_local=None, envs_idx=None, *, unsafe=False):
"""
Returns anchor position of the entity's joints. This is the position of the joint in the world frame.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means nothing: "This is the position of the joint in the world frame."

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is the actual definition:

Mathematically, the anchor point corresponds to the point that is fixed wrt parent link and is coincident with

@duburcqa
Copy link
Collaborator

After think twice, maybe we could factorize the implementations at joint-level with what you did? If you do so, I'm open to merge it!

@Kashu7100 Kashu7100 reopened this Jul 12, 2025
@duburcqa duburcqa marked this pull request as draft July 15, 2025 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants