Closed vmstavens closed 10 months ago
The standard and recommended way to do this is with a mocap body. Read that link carefully as there are a few caveats.
One of the caveats is that mocap body poses cannot be controlled with an actuator, so if you want sliders to control your arm position that won't work. If that's a requirement then instead of a free joint put a series of 3 sliders and 3 hinges (maybe 2 hinges are enough?) at the base and add position actuators with high kp
and kv
(remember the respective units for sliders are w.r.t to meters and for hinges w.r.t radians!). You could also use a free joint but then you'll need to define a vector gear
attribute. However, that can only work for position, not orientation, due to the quaternion in the free joint. This is why a series of hinges is the best way to do orientation controlled generally.
Finally, the error you're seeing has nothing to do with any of this. Do you have a freejoint and some other joint in the same body? That can't work unless you throw in some armature, otherwise, as the error says, the inertia matrix becomes singular.
Hi Yuval,
Thank you so much for your quick and thorough response! I will try out your different suggestions and see where that takes me.
Hi @vmstavens, for a concrete implementation of adding slider joints for the translational movements and hinge joints for the rotational movements of the hand, see the RoboPianist implementation here.
Hi,
I'm an engineer at a University and I'm trying to use MuJoCo for tactile perception using the [Shadow E3M5](https://github.com/google-deepmind/mujoco_menagerie/blob/main/shadow_hand/README.md). To do so, I need to pick and place a box in my environment.
I'm looking for some help with finding a way to move the Shadow Hand around in my simulated world using both the Python Bindings and the MuJoCo Simulation Viewer. The behavior I am looking for is the same as if the hand was mounted to a manipulator but without the manipulator itself.
As an example I should have something like a slider for each DoF under the Control panel with names such as
pos_x
,pos_y
,pos_z
,roll
,pitch
,yaw
, that dictate the current pose of the hand's, let's say forearm frame. When a pose is set I also want the pose to be kept, rather than the hand falling due to gravity.My current progress is
The hand is floating rather than falling.
I can control the orientation about the forearm's frame's x-axis by
Defining a actuator class named
rot_x
:Defining a free joint
free_joint_x
in the robot's rh_forarm body:Adding the controller to the actuators:
But as mentioned this is not enough to solve my problem. I have tried to define new actuators and joints for each DoF but MuJoCo throws the warning:
WARNING: Inertia matrix is too close to singular at DOF 0. Check model. Time = 0.0000.
while my Shadow Hand curls up in nightmare fueling configurations.
I am running my simulation in a virtual environment on Ubuntu 20.04. The environment is running
All hint, help, or guidance is very much appreciated, and thanks in advance.