I am trying to control a 5 link planar humanoid model with point feet (underactuated) using PFL. Right now I'm inverting the dynamics from the model I created in python and matlab and trying to make it work on the model in mujoco. But this is not working well. I have tried to create the mujoco model as close as possible to the matlab/python model I have but I think there might still be some discrepancies as the PFL is not working correctly on the mujoco model. Is there a better way to implement PFL with mujoco? Thanks
What is PFL? I am not sure I understand what you are doing... you have a model in MATLAB and are trying to create the same model in MuJoCo? What kind of model is this? If it has contacts, it is not going to have the same behavior because MuJoCo has a unique contact model. What is not working?
Sorry for the confusion. I'm trying to implement a trajectory on the 5 link walker with point foot that I created in mujoco. I have generated this trajectory using optimization on a model I have crated in matlab. Because this is an underactuated system, I use partial feedback linearization (PFL) to implement this trajectory on the model. I can do this perfectly fine in matlab as I have complete knowledge of the system dynamics. Is there a way to implement this trajectory that I have generated in matlab on the model in mujoco? If it was a fully actuated model, it would be quite straight forward to just use the actuators in the mujoco in PD control mode and feed this trajectory to them. However, because the system is underactuated, that is not working well. So I tried to do partial feedback linearization with the model that I have in matlab to see if I can control the trajectory on the mujoco model. But that didn't work very well either. So is there a way I can do the partial feedback linearization on the mujoco model itself? Does mujoco provide that functionality?
Since this is a walker, I am pretty sure that your MATLAB model of contact and MuJoCo's model of contact are different. You can match the multi-joint dynamics, but contact force computations are complicated and rely on numerical optimization, and every two simulators end up computing contact force differently. Feedback linearization was developed for smooth dynamics. I would be surprised if it works well for walking, but it would be interesting to see what happens. MuJoCo does not provide support for it. If you need derivatives, you would have to use a finite difference approximation. The code sample derivative.cpp in the software distribution illustrates finite differences.