Skip to content

[Question] Attach Camera to a specific link  #39

Closed

Description

@khalidA16

I am trying to attach a camera to my robot's link using the script from play_camera.py.
I initialized my robot as:
robot = my_world.scene.add(PR2(prim_path="/World/PR2", name="pr2"))
and spawned the camera as:
camera.spawn("/World/PR2/wide_stereo_r_stereo_camera_frame") where the prim_path is the link where I would like to attach the camera.
Instead of attaching to the provided prim_path, it is spawned at a distance from the given link ( at a different spot and height in the air than that of the link )
Screenshot from 2023-03-20 05-20-04

Kindly let me know if there is a way to attach the camera to a link. Thanks

Activity

  1. Mayankm96 commented on Mar 20, 2023

    @Mayankm96
    Contributor

    Can you try the following to see if it fixes the issue:

    camera.spawn("/World/PR2/wide_stereo_r_stereo_camera_frame/dummy")
  2. khalidA16 commented on Mar 20, 2023

    @khalidA16
    Author

    Thank you for your reply. I tried your change but now the camera is created farther.

    Screenshot from 2023-03-20 12-13-39

  3. Mayankm96 commented on Mar 20, 2023

    @Mayankm96
    Contributor

    Is it possible to get the script and asset so that we can try reproducing and fixing it from our end?

  4. khalidA16 commented on Mar 20, 2023

    @khalidA16
    Author

    Is it possible to get the script and asset so that we can try reproducing and fixing it from our end?

    It turned out that camera.set_world_pose_ros() was being called in the script which was messing up with the position.

    I have another query, the main viewport in the gui displays the new camera created by default. If I change it back to “Perspective” from the gui, camera.data.output returns data from the perspective camera, and not from the camera on the robot anymore.
    Do you have a suggestion in mind for this ? Thanks

  5. Mayankm96 commented on Mar 21, 2023

    @Mayankm96
    Contributor

    That's strange. The camera uses Hydra textures which don't require opening a new viewport. So by default, it should be opening the "Perspective" camera.

    I ran the play_camera.py again and it shows the default camera as the perspective camera. I switched the viewport to use the created camera and then back to "Perspective". The behavior remains unchanged for me.

  6. khalidA16 commented on Mar 21, 2023

    @khalidA16
    Author

    Hmm , Interesting.
    In my case, it also always open a new viewport window for every camera created.
    Could it be because of the isaac-sim version?
    I am using 2022.1.1.

  7. Mayankm96 commented on Mar 21, 2023

    @Mayankm96
    Contributor

    Ah yes. The switch from what is now called "legacy" viewport to hydra textures happened in Kit 104 which is what the IsaacSim 2022.2 release is using.

    I would recommend using the latest Isaac Sim 2022.2.1 release since there are many bug fixes and improvements that have come in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions