def METHOD_NAME(targets, floor_bvh, minweight=0.7):
    assert floor_bvh is not None 
    bpy.context.view_layer.update()
    get_targets = lambda k: [t for t in targets if k in t.name]
    bounds = compute_ik_length_height(targets)
    def find_floor_offset(t):
        ray_origin = mathutils.Vector((t.matrix_world.translation.x, t.matrix_world.translation.y, bounds[2, 1]))
        location, normal, index, dist = floor_bvh.ray_cast(ray_origin, mathutils.Vector((0, 0, -1)))
        if location is None:
            return None
        return location - t.matrix_world.translation
    feet = get_targets('foot')
    feet_offsets = [find_floor_offset(f) for f in feet]
    if any(off is None for off in feet_offsets):
        logging.warning(f'snap_iks_to_floor found {feet_offsets=}, aborting snap operation')
        return
    # dont allow the pose diff to be too large (ie, prevent weird behavior at cliffs)
    for i, o in enumerate(feet_offsets):
        if o.length > bounds[2, 1] - bounds[2, 0]:
            logging.warning(f'snap_iks_to_floor ignoring too-long offset {o.length=}')
            feet_offsets[i] = mathutils.Vector()
    for f, fo, in zip(feet, feet_offsets):
        f.location += fo        
    hips = get_targets('body')
    if len(feet) == len(hips) * 2:
        # hips seem coupled to pairs of feet, take that into consideration
        # TODO: Restructure to make detecting this more robust
        hip_offsets = []
        for i in range(len(feet) // 2):
            o1, o2 = feet_offsets[2*i], feet_offsets[2*i + 1]
            hip_off = minweight * min(o1, o2) + (1 - minweight) * max(o1, o2)
            hip_offsets.append(hip_off)
        for h, ho in zip(hips, hip_offsets):
            h.location += ho
        for o in get_targets('head'): # front-associated
            o.location += hip_offsets[-1]
        for o in get_targets('tail'): # back associated
            o.location += hip_offsets[0]
    else:
        logging.warning(f'Couldnt establish feet-hip mapping')
        off = mathutils.Vector(np.array(feet_offsets).mean(axis=0))
        for o in targets:
            if o in feet:
                continue
            o.location += off