simple two-box collision example?

Official Python bindings with a focus on reinforcement learning and robotics.
Post Reply
aurieg92
Posts: 1
Joined: Sat Sep 04, 2021 8:40 am

simple two-box collision example?

Post by aurieg92 »

I've done the quickstart and perused some of the examples, but I'm a bit lost and was curious if there might be an existing example for this one.

I'd like to create a scene as such:
(1) The scene has two boxes with initial positions and velocities (and ideally also initial accelerations). I think I can create simple URDFs for these? At least for the visuals and collision properties. There can also be a ground plane, though I'm not sure if that's necessary; the ground can be frictionless.
(2) I'd like to then step the simulation forward an arbitrary number of seconds.
(3) At each step, I'd like to get the closest points between the objects and see if they collide at that step. The getClosestPoints() API seems to work fine here for what I need.

Are there any examples similar to this scenario? I'm hoping to use pybullet here to simulate if two objects / trajectories will collide (and/or minimum distance). Finding that answer outright vs stepping the simulator could work, too, but I'm fine to step the simulator through a fixed number of steps / seconds.
Post Reply