Can't successfully save fused cameras data to json

Hello, as the title says, I am having problems saving data from the fused cameras into a json file. I am using the fused_cameras.py and json_export.py files, but the problem I keep having is a IndexError: list assignment index out of range error, which I have tried to fix by trying multiple things, but I always end up getting some other error, and am gettting tired of the errors. I see other people here have managed to make it work, so I don’t know what the problem can be. Any help is appreciated.

Hi,
I am sorry to hear you are having issues. Can you send me your SDK version, OS, and the exact log of error that you encounter ? You can also send any files you used as input.
Thank you,

Antoine Lassagne
Senior Developer - ZED SDK
Stereolabs Support

Hello,

Sorry for delaying the answer, I didn’t see it when you answered and was outside home, so I just saw it. I managed to save the data on a json apart from local_position_per_joint and local_rotation_per_joint, which only save an empyt array.

This is the code I am using:

def serializeBodyData(body_data):
    """Serialize BodyData into a JSON like structure"""
    out = {}
    out["id"] = body_data.id
    out["unique_object_id"] = str(body_data.unique_object_id)
    out["tracking_state"] = str(body_data.tracking_state)
    out["action_state"] = str(body_data.action_state)
    addIntoOutput(out, "position", body_data.position)
    out["confidence"] = body_data.confidence
    addIntoOutput(out, "keypoint", body_data.keypoint)
    addIntoOutput(out, "keypoint_confidence", body_data.keypoint_confidence)
    # addIntoOutput(out, "local_position_per_joint", body_data.local_position_per_joint)
    # addIntoOutput(out, "local_orientation_per_joint", body_data.local_orientation_per_joint)
    out["local_position_per_joint"] = body_data.local_position_per_joint
    out["local_orientation_per_joint"] = body_data.local_orientation_per_joint


    return out

Sorry for the delay and thank you for your time.

So, I’ve been able to get the local_position and local_orientation out of 34 joints skeleton, but they are all [0.0, 0.0, 0.0, 1.0] or similar, but with 38 joints I still can’t get the local_position and local_rotation data.