# Question on python and gazebo

**URL:** <https://discourse.openrobotics.org/t/question-on-python-and-gazebo/48755>\
**Category:** Gazebo General\
**Created:** [June 8, 2024, 8:26pm UTC](https://discourse.openrobotics.org/t/question-on-python-and-gazebo/48755 "2024-06-08T20:26:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kakcalu13](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/kakcalu13/32/26887_2.png) [@kakcalu13](https://discourse.openrobotics.org/u/kakcalu13)\
**Post date:** [June 8, 2024, 8:26pm UTC](https://discourse.openrobotics.org/t/question-on-python-and-gazebo/48755/1 "2024-06-08T20:26:19Z")

</div>

I’m so excited to finally get my hands on Python and Gazebo without needing ROS2! ROS2 is a bit challenging to install on Mac M2 and Windows 8 for me. I can install it on Linux, but I need all computers to be accessible since I don’t always have my Linux laptop with me.

I used this SDF as an example (copy the content inside and paste it into sphere.sdf):

> <https://github.com/gazebosim/gz-sim/blob/gz-sim7/examples/worlds/gpu_lidar_sensor.sdf>

Here is my code:

```auto
import sdformat14 as sdf
import sys
import time

def main():
    input_file = './sphere.sdf'
    root = sdf.Root()
    try:
        root.load(input_file)
    except sdf.SDFErrorsException as e:
        print(e, file=sys.stderr)

    while True:
        print("worked: ",
              root.world_by_index(0).model_by_index(2).raw_pose()) # straight to model called model with lidar to get raw pose updated
        time.sleep(0.5)

if __name__ == " __main__":
    main()

```

I was expecting to see an updated raw pose. How can I fetch the updated pose? See the video here:

My terminal doesn’t show the updated position. If this is a bug, I will hop into the github

---

<div class="post-metadata">

**Author:** ![yjphhw](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/yjphhw/32/32542_2.png) [@yjphhw](https://discourse.openrobotics.org/u/yjphhw)\
**Post date:** [June 9, 2024, 8:26am UTC](https://discourse.openrobotics.org/t/question-on-python-and-gazebo/48755/2 "2024-06-09T08:26:09Z")

</div>

your code is wrong. you edit the sdf file， which is static. you should use service to get the pose of entity.

---

<div class="post-metadata">

**Author:** ![kakcalu13](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/kakcalu13/32/26887_2.png) [@kakcalu13](https://discourse.openrobotics.org/u/kakcalu13)\
**Post date:** [June 9, 2024, 1:39pm UTC](https://discourse.openrobotics.org/t/question-on-python-and-gazebo/48755/3 "2024-06-09T13:39:37Z")

</div>

ahh!! how do I do this with python bind?

---

<div class="post-metadata">

**Author:** ![kakcalu13](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/kakcalu13/32/26887_2.png) [@kakcalu13](https://discourse.openrobotics.org/u/kakcalu13)\
**Post date:** [June 9, 2024, 1:45pm UTC](https://discourse.openrobotics.org/t/question-on-python-and-gazebo/48755/4 "2024-06-09T13:45:00Z")

</div>

Sounds like it’s for file only, not work with service.

> **[For Developers — Documentation](http://sdformat.org/tutorials?cat=developers&)**
>
> Simulation Description Format

Guess I gotta find a way to use service on m2 mac.

thank you so much for your time!
