There is a function Sedan::SetInitialFwdVel which would allow you to impose an initial velocity on the chassis body (in its forward X direction). You may also want to impose consistent wheel angular velocities (using Sedan::SetInitWheelAngVel). The velocities of all bodies in the vehicle system will be inconsistent at the initial time, but that should be resolved after the first simulation step. However, with a proper powertrain and driveline, the vehicle will not maintain this initial speed and should slowly decelerate.
If you want to force the vehicle to move in a straight line with constant speed, you should use lateral and longitudinal controllers to adjust the vehicle inputs (steering, throttle, and braking) accordingly. Look at any demos using such PID-controller based driver model, for example the combined ChPathFollowerDriver as used in demo_VEH_SteeringController<https://github.com/projectchrono/chrono/blob/main/src/demos/vehicle/controllers/demo_VEH_SteeringController.cpp>. --Radu From: [email protected] <[email protected]> On Behalf Of ji li Sent: Tuesday, 8 November 2022 09:47 To: ProjectChrono <[email protected]> Subject: Re: [chrono] How to modify speed Hi Radu, Thank you for your reply I want to say, when initializing the car, can I give the Sedan a speed and let it run at this speed? 在2022年11月8日星期二 UTC+8 15:36:39<Radu Serban> 写道: I am not quite sure I understand your question. In general, the speed of a Chrono vehicle cannot be set directly. Instead, you accelerate / decelerate a vehicle through its throttle and braking inputs. How you do this depends on what ‘driver’ model you use. If you are talking about demo_VEH_Sedan in particular, that one uses a ‘driver’ model which expects keyboard user inputs. You control the vehicle with the AWSD keys. --Radu From: [email protected] <[email protected]> On Behalf Of ji li Sent: Tuesday, 8 November 2022 08:19 To: ProjectChrono <[email protected]> Subject: [chrono] How to modify speed Hello, When I tested this project recently, I found that the speed of the Sedan could not be modified. I want to know how to modify the speed. -- You received this message because you are subscribed to the Google Groups "ProjectChrono" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/projectchrono/045130e8-9383-4413-a244-665342bc50b4n%40googlegroups.com<https://groups.google.com/d/msgid/projectchrono/045130e8-9383-4413-a244-665342bc50b4n%40googlegroups.com?utm_medium=email&utm_source=footer>. -- You received this message because you are subscribed to the Google Groups "ProjectChrono" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]<mailto:[email protected]>. To view this discussion on the web visit https://groups.google.com/d/msgid/projectchrono/19dafd96-2c6d-440f-8517-38f0dc4fafb3n%40googlegroups.com<https://groups.google.com/d/msgid/projectchrono/19dafd96-2c6d-440f-8517-38f0dc4fafb3n%40googlegroups.com?utm_medium=email&utm_source=footer>. -- You received this message because you are subscribed to the Google Groups "ProjectChrono" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/projectchrono/PH0PR06MB82374EB4EE879F0A1B3EC157A73F9%40PH0PR06MB8237.namprd06.prod.outlook.com.
