# Problem about get mesh translation value

**URL:** <https://forums.developer.nvidia.com/t/problem-about-get-mesh-translation-value/241372>\
**Category:** Isaac Sim\
**Created:** [February 2, 2023, 6:56am UTC](https://forums.developer.nvidia.com/t/problem-about-get-mesh-translation-value/241372 "2023-02-02T06:56:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gwangin](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/gwangin/32/223332_2.png) [@gwangin](https://forums.developer.nvidia.com/u/gwangin)\
**Post date:** [February 2, 2023, 6:56am UTC](https://forums.developer.nvidia.com/t/problem-about-get-mesh-translation-value/241372/1 "2023-02-02T06:56:38Z")

</div>

Hi,  
I want to get mesh’s position in IsaacSim  
How I can get this translation value?

 ![image](https://global.discourse-cdn.com/nvidia/original/3X/9/0/9091e6edb94a6d4910f68cae76297ac161caa49d.jpeg)

- Not XPrim value!  
Isaacsim provide mesh’s translation already,  
I hope to get mesh’s location using python code

---

<div class="post-metadata">

**Author:** ![toni.sm](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/toni.sm/32/27559_2.png) [@toni.sm](https://forums.developer.nvidia.com/u/toni.sm)\
**Post date:** [February 6, 2023, 11:55am UTC](https://forums.developer.nvidia.com/t/problem-about-get-mesh-translation-value/241372/2 "2023-02-06T11:55:21Z")

</div>

Hi @gwangin

The following code snippets can help you to compute the local and world transformations of a prim

```python
import omni.usd
from pxr import Gf
from pxr import Usd, UsdGeom

prim_path = "/PATH_TO_PRIM"

stage = omni.usd.get_context().get_stage()
prim = stage.GetPrimAtPath(prim_path)

# compute world-space transform
transform = Gf.Transform()
transform.SetMatrix(UsdGeom.Xformable(prim).ComputeLocalToWorldTransform(Usd.TimeCode.Default()))

# get translation, rotation and scale
translation = transform.GetTranslation()
rotation = transform.GetRotation().GetQuat()
scale = transform.GetScale()

print(translation, rotation, scale)

# compute local-space transform
transform = Gf.Transform()
transform.SetMatrix(UsdGeom.Xformable(prim).GetLocalTransformation())

# get translation, rotation and scale
translation = transform.GetTranslation()
rotation = transform.GetRotation().GetQuat()
scale = transform.GetScale()

print(translation, rotation, scale)

```

* * *

Btw, I think (not completely sure) that the Isaac Sim Core API also allows retrieving the transformations, even if it is not an XFrom but a mesh as in your case. Try it and keep what suits your needs :)

```python
from omni.isaac.core.prims import XFormPrim

prim_path = "/PATH_TO_PRIM"

xform_prim = XFormPrim(prim_path=prim_path)
world_pose = xform_prim.get_world_pose()
local_pose = xform_prim.get_local_pose()

print(world_pose)
print(local_pose)

```

---

<div class="post-metadata">

**Author:** ![gwangin](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/gwangin/32/223332_2.png) [@gwangin](https://forums.developer.nvidia.com/u/gwangin)\
**Post date:** [February 6, 2023, 12:41pm UTC](https://forums.developer.nvidia.com/t/problem-about-get-mesh-translation-value/241372/3 "2023-02-06T12:41:19Z")

</div>

Hi,  
Thank you about your kind explaination!  
and I also found some method to find mesh translate.  
GetAttribute(“xfromOp:translate”).Get()

Thanks,

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [February 20, 2023, 12:41pm UTC](https://forums.developer.nvidia.com/t/problem-about-get-mesh-translation-value/241372/4 "2023-02-20T12:41:59Z")

</div>

Closed on February 20, 2023, 12:41pm UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
