ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Gazebo - elevator doors don't stay put

asked 2020-04-05 21:13:06 -0500

pring gravatar image

updated 2020-04-05 21:55:54 -0500

Hi, I'm trying to model an elevator with doors that move out and in, like normal elevators.

I'm not an expert on collisions, isKinematic, and isGravity but the interaction of these seems to put a torque on the doors, and they rotate about their CoM. As it stands, the doors have collision geometries, the walls of the elevator do not, the doors are slightly elevated from the ground. The doors do not have gravity or kinematic enabled.

I have a script running that actually animates the opening and closing, and that worked, but a few changes to my gazebo world, and it hit the same problem again !

I'm quickly losing my patience with Gazebo (just me?) but would be highly appreciative of any help.

Edit: I'm remaking the entire world and am not seeing any drift, with gravity and kinematic both false. And now they are staying in place.

I'm running into a new problem where I need to put a robot on the elevator floor. The floor has a collision box, not gravity and no kinematics. I'd like to be able to control by adding a force up or down. However, when the robot gets on top of it, that force effects the floor ... is there a good way to fix this problem?

Edit #2: I now realize that I can make the floor stay in place by changing kinematic to true. However, now I can't apply forces to the floor to move it in an animated way. I know I can just update the raw position, but this seems like a convoluted approach. What's the best practice way to do this?


edit retag flag offensive close merge delete


Seeing as this is all Gazebo right now, I'd recommend to post these sort of questions on Especially because of the modelling aspects of your question.

gvdhoorn gravatar image gvdhoorn  ( 2020-04-06 03:52:06 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2020-04-05 23:19:37 -0500

pring gravatar image

After a few hours of trial and error, I have found that the best way to do this is to enable collision boundaries, have kinematic as true, gravity checked false, and use a loop to change position, instead of a force (i.e. for i in range(#): ??.pose.position.z += 0.1)

If anyone has a better solution, I'd be interested in hearing.

edit flag offensive delete link more


On the ROS side: what about treating the elevator as a 'robot' and use gazebo_ros_control to be able to add a position controller to control the position of the doors? Let the controller solve the problem of making the doors go to the desired position.

gvdhoorn gravatar image gvdhoorn  ( 2020-04-06 03:53:02 -0500 )edit

Thanks for the info - I'll have to look into that some more. I suppose I was coming at the problem from a game dev (unity/unreal) standpoint, where the engine does all animations, and are relatively easy for the user to program. It had just occurred to me before reading your answer that it would be easier to make a urdf with two prismatic joints and have ros handle the rest ...

Time to do all the gazebo tutorials to see what's under the hood :)

pring gravatar image pring  ( 2020-04-06 12:00:56 -0500 )edit

Yes, we're not creating animations here. That's a different approach.

gvdhoorn gravatar image gvdhoorn  ( 2020-04-07 02:38:14 -0500 )edit

Question Tools

1 follower


Asked: 2020-04-05 21:13:06 -0500

Seen: 305 times

Last updated: Apr 05 '20