Simulation oddities

Discussion in 'Simulation' started by Furosuti, Mar 4, 2018.

  1. We are modellng throwing a ball into a basket using a model of kuka lwr 4+ robot arm. Gotta say I love the engine and we have the model working quite close to real world data.

    However, why is it that when we add joints to our target basket to enable moving it within our program. Or make literally any change in the XML. The trajectory of the ball changes even though the changes have nothing to do with the ball or robot.

    Thanks
     
    Last edited: Mar 4, 2018
  2. Emo Todorov

    Emo Todorov Administrator Staff Member

    Hard to tell what is going on without more details. Note that all DOFs in MuJoCo are assembled into system-wide vectors (qpos, qvel, etc) and when you add joints or make other changes, that affects the order and size of these vectors. So if you wrire control code that assumes specific indices for certain joints, and then these indices change, you will end up with a mess... just guessing here.
     
  3. Yeah sorry, bit of a vague description.

    We use basic joint angle PD control, our controllers control law is error*kp + (error - prior_error)/dt*kd + mj_rne and joints should be handled correctly as they are the first 7 joints for the arm (we get the indexes through joint names though, but I am quite positive theres nothing wrong there). Here is an example pair of videos, only change was adding x and y joints to the basket between the tries. The changes are somewhat small but still noticeable.

    Even changing the balls position in the xml (even though it is always repositioned relative to the end effector at the initialization phase in our code), or changing the baskets mass changes the outcome. I believe the body that is changed needs to have joints for a trajectory change to happen. But well, find it kind of weird for an external objects mass to affect the flight of the ball or change of balls position in the XML when its set at the start of our programs run.

    well, writing this I started thinking its probably mj_rne that gets affected by changes in the model but same thing happens without having any bias term in the control law.
     

    Attached Files: