ethz-asl / sampling_based_control

BSD 3-Clause "New" or "Revised" License
48 stars 6 forks source link

Order of integrate and getstate in mppi_manipulation_dynamics.cpp #18

Open studigem opened 3 years ago

studigem commented 3 years ago

In the definition of the step() function in the dynamics.cpp file of the manipulation example the getState command for the panda is called before the simulation step and after that the new states are assembled with the variables from the getState() call. Why is this order? In my understanding the step function would be:

  1. Set the states of the robot to the current values
  2. Set the input
  3. Integrate the simulation
  4. Get the resulting states
  5. Assemble the state vector Where do I go wrong?
grizzi commented 3 years ago

The step function applies the input at the current state (so you do not have to set the state, while this is done at the beginning of the rollout instead) and reads the new state resulting from im forward integration.

That said, you are right. This is actually a bug and I am going to fix it. Thanks for reporting!