Gazebo | Ignition | Community
Ask Your Question
1

set gravity on each object Gazebo7

asked 2016-09-30 07:34:06 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

I am tryng to set the gravity on each individual objects in gazebo. I am spawning a robot model that needs to have 0 gravity. But The objects it needs to interact with need to have gravity,so they don't float away. I am not sure how to accomplish this I can turn on/off gravity for the entire world, but not individual models. Here is my world file,

    <?xml version="1.0" ?>
  <sdf version="1.4">
    <world name="default">

      <include>
        <uri>model://sun</uri>
      </include>


      <include>


        <uri>model://ground_plane</uri>
      </include>

         <include>
        <pose>0 10 0 0 0 0</pose>
         <gravity>0 0 -9.81</gravity>
        <uri>model://button_panel</uri>

      </include>

      <gravity>0 0 0</gravity>

    </world>
  </sdf>

I would greatly appreciate any guidance.

edit retag flag offensive close merge delete

Comments

lol i see u

Peter Mitrano gravatar imagePeter Mitrano ( 2016-10-02 11:15:44 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2016-10-02 11:29:45 -0500

One should probably switch from disabling gravity, to making the robot static. It's still a temporary solution, but static is meant to be at the robot level, not world level. Having different gravity on different objects is a pretty bizarre request.

edit flag offensive delete link more
0

answered 2018-06-01 17:07:12 -0500

Miriam gravatar image

You can activate the gravity of each link in your robot in the SDF file and the self collide too, At the end of the inertial tags in each link you can put this code:

<gravity>1</gravity>
<self_collide>1</self_collide>

But if your model was made only with gazebo (no with ROS URDF) this may be not your real problem; you may have issues with the inertia of your robot, because, gazebo uses to activate gravity by itself in all the models, or you can have misplaced the center of mass in your links.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-09-30 07:34:06 -0500

Seen: 4,657 times

Last updated: Jun 01 '18