applying wrench to the frame of a fixed link

asked 2020-04-24 07:09:55 -0600

Vianne gravatar image

updated 2020-04-27 16:28:54 -0600

Hi! I've built a cart on which I'm trying to apply a force on a specific point. The cart consists of a weirdly shaped body and four wheels, as can be seen in the picture below. The red and grey parts are all joined using fixed joints and the wheels are attached to the body using revolute joints.

image description

My goal is to apply a force on the position of the top frame (the one where the two grey bars meet). I was planning on doing this by using the ' apply_body_wrench' service and passing it that frame as the reference frame. However, Gazebo doesn't recognize this frame since it is fixed to the base_footprint frame via a fixed link. Therefore I can only specify the base_footprint frame (the one between the wheels) or one of the wheel frames as reference frame for my 'apply_body_wrench' service call.

I figured I can omit this problem by choosing the base_footprint frame as the reference frame and specifying the position of the top frame in the base_footprint frame as the point to apply the wrench to using a reference point. However, this seems like a lot of unnecessary hassle to me, especially since the position of the top frame is already specified in my URDF file mathematically and I would have to re-enter all variables defined there in the node that applies the forces (i'm using a python node to programmatically apply the force for consistency) in order to do this.

Is there anyone out there who can tell me if I'm missing some convenient method to do this or that this really cannot be done in a more efficient manner?

Thanks in advance!

EDIT: I tested the application of forces on a rectangle with it's frame on the bottom and gravity and friction turned of; it seems that the 'reference frame' which can be specified as origin for the force application point described in the documentation is actually the center of mass of the body, which makes things even more tricky.

TLDR: How to apply a force using apply_body_wrench on a frame which is specified in the URDF but not recognized by Gazebo becaused it is fixed to another link?

edit retag flag offensive close merge delete