def set_origin(self, offset): """Applies a constant offset to all objects.""" offset = np.array(offset) for node in self.worldbody.findall("./*[@pos]"): cur_pos = string_to_array(node.get("pos")) new_pos = cur_pos + offset node.set("pos", array_to_string(new_pos))
def bin_abs(self): """Returns the absolute position of table top""" return string_to_array(self.bin1_body.get("pos"))
def table_top_abs(self): """ Returns the absolute position of table top. """ return string_to_array(self.table_body.get("pos"))
def table_top_abs(self): """Returns the absolute position of table top""" table_height = np.array([0, 0, self.table_full_size[2]]) return string_to_array(self.floor.get("pos")) + table_height
def get_horizontal_radius(self): horizontal_radius_site = self.worldbody.find( "./body/site[@name='horizontal_radius_site']") return string_to_array(horizontal_radius_site.get("pos"))[0]
def get_top_offset(self): top_site = self.worldbody.find("./body/site[@name='top_site']") return string_to_array(top_site.get("pos"))
def get_bottom_offset(self): bottom_site = self.worldbody.find("./body/site[@name='bottom_site']") return string_to_array(bottom_site.get("pos"))