Applying a force to a link in gazebo plugin. [closed]

asked 2017-09-04 14:49:30 -0500

kkrasnosky gravatar image

I am trying to simulate an autonomous surface vehicle with an azimuthing thruster. I set up a basic model and want to apply a force to the thruster in the thruster's reference frame. What recommendations do you have for accomplishing this?

So far I have tried

this->model->GetJoints()[0]->SetForce(0, 300);  // in this method I can't seem to control the direction.  Is it applying a torque and not a force maybe?

and

math::Vector3 force(100,0,0);
model->GetLink("propeller")->SetForce(force);
// this method seems to work, however,  it applies a force in the global x direction not the thruster x direction.
edit retag flag offensive reopen merge delete

Closed for the following reason Gazebo Question: The Gazebo community prefers to answer questions at: http://answers.gazebosim.org by gvdhoorn
close date 2017-09-04 14:55:50.177557

Comments

I'm sorry, but please post questions about Gazebo on answers.gazebosim.org. You'll have a much higher chance of getting good answers there.

gvdhoorn gravatar image gvdhoorn  ( 2017-09-04 14:56:36 -0500 )edit

link->AddRelativeForce(math::Vector3(0, 0, force_z));

jstm gravatar image jstm  ( 2018-12-02 21:39:50 -0500 )edit