-
Notifications
You must be signed in to change notification settings - Fork 50
The setExternalForce()
method
#46
Comments
are you simulating a single body? Then it actually serves no purpose. It is there so that we can apply force on both articulated systems and single bodies with the same method. What behaviour do you see? Have you tested it with valgrind? |
I have 2 SingleBodyObjects. The first object is connected to the fixed world with a spring and a damper, and connected to the second object by another spring and damper. I'm imposing a position on the second object and trying to get a realistic reading on the force the first object is exerting on the second. My problem is that I'm not getting realistic force outputs at certain frequencies. I've never used valgrind before but it seems like a debugging tool for memory leaks. Do you think it would help me in my use case? Here's my code for reference. If you ignore the ROS stuff it should be pretty clear.
|
Maybe this is an issue of my system having the same amount of zeros as poles? Would that be a problem? I don't know how well explicit solvers deal with these types of systems. |
If you say that it is frequency dependent, it is most likely that you are simulating an unstable system. Even if you are using a damper, your discrete system can be unstable. It will be more stable if RaiSim can simulate continuous-time springs and dampers. I'll leave this as my todo list. |
You can also try with different time steps to see how the behavior changes. |
The issue is actually that I'm getting a very low amplitude response at an excitation frequency of 1 rad/s. I'm expecting a magnitude of 0.69, and I'm getting something below 0.002. Do you still think it's an instability related to discretisation? |
I'll try reducing the step size. Maybe my simulation starts converging |
Update: increasing the step size by a factor of a 100 doesn't seem to help that much, but what I see that for frequencies below ~0.5 rad/s and above ~3 rad/s, the amplitude response is pretty good. It just seems that there's a problem somewhere in this range of frequencies. I think this shouldn't be a problem for me if I just insert more realistic values to my use case in the transfer function. I'm excited to see the functionality you describe implemented, though! Thank you for the quick replies :) |
Hi
I'm getting unpredictable behaviour in my simulation, and it seems the only statement in my code that has ambiguous meaning is the
setExternalForce()
that I applied to one of my objects. What is thelocalidx
parameter that has to be applied to it?Nothing seems to change no matter the integer I pass to it, but if it's in the method, I assume it serves some purpose.
The text was updated successfully, but these errors were encountered: