Open rohanpsingh opened 1 year ago
We can rewrite and make sure that the timestep check happens only once in the beginning but I think we need to dig deeper - because the same problem could happen while modifying the PD gains. Or could be problematic if we introduce more such features that make direct interaction with the IOB.
Sorry I shouldn't have merged yesterday. This definitely should only be done once. It's not a good idea to repeatedly open/close the iob this way.
Okay we can put it in the if(!init) {...}
block. But how about the PD gain calls? Even that could be a problem because ideally one would make repeated calls to "setServoGains" for interpolating and gradually changing the PD gains, for example.
What error do you see when you call open_iob?
I think it's ok to call open_iob once if we plan to make repeated calls to it
The exact error was as follows:
shmat(open_iob): Cannot allocate memory
[critical] [mc_openrtm] Call to open_iob failed! Cannot execute (mc_openrtm constructor).
(process:1720): GLib-ERROR **: 10:57:24.748: creating thread 'gmain': Error creating thread: Resource temporarily unavailable
Though I couldn't reproduce this problem later today with posture controller...
https://github.com/jrl-umi3218/mc_openrtm/blob/b2a28aaff697945f3d36dddcba09cfc4dc2b7cb1/src/MCControl.cpp#L634-L654
This check is happening at every
onExecute
. In today's experiment (@orikuma), we noticed that theopen_iob
call fails a few timesteps after starting the controller! This caused the MCControl to be deactivated.We can rewrite and make sure that the timestep check happens only once in the beginning but I think we need to dig deeper - because the same problem could happen while modifying the PD gains. Or could be problematic if we introduce more such features that make direct interaction with the IOB.