MCPcopy Create free account
hub / github.com/RoboCodeX-source/RoboCodeX_code / adjust_z

Function adjust_z

instruct_to_policy/scripts/src/env/utils.py:151–164  ·  view source on GitHub ↗

Calculate the new minimum object center z-position for object given its 3D bounding box and a list of collided 3D bounding boxes.

(object_bbox, collided_bbox_list, extra_elevation=0.1)

Source from the content-addressed store, hash-verified

149
150
151def adjust_z(object_bbox, collided_bbox_list, extra_elevation=0.1):
152 """
153 Calculate the new minimum object center z-position for object given its 3D bounding box and a list of collided 3D bounding boxes.
154 """
155 # Calculate the maximum z_max of the collided bounding boxes
156 max_z = max(bbox[5] for bbox in collided_bbox_list)
157
158 # Calculate the object's height (z dimension size)
159 object_height = object_bbox[5] - object_bbox[2]
160
161 # Calculate the new z position for the center of the object's bounding box
162 new_z_center = max_z + object_height / 2 + extra_elevation
163
164 return new_z_center
165
166
167#################### MoveIt utils ####################

Callers 1

parse_place_poseMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected