GithubHelp home page GithubHelp logo

Comments (5)

nimrod-gileadi avatar nimrod-gileadi commented on June 10, 2024 2

qpos is an array that holds all the joint position values for all joints in the model.

For normal robot joints (e.g. hinges, sliders), there's one entry per joint. For free joints (the "joint" between a free floating object and the world), there are 7 entries: 3 for the position and 4 for the quaternion representing the object's orientation, and the order in the array is the same order that they're specified in the MuJoCo model XML.

ctrl is an array that holds the control commands for the robot. The length of the array is the number of actuators in the model.

See the Computation chapter in the docs.

from mujoco.

yuvaltassa avatar yuvaltassa commented on June 10, 2024 1

model.actuator("actuator_name" or actuator_id).trnid[0] will give you the id of the joint actuated by this actuator, assuming it is connected to a joint. I hope this answers your question.

from mujoco.

rs545837 avatar rs545837 commented on June 10, 2024

@yuvaltassa Here you mentioned that qpos has values of joint angles. Also, Is there a way to access the actuators directly or I have to access it through mjData.joint(i).name, where i is the index for actuators.
I didn't find anything about just accessing values like qpos, qvel, xpos etc. for just actuators.

from mujoco.

yuvaltassa avatar yuvaltassa commented on June 10, 2024

Your question doesn't make sense. Actuators are not directly associated with dofs. For example an actuator can be attached to a tendon that will pull on multiple joints. Certainly an actuator doesn't have a position.

Try to say what you are trying to achieve, rather than where you got stuck trying to achieve it.

from mujoco.

rs545837 avatar rs545837 commented on June 10, 2024

I am sorry for my stupid way of asking. I can very well see I was not clear in the question. So basically I have two questions as follows:

First One
qpos stores the value of joint position or joint angles.
I want to define functions that can access joint positions and joint angles, so how to do that.
Screenshot 2024-01-05 at 7 14 55 PM

Second One
I just noticed that the tutorial.py for MJX got changed. I was basically trying to make some functions in the MjxEnv class according to the prev tutorial, that returns things like joint_torques, joint_positions, joint_velocities but for only actuated joints. For accessing those particular joints, I used an array of all the actuated joints.
Screenshot 2024-01-05 at 6 49 54 PM
Then I am trying to return these stored values as:
Screenshot 2024-01-05 at 8 43 33 PM

My question was, we know that information about control commands is stored in ctrl, so is there also an option of array as well where the actuated joints are directly stored, and I can find info just about them, or is this the only way.

from mujoco.

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.