The pull request resolves issue #245. See that for background. As expected, the information of grabbing the cube (not the sphere) wasn't being carried through to PTPX. This information is created by the controller for the grab model which calls predict twice in a loop, to predict grabbing the cube on the first iteration and to predict grabbing the sphere on the second iteration. The problem is that the code reuses one copy of f_imdl, so that on the second iteration the imdl with the information for the cube is replaced by the information for the sphere. The solution is to not reuse the f_imdl.
This pull request updates the loop to make a fresh copy of the f_imdl on each iteration so that the inner imdl is not replaced. (This is similar to what is already done in check_simulated_imdl to make a copy of the f_imdl.) Now, the second model made by PTPX predicts the failure of grabbing the cube, as desired:
The pull request resolves issue #245. See that for background. As expected, the information of grabbing the cube (not the sphere) wasn't being carried through to PTPX. This information is created by the controller for the grab model which calls predict twice in a loop, to predict grabbing the cube on the first iteration and to predict grabbing the sphere on the second iteration. The problem is that the code reuses one copy of
f_imdl
, so that on the second iteration theimdl
with the information for the cube is replaced by the information for the sphere. The solution is to not reuse thef_imdl
.This pull request updates the loop to make a fresh copy of the
f_imdl
on each iteration so that the innerimdl
is not replaced. (This is similar to what is already done in check_simulated_imdl to make a copy of thef_imdl
.) Now, the second model made by PTPX predicts the failure of grabbing the cube, as desired: