Vehicles get stuck

I’m using a VehicleControl to move around a robot that resemebles this:

https://www.team254.com/first/2017/

It has 8 wheels (4 on the left, 4 on the right) that accelerate differently to cause turn (that is, the wheels don’t turn, there is just an acceleration differential between left and right side to turn).The issue I’m having is the vehicle gets stuck on the walls around the driving area. If I drive parallel to the wall it will get stuck, or it could get stuck at angles. Can anyone give me any tips to help this not happen?

Thanks in advance.

Did you already do a forum search?

Edit: Also what does your collision shape look like?

The collision shape is a boxified version of this:

https://media.team254.com/2017/03/8fcb07ae-misfire-400.jpg

Sorry for not being clear,

When you set debug, what does it look like?

Have you read this?

Yeah I read that, and I was wondering if there was a solution that involved preventing it from getting stuck in the first place rather than getting it out once it is stuck. Here’s what the collision debug looks like.

http://i.imgur.com/3kePELF.png

Is there a particular reason why your collision mesh is so complicated? In general, you really want collision meshes to be as simple as you can accept for your given problem. At first glance, your mesh looks like it could be modelled reasonably well as a rectangular box. If you really need accurate collisions with the places that are sticking out, then you could add a couple of those planes onto a rectangular collision box. I highly doubt that this will help your problem with getting stuck, but I thought I’d toss in my 2 cents on simplifying your collision shapes in case it’s helpful later on.

You need to use smaller triangles. Its the only solution that doesnt involve work-arounds. But you can use larger triangles in areas that dont really need such precision.

So how do I use smaller triangles? Is there a setting I can use? Right now I’m using CollisionShapeFactory.createDynamicMesh().

I was able to mostly solve the issue by:

  1. Checking for collisions between the vehicle and any of the walls
  2. If the above is true, check if any of the corners of the vehicle are outside a rectangular area that defines the field
  3. If both the above are true, apply a force that pushes the vehicle towards the middle of the field

It’s hacky but it works for the most part. Thanks for the help guys!

Or use .createMeshShape(mesh) as per documentation.