hi,
I have a AGX orin + ZED2i + ros2 setup.
I’m subscribing to this topic /zed2i/zed_node/body_trk/skeletons
. And I’m trying to calculate the distance between body centroid position and camera view center, see Python code below:
(obj_x and obj_z if from position array: position[0], position[2])
def calculate_camera_width(obj_depth):
HFOV_deg = 104 # HD720P
HFOV_rad = math.radians(HFOV_deg)
# Calculate the width at the specified depth
camera_width = 2 * obj_depth * math.tan(HFOV_rad / 2)
return abs(camera_width)
distance_from_center = obj_x - calculate_camera_width(obj_z) / 2
However the obj_x seems much bigger than camera_width at specific depth. Can you spot anything I’m doing wrong?
Thanks.