Open JcSack opened 4 months ago
The segmentation fault is appearing less often. I made a mistake with the sign of the controller. However I still have doubt related to the actuator dynamic. I am inserting it correctly? I mean, should the model be inserted before the world_->integrate()
or inside its for loop?
Moreover, I am noticing a change of performance in my controller setting "PD_PLUS_FEEDFORWARD_TORQUE" with $K_p=K_D=0$ and "FORCE_AND_TORQUE" mode. However, I read that the PD_PLUS doesn't take into account the joint limits, doesn't it? Anyway, if I set: $\tau = K_pe + K_d\dot{e}$ And then:
setGeneralizedForce(tau)
is the same thing of do:
setPdGains(Kp, Kd)
isn't it?
No they are different. The PD controller is more stable because it is updated in an implicit manner. Its behavior is similar to having an infinitely small time step.
Check the states before it segfaults. If they are exloding, that means that your controller is not stable. Otherwise, try Valgrind following the instructions in the manual
Okay, I am figuring out that maybe I should use an explicit solver to improve sim-to-real.
Anyway, I am debuggin with valgrind as you suggested. It raises this error:
Does it depend still from my code?
That looks like an another issue. I'll look at it. But conditional jump should not trigger a segfault. There must be another error message, possibly related to the memory
Hello, i was trying to implement a custom sim-to-real but I needed to include the actuator model inside the simulation. I'm trying in this way, considering only the mechanical differential equation of a SEA:
$$B\ddot{\theta} + K(\theta - q) = \tau$$
So I implemented backward Euler in this way:
When I run, after a random number of episode, it returns me nan and then segmentation fault. I tried to reduce the learning rate, the number of neurons but nothing helped.
Here theta, dotTheta and motorTorque are Eigen::Vector3d. I've checked thousands of time that I'm not exceding the dimension of the Eigen vector used, so I was wondering if the problem were due to how and where i was performing the integration. Raisim solves the dynamic of the rigid bodies inside that for loop with world_->integrate() right? Am I supposed to put any integrator inside the for loop or it's okay how I did?
But in general, there are smarter ways to include motor dynamic into the simulator?
Thanks a lot =)