estimate_payload(poses, wrenches)

Parameters

  • poses - A list of at least four TCP poses. The orientation of the poses should be as varied as possible, in order to get a good estimate.

    If the rotational distance between any two poses is less than Pi / (2*n) radians, where n is the number of poses in poses, an exception will be thrown.

  • TCP poses can be recorded with get_actual_tcp_pose().

    wrenches - A list of wrenches resulting from gravity acting on the payload. Must have the same length as poses. Each wrench in wrenches should be measured at the corresponding pose in poses. The wrenches must be given at the tool flange but in robot base orientation. Wrenches in the required orientation can be recorded with get_tcp_force() when in the desired pose.

Return value:

struct[mass, cog]

mass is a double representing the weight of the payload in kg.

cog is a 3d vector representing the offset from the tool flange to the payload center of gravity in tool frame in meters.

 

Example usage (question)

repeat n times

movej(*some distinct pose*)

sleep(*long enough for the arm to stabilize*)

pose_list.append(get_actual_tcp_pose)

wrench_list.append(get_tcp_force)

payload = estimate_payload(pose_list, wrench_list)

set_payload(payload.mass, payload.cog)