Replies: 1 comment
-
Hi I know this is very late but for anyone who comes across this question this might be very useful. When creating a RigidBody in Bullet, the friction can be set on the In C++ this is done by doing something like this: // ...
// ... Create your collision shape etc here ...
// ...
// Create the rigid body for the ground
btDefaultMotionState* ground_motion_state = new btDefaultMotionState(ground_transform_bt);
// Create the rigid body construction info
btRigidBody::btRigidBodyConstructionInfo ground_rb_info(
mass, ground_motion_state, ground_shape, ground_shape_local_inertia);
// This is what sets the friction for the ground, I find 2.0 is quite nice for "grass"
// Bullet sets this to 0.5 by default
ground_rb_info.m_friction = 2.0f;
// Actually create the rigid body etc
btRigidBody* ground_rb = new btRigidBody(ground_rb_info);
dynamics_world.addRigidBody(ground_rb); I'm not sure how this works in PyBullet, but I assume it is very similar |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to build my own gym environment with PyBullet. I used the following code to load the 3d terrain stored in the TXT file. Normally, the car would be stationary on the slope because of friction. But when I tested this gym environment, the car always skidded on the slope, except when it hit a gully.
1631712914406.mp4
I spent a lot of time, but no one encountered the problem of the car slipping on the sloped terrain. I tried to reduce the gravity to 1, and reduced the mass of the car. The problem still exists.
The most important thing is that my terrain is loaded from a TXT file, and pybullet does not seem to provide an interface for adding friction to the terrain surface under this loading method.
So how can I prevent the car from slipping on the slope? Does pybullet provide other methods to add the friction to the surface of CollisionShape(by using p.createCollisionShape()) or MultiBody(by using p.createMultiBody()) ?The solution of this problem is of great help to me,I would be very grateful if anyone can solve this problem.
Beta Was this translation helpful? Give feedback.
All reactions