Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Vehicle Won't Steer?
PostPosted: Thu Nov 09, 2006 12:49 am 
Offline

Joined: Thu Nov 09, 2006 12:16 am
Posts: 4
I am trying to set up a simple world with a single vehicle, mostly copied from the VehicleDemo example program in release 2.20b. I am pretty sure I have cut-and-pasted the code correctly, with the main differences being a different polygonal database and the fact that Z is up in my world rather than Y up.

I think i have corrected for the coordinate system and gravity correctly because with my MotionState starting point slightly above the terrain my "vehicle" falls a little and appears to come to rest on the wheels with some suspension compression.

When I call applyEngineForce() on the rear wheels, the vehicle begins to move forward. The problem is, when I call setSteeringValue (with values ranging from -0.3 to 0.3) the vehicle won't steer - it just keeps moving forward as if the tires are not turned. The indices to applyEngineForce and setSteeringValue should be correct.

Any ideas as to what I am doing wrong?

Thanks.


Top
 Profile  
 
 Post subject: Re: Vehicle Won't Steer?
PostPosted: Thu Nov 09, 2006 4:05 am 
Offline
Site Admin
User avatar

Joined: Sun Jun 26, 2005 6:43 pm
Posts: 3744
Location: California, USA
mmorrison wrote:
I am trying to set up a simple world with a single vehicle, mostly copied from the VehicleDemo example program in release 2.20b. I am pretty sure I have cut-and-pasted the code correctly, with the main differences being a different polygonal database and the fact that Z is up in my world rather than Y up.

I think i have corrected for the coordinate system and gravity correctly because with my MotionState starting point slightly above the terrain my "vehicle" falls a little and appears to come to rest on the wheels with some suspension compression.

When I call applyEngineForce() on the rear wheels, the vehicle begins to move forward. The problem is, when I call setSteeringValue (with values ranging from -0.3 to 0.3) the vehicle won't steer - it just keeps moving forward as if the tires are not turned. The indices to applyEngineForce and setSteeringValue should be correct.

Any ideas as to what I am doing wrong?

Thanks.


Did you already hookup the basic debugDrawer to your renderer?

The vehicle demo is hard to debug right now. I just added some debugging rendering for the wheels, to make sure they are in the right place (or are you rendering the wheels already?).
Are you using an unmodified btRaycastVehicle? Did you set the indices of the vehicle like following?
Code:
   indexRightAxis = 0;
   indexUpAxis = 2;
   indexForwardAxis = 1;


Please download Bullet 2.24 (for this updated debug rendering of the wheels) and let me know if there are still issues. Bullet 2.25 will have this updated VehicleDemo that let's you choose Z as up axis, so you can verify the setup. No changes in the Bullet sourcecode is necessary. Get it here:
http://www.continuousphysics.com/ftp/pu ... leDemo.cpp


Thanks,
Erwin


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 10, 2006 5:26 pm 
Offline

Joined: Thu Nov 09, 2006 12:16 am
Posts: 4
The problem, by the way, was that I was not calling m_vehicle->updateWheelTransform(i) for every wheel every frame like I should have been. Everything works as expected now.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 13, 2006 8:43 pm 
Offline

Joined: Thu Nov 09, 2006 12:16 am
Posts: 4
Now my vehicle won't stop. :)

There seems to be several issues with braking as of version 2.23. btRaycastVehicle::setBrake doesn't set m_brake to the brake value supplied as an argument, and btRaycastVehicle::updateFriction does not take the brake value into account anyway.

Is this just not implemented yet?

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 13, 2006 10:34 pm 
Offline
Site Admin
User avatar

Joined: Sun Jun 26, 2005 6:43 pm
Posts: 3744
Location: California, USA
mmorrison wrote:
Now my vehicle won't stop. :)

There seems to be several issues with braking as of version 2.23. btRaycastVehicle::setBrake doesn't set m_brake to the brake value supplied as an argument, and btRaycastVehicle::updateFriction does not take the brake value into account anyway.

Is this just not implemented yet?

Thanks.


Brakes and gears are not implemented yet.
Please let me know how urgent you need them, so I can plan them in. Shouldn't be too much work for brakes :)

Thanks,
Erwin


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 13, 2006 11:26 pm 
Offline

Joined: Thu Nov 09, 2006 12:16 am
Posts: 4
Brakes would be nice. Gears are not necessary for me for now. Not terribly high priority.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group