Esempio n. 1
0
 def activate_rendering(self, data):
     """
     :type data: SetBoolRequest
     :return:
     """
     pybullet_wrapper.render = data.data
     if data.data:
         pybullet_wrapper.activate_rendering()
     else:
         pybullet_wrapper.deactivate_rendering()
     return SetBoolResponse()
Esempio n. 2
0
 def reinitialize(self):
     with self.lock:
         super(PyBulletWorldObject, self).reinitialize()
         deactivate_rendering()
         joint_state = None
         base_pose = None
         if self._pybullet_id is not None:
             joint_state = self.joint_state
             base_pose = self.base_pose
             self.suicide()
         s = self.get_urdf_str()
         self._pybullet_id = load_urdf_string_into_bullet(s, base_pose)
         self.__sync_with_bullet()
     if joint_state is not None:
         joint_state = {k: v for k, v in joint_state.items() if k in self.get_joint_names()}
         self.joint_state = joint_state
     activate_rendering()