Comments (5)
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.
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.
@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.
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.
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.
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.
Then I am trying to return these stored values as:
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)
- Soft Robot Simulation: (a) Example XML files, and (b) difference between Composite and Deformable soft objects HOT 4
- Proposal for linear parametrization of inverse dynamics for SysID HOT 6
- Are sphere-cylinder collisions implemented in MuJoCo v.3.1.4? HOT 1
- nut-bolt .sdf plugin assembly issue. HOT 1
- Understanding different times associated with simulation? HOT 1
- How to obtain/view (x,y,z) points in the convex hull of geoms and flexcomp objects HOT 2
- Error when running training_apg.ipynb: ValueError: safe_zip() argument 2 is longer than argument 1 HOT 5
- MuJoCo Unity Plugin HOT 29
- [Unity plugin] Problems with object interpenetration and tangential frictions HOT 10
- [Bug Report / C#] Suspected bug list of MjBindings.cs HOT 3
- Translate and Rotate a Box Body with 2 Slide Joints and 1 Hinge Joint HOT 6
- Slip simulation HOT 1
- Issue with Simultaneous Joint Movements in Telescopic Arm Not Reaching Target Positions HOT 2
- Error: engine error: edge ordering is incoherent between flex and plugin
- Unity error: unrecognized attribute: 'sensornoise' HOT 1
- Confused about friction for soft surfaces
- Automatically saving good-quality simulation videos using a Python (.py) script rather than mediapy in a Jupyter notebook (.ipynb) HOT 4
- Derive xpos from qpos HOT 2
- Understanding the relationship between body frame and inertial properties. HOT 1
- anisotropic bending stiffness for cable
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mujoco.