Gazebo: Q&A Forum - RSS feedhttp://answers.gazebosim.org/questions/Open source question and answer forum for GazeboenCopyright Askbot, 2010-2011.Fri, 24 May 2019 10:01:25 -0500How to know the vector of force when my model collides a wallhttp://answers.gazebosim.org/question/22612/how-to-know-the-vector-of-force-when-my-model-collides-a-wall/ I want to make a simulation in Gazebo about what will happen when a satellite hit an irregular objection like a comet in space. I used the "spacedyn" in MATLAB to calculate the dynamics of satellite. But "spacedyn" needs to know the force when satellite hit the objection. I don't know how to get the force from Gazebo. However, it seems like that Gazebo won't return the collision force. Wed, 22 May 2019 02:59:36 -0500http://answers.gazebosim.org/question/22612/how-to-know-the-vector-of-force-when-my-model-collides-a-wall/Comment by kumpakri for <p>I want to make a simulation in Gazebo about what will happen when a satellite hit an irregular objection like a comet in space. I used the "spacedyn" in MATLAB to calculate the dynamics of satellite. But "spacedyn" needs to know the force when satellite hit the objection. I don't know how to get the force from Gazebo. However, it seems like that Gazebo won't return the collision force. </p>
http://answers.gazebosim.org/question/22612/how-to-know-the-vector-of-force-when-my-model-collides-a-wall/?comment=22642#post-id-22642There is a function in [Gazebo API](http://osrf-distributions.s3.amazonaws.com/gazebo/api/7.1.0/classgazebo_1_1physics_1_1Link.html#a5486220cabdd29ad68081cd4316207e5) that gives you a vector of the force applied to the link.Fri, 24 May 2019 10:01:25 -0500http://answers.gazebosim.org/question/22612/how-to-know-the-vector-of-force-when-my-model-collides-a-wall/?comment=22642#post-id-22642Answer by thibaultN for <p>I want to make a simulation in Gazebo about what will happen when a satellite hit an irregular objection like a comet in space. I used the "spacedyn" in MATLAB to calculate the dynamics of satellite. But "spacedyn" needs to know the force when satellite hit the objection. I don't know how to get the force from Gazebo. However, it seems like that Gazebo won't return the collision force. </p>
http://answers.gazebosim.org/question/22612/how-to-know-the-vector-of-force-when-my-model-collides-a-wall/?answer=22638#post-id-22638I think you can use a Contact Sensor for this. You could attach it either to your satellite or your colliding object model. You might have to write a dedicated plugin depending on what your use case is, but this sensor returns Contact informations, which include the 2 collisions implied in the contact and the force that gets applied at the point of contact. [This tutorial](http://gazebosim.org/tutorials?tut=contact_sensor) explains more about the contact sensor and how to write a plugin for it
CheersFri, 24 May 2019 02:48:06 -0500http://answers.gazebosim.org/question/22612/how-to-know-the-vector-of-force-when-my-model-collides-a-wall/?answer=22638#post-id-22638