Gazebo: robot oscillates after spawn
Hi everyone:
I just managed to spawn my NXT robot in a Gazebo empty world, but when I hit play it starts to oscillate around its center of mass (I guess). I recorded a video to show this behavior.
I think this has something to do with collision and/or mass values of the urdf file, but I don't really know, and I thought it would be great to have an answer to this question around here.
Also, if I change the collision parameters of the wheels to match exactly the geometry of the visual ones my robot takes the role of a rocket and disappears in the sky... I think the robot starts to collide with itself (?)
Any ideas?
Thank you very much! :)
Update: here are the robot that oscillates and the robot that flies.
Update 2: the new robot that flies.
Update 3: I was going to post a new question, but I think it's still the same... After I corrected the scale of the tire meshes (actually changed them for cylinder shapes for simplicity) my robot spawns correctly and stays on the ground as someone would expect. But when I tried to move the robot I realized that its center of gravity is misplaced (I think that this was the reason of the oscillation in the first place) because the robot gets knocked over to the left very easily. I don't know why does this happen nor how to correct it, in part because I couldn't find any info on how this CoG is calculated.
Here's the current xacro file of the model. As you can see the robot is built around a link in the very center of the model (ref_0_link).
I took a couple of screenshots showing the physics of my model. Why is that link (?) over there (the one with all those green strings coming out of it) instead of in the center of the model?
Thanks! :)
Update 4: Could anyone tell me how this center of gravity is calculated? Or if it's defined somewhere, or what... Maybe then I could fix it, I'm going nuts trying to find a solution. Thanks again!
Update 5: New photo: the blue arrow points to the root link (base_link, a small translucent box) and the grey arrow shows what I suppose is the COM of the robot, given the behavior of the simulation...
can you share the model?
There you go, thanks. I suppose that the first one oscillates because it only has one link with collision parameters (base_link), although I don't know how to fix it without it becoming a rocket!
I just discovered the "Show physics" option in Gazebo, and I see that with the second model there's something that is being propelled to the upper right side of the robot. I don't know what it is, though. I'm trying to find out.
I updated the second model because I just realized that the caster_wheel_support_joint needed its own transmission tag, although the flying problem still appears and I haven't identified what causes it.