Reputation: 83
I have a simple differential drive robot model. When I start the simulation in drake, it passes through the floor and does not stay on the floor. My URDF file do have collisions defined for each link. However, it seems not to obey it when running the simulation.
I did have tried to weld the chassis and that seems to work in staying the robot on the floor. However this finishes the purpose of differential drive robot since robot cannot move. Similarly if I do not define builder.Connect(scene_graph.get_query_output_port(),plant.get_geometry_query_input_port());
It gives an error in simulation.AdvanceTo() but I do see my robot staying on the floor. What should be done to rectify the issue. My urdf is available at https://pastebin.com/jPRnsD83
and my code is available at https://pastebin.com/T7rp9q3T
Any help will be highly appreciated.
Upvotes: 2
Views: 187
Reputation: 1099
Also, you might benefit from the "more modern" way of doing things in the example Sean Curtis gave, i.e.:
get_query_output_port()
.DrakeLcm
objects unnecessarily. Upvotes: 1
Reputation: 1883
There had been an answer that seems to have gone missing. I'm not sure what happened, however, I will reiterate here.
Looking at your pastebin'd code, it appears you haven't actually declared a ground plane. So, there is nothing to prevent your robot for falling for forever.
Here is an example of a robot simulation adding a ground:
https://github.com/RobotLocomotion/drake/blob/master/examples/atlas/atlas_run_dynamics.cc#L54-L65
Upvotes: 2