Code Monkey home page Code Monkey logo

Comments (4)

yuchen93 avatar yuchen93 commented on May 31, 2024 1

In case any body need this, I managed to change the pos with:
env.sim.model.geom_pos[env.sim.model.geom_name2id("cube")] = <new pose>

from robosuite.

jirenz avatar jirenz commented on May 31, 2024

We do not provide functionalities to remove/add/modify objects on the fly because the xml for the environment is fixed. What you could do is to add all objects, and just "teleport" them away somewhere (because you can change their location) when you don't need them.

from robosuite.

yuchen93 avatar yuchen93 commented on May 31, 2024

Thanks for the immediate response. Can you give an example of how you would change the position of the objects? I have tried to do that by modifying "env.sim.data.body_xpos[env.cube_body_id]" in the Sawyer-Lift env but that does not seem to work for me.

from robosuite.

kevin-thankyou-lin avatar kevin-thankyou-lin commented on May 31, 2024

Thanks, Yuchen! In case it's helpful for anyone else, another way to change or set positions of objects is:

env.sim.data.set_joint_qpos(<obj>, <pos_quat_array>)

e.g. env.sim.data.set_joint_qpos(env.model.mujoco_objects[0].joints[0], np.concatenate([np.ones(3)*j/100, np.array([1, 0, 0, 0])]))

from robosuite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.