andreadelprete / consim

GNU General Public License v3.0
14 stars 1 forks source link

Reset of contact state #18

Closed andreadelprete closed 4 years ago

andreadelprete commented 4 years ago

For benchmarking I think it's gonna be useful to be able to reset the state of both robot and contacts. At the moment we can only reset the state of the robot with the reset_state method. However, each contact has an internal state, which is the anchor point x_start. When comparing different simulators in case of slippage we cannot compare long trajectories because if one simulator makes a mistake in the computation of the slipping velocity at the beginning, that would create an offset in the resulting trajectory. The solution suggested in [1] is to compare short trajectory pieces, re-initializing every time the simulator to the state of the ground-truth. I think we should be able to do the same, having a python method to set the anchor point for each contact.

[1] Erez, T., Tassa, Y., & Todorov, E. (2015). Simulation Tools for Model-Based Robotics: Comparison of Bullet, Havok, MuJoCo, ODE and PhysX. In International Conference on Robotics and Automation. https://doi.org/10.3171/PED/2008/1/2/138

hammoudbilal commented 4 years ago

right now resetState() runs contact detection on a given state (q,v) and updates all the contact status, including the anchor point and the force resulting needed for integration in euler method. I could remove this and enforce a different reset for the contacts alone ? it could be done by each contact point separately through the contact point name, however i need to ensure consistence of the anchor point chosen and the robot kinematics relative to the object.

else I could keep the resetState() method as is, and just add the functionality of reseting the anchor point after all the contact detection sequence is done, making sure it is only possible to update the anchor point if the contact is active, then recompute the contact force based on the new `x_start'? this seams more reasonable to me

andreadelprete commented 4 years ago

Both options are fine to me. Go with the second one if you find it better.

andreadelprete commented 4 years ago

hey @hammoudbilal when you have time you could implement this? I think we need it for the results to show in the paper.

andreadelprete commented 4 years ago

This has been implemented so we can close this issue