I am working on an optimization task involving a robotic hand. The process involves providing a set of joint angles and using mj_forward() to obtain the joint positions. I then compute the difference between these positions and the target positions, propagate the position gradient back to the joint angle space through the Jacobian (mj_jac()). This approach has been effective in my optimization process.
However, I have encountered an issue when controlling the robotic hand using the optimized joint angles. When I apply these optimized joint angles to data.ctrl and use mj_step(), I observe a discrepancy between the actual joint positions and the target positions.The blue and red dots represent the target positions.
I suspect that this discrepancy arises because ,during the optimization process, I only consider the kinematics of the robot to obtain the joint angles. When these joint angles are applied via data.ctrl, the system dynamics, including factors such as gravity and inertia, come into play, which leads to the observed discrepancy.
I am looking for suggestions on how to bridge the gap between kinematic optimization and dynamic execution in MuJoCo. Any advice or recommendations would be greatly appreciated.
It's hard to give a suggestion without knowing the actuators you are using. You can also use a mocap with equality constraints if you need to track the target positions to possibly unphysical positions.
I am working on an optimization task involving a robotic hand. The process involves providing a set of joint angles and using mj_forward() to obtain the joint positions. I then compute the difference between these positions and the target positions, propagate the position gradient back to the joint angle space through the Jacobian (mj_jac()). This approach has been effective in my optimization process.
However, I have encountered an issue when controlling the robotic hand using the optimized joint angles. When I apply these optimized joint angles to data.ctrl and use mj_step(), I observe a discrepancy between the actual joint positions and the target positions.The blue and red dots represent the target positions.
I suspect that this discrepancy arises because ,during the optimization process, I only consider the kinematics of the robot to obtain the joint angles. When these joint angles are applied via data.ctrl, the system dynamics, including factors such as gravity and inertia, come into play, which leads to the observed discrepancy.
I am looking for suggestions on how to bridge the gap between kinematic optimization and dynamic execution in MuJoCo. Any advice or recommendations would be greatly appreciated.
Thank you!![QQ图片20240725112140](https://github.com/user-attachments/assets/76ffd61d-8d13-4aa3-8e37-63c7aa690910)