mazy
mazy

Reputation: 688

MuJoCo via mujoco-py interface FetchReach-v1 scenario robotic action delay

Dear MuJoCo community,

in last few days I was working with a simple FetchReach-v1 scenario in open-ai gym MuJoCo environment. I was trying to apply the MPC (Model Predictive Control) to this scenario which basically generates new trajectory points for the robotic arm. The MPC is configured so to provide feasible velocities and accelerations to the robot, so that it will achieve the next point within the timestep, which is equals to: dt = sim.nsubsteps * sim.model.opt.timestep.

The problem: After applying the action to the environment I figured out that the next position of the grip is not equal to the position I expected. First I start thinking that the acceleration and/or the velocities of my MPC algorithm do not match the ones from the robot. But after applying other steps (when the robot is already being accelerated) the difference of the positions was still observable. (see picture). So it is basically does not matter which action I choose, it will never be reached within the provided timestep dt. So I guess there is some king of kinematics behind the MuJoCo interface which reduces the action so that the robot can decelerate within next few timesteps to the point I provided earlier. (if I will not provide a new one).

Yes, there is a limit maximum change in position in _set_action function, which I removed.

The question: Is it possible to somehow disable this "deceleration" kinematics so that the point will be achieved without any delay and deceleration? On the picture below I want the "actual" position to be in "destination".

On the picture below I marked the start location with the big blue cross and the destination with the green cross. The blue line is the passed trajectory. The small blue cross denotes the actual achieved position, which is not the same as the green cross.

My guess of how the velocity is computed [MuJoCo FetchReach action not achieved

This question relates to my previous issue o mujoco-py github: https://github.com/openai/mujoco-py/issues/696

Upvotes: 0

Views: 595

Answers (1)

yuval
yuval

Reputation: 139

It sounds like you are expecting to literally set the velocities or accelerations? That is not how actuation works. Actuators apply forces, the resulting motion depends on many other things (inertia, damping etc.).

The issue is really with your MPC algorithm. You cannot just invent a kinematic trajectory. You need to create trajectories via the same dynamics that the actual system has. In other words your MPC algorithm needs to output a sequence of actions (ctrl vectors) such that the resulting trajectory after rollout achieves whatever it is that you want it to achieve (presumably via a cost/reward).

Upvotes: 1

Related Questions