Skip to content
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

How to Get an actor's position by tag #5012

Open
Dramano opened this issue Mar 6, 2025 · 0 comments
Open

How to Get an actor's position by tag #5012

Dramano opened this issue Mar 6, 2025 · 0 comments

Comments

@Dramano
Copy link

Dramano commented Mar 6, 2025

Question

What's your question?

How to get an actor's position by tag?

Include context on what you are trying to achieve

I'm trying to get an actor's position through Python API simGetObjectPose in UE 4.27, it works when I pass the actor's ID Name, but I get nan returns when passing the actor's tag.

Context details

OS: Windows 11; AirSim Version: 1.8.1; Python Version: 3.8; Unreal version: 4.27.
settings.json:

{
  "SeeDocsAt": "https://github.com/Microsoft/AirSim/blob/master/docs/settings.md",
  "SettingsVersion": 1.2,
  "SimMode": "Multirotor",
  "ViewMode": "",
  "ClockSpeed": 1,
  "SubWindows": [
    {"WindowID": 0, "CameraID": 0, "ImageType": 0, "Visible": true},
    {"WindowID": 1, "CameraID": 0, "ImageType": 3, "Visible": false},
    {"WindowID": 2, "CameraID": 0, "ImageType": 3, "Visible": true}
    ],
  "CameraDefaults": {
    "CaptureSettings": [
      {
        "ImageType": 3,
        "Width": 100,
        "Height": 80,
        "FOV_Degrees": 90,
        "AutoExposureSpeed": 100,
        "AutoExposureBias": 0,
        "AutoExposureMaxBrightness": 0.64,
        "AutoExposureMinBrightness": 0.03,
        "MotionBlurAmount": 0,
        "TargetGamma": 1.0,
        "ProjectionMode": "",
        "OrthoWidth": 5.12
      },
      {
        "ImageType": 0,
        "Width": 256,
        "Height": 144,
        "FOV_Degrees": 90,
        "AutoExposureSpeed": 100,
        "AutoExposureBias": 0,
        "AutoExposureMaxBrightness": 0.64,
        "AutoExposureMinBrightness": 0.03,
        "MotionBlurAmount": 0,
        "TargetGamma": 1.0,
        "ProjectionMode": "",
        "OrthoWidth": 5.12
      }
    ]
  }
}

Below is the specific method I used to add tags to the actor and call the simGetObjectPose API.

Image

obj_pose = client.simGetObjectPose("Target")
pos = obj_pose.position  # always get 'nan'

Include details of what you already did to find answers

I tried the solution discussed in #2582, but it didn't work for me.

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

No branches or pull requests

1 participant