def getObservation(self): position = vec3ToNumpyArray(self.agentRbNp.getNetTransform().getPos()) orientation = vec3ToNumpyArray(self.agentRbNp.getNetTransform().getHpr()) image = self.renderWorld.getRgbImages()['agent-0'] collision = self.physicWorld.isCollision(self.agentRbNp) return Observation(position, orientation, image, collision)
def testVec3ToNumpyArray(self): xr = np.random.random((3, )) vec = LVector3(*xr.ravel()) x = vec3ToNumpyArray(vec) self.assertTrue(np.allclose(x, xr, atol=1e-6))
def getOrientation(self): agentRbNp = self._getAgentNode() return vec3ToNumpyArray(agentRbNp.getNetTransform().getHpr())
def getPosition(self): agentRbNp = self._getAgentNode() return vec3ToNumpyArray(agentRbNp.getNetTransform().getPos())