Apply force to a body at a random position during RL training

Hi all, I want to apply external force to a body of my robot during RL training. For example, i want to apply force to a thigh link of a quadrupeds. I need to apply force at the surface, not the center-of-mass(COM). Moreover, i want to apply force with random position at the surface.

There is a API in Dynamic Control:
apply_body_force() : Apply a force to a rigid body at a position, coordinates can be specified in global or local coordinates

Here is the question. Since the thigh is a irregular rigid body. How can i randomly select a random point of application of the force at the surface ?

Mnay thanks for your kind help!

I would say you need to

Randomise which prim to apply force.

Say you have 4 rigid bodies for two legs.

Rand int (0, 1, 2, 3)

Now the specific prim is defined apply random force to the surface areas of the prim faces then apply a 180, 180 deg arc vector on that face, not included concealed faces at the joints.

I would also apply similar forces to the main body and any additional surface areas for training.

You should be golden…