RavEngine
Loading...
Searching...
No Matches
PxVehicleDrivetrainComponents.h
1// Redistribution and use in source and binary forms, with or without
2// modification, are permitted provided that the following conditions
3// are met:
4// * Redistributions of source code must retain the above copyright
5// notice, this list of conditions and the following disclaimer.
6// * Redistributions in binary form must reproduce the above copyright
7// notice, this list of conditions and the following disclaimer in the
8// documentation and/or other materials provided with the distribution.
9// * Neither the name of NVIDIA CORPORATION nor the names of its
10// contributors may be used to endorse or promote products derived
11// from this software without specific prior written permission.
12//
13// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
14// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
17// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24//
25// Copyright (c) 2008-2022 NVIDIA Corporation. All rights reserved.
26// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
27// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
28
29#pragma once
30
35#include "vehicle2/PxVehicleFunctions.h"
36#include "vehicle2/PxVehicleParams.h"
37#include "vehicle2/PxVehicleComponent.h"
38
39#include "vehicle2/braking/PxVehicleBrakingFunctions.h"
40#include "vehicle2/commands/PxVehicleCommandHelpers.h"
41#include "vehicle2/rigidBody/PxVehicleRigidBodyStates.h"
42#include "vehicle2/steering/PxVehicleSteeringFunctions.h"
43#include "vehicle2/steering/PxVehicleSteeringParams.h"
44#include "vehicle2/wheel/PxVehicleWheelStates.h"
45#include "vehicle2/wheel/PxVehicleWheelParams.h"
46#include "vehicle2/tire/PxVehicleTireStates.h"
47
48#include "PxVehicleDrivetrainStates.h"
49#include "PxVehicleDrivetrainFunctions.h"
50
51#include "common/PxProfileZone.h"
52
53#if !PX_DOXYGEN
54namespace physx
55{
56namespace vehicle2
57{
58#endif
59
60struct PxVehicleBrakeCommandResponseParams;
61struct PxVehicleDirectDriveThrottleCommandResponseParams;
62
75{
76public:
77
80
97 const PxVehicleAxleDescription*& axleDescription,
99 const PxVehicleDirectDriveThrottleCommandResponseParams*& throttleResponseParams,
100 const PxVehicleSteerCommandResponseParams*& steerResponseParams,
102 const PxVehicleCommandState*& commands, const PxVehicleDirectDriveTransmissionCommandState*& transmissionCommands,
103 const PxVehicleRigidBodyState*& rigidBodyState,
104 PxVehicleArrayData<PxReal>& brakeResponseStates,
105 PxVehicleArrayData<PxReal>& throttleResponseStates,
106 PxVehicleArrayData<PxReal>& steerResponseStates) = 0;
107
112 virtual bool update(const PxReal dt, const PxVehicleSimulationContext& context)
113 {
114 PX_UNUSED(dt);
115 PX_UNUSED(context);
116
117 PX_PROFILE_ZONE("PxVehicleDirectDriveCommandResponseComponent::update", 0);
118
119 const PxVehicleAxleDescription* axleDescription;
121 const PxVehicleDirectDriveThrottleCommandResponseParams* throttleResponseParams;
122 const PxVehicleSteerCommandResponseParams* steerResponseParams;
124 const PxVehicleCommandState* commands;
125 const PxVehicleDirectDriveTransmissionCommandState* transmissionCommands;
126 const PxVehicleRigidBodyState* rigidBodyState;
127 PxVehicleArrayData<PxReal> brakeResponseStates;
128 PxVehicleArrayData<PxReal> throttleResponseStates;
129 PxVehicleArrayData<PxReal> steerResponseStates;
130
132 brakeResponseParams, throttleResponseParams, steerResponseParams, ackermannParams,
133 commands, transmissionCommands,
134 rigidBodyState,
135 brakeResponseStates, throttleResponseStates, steerResponseStates);
136
137 const PxReal longitudinalSpeed = rigidBodyState->getLongitudinalSpeed(context.frame);
138
139 for (PxU32 i = 0; i < axleDescription->nbWheels; i++)
140 {
141 const PxU32 wheelId = axleDescription->wheelIdsInAxleOrder[i];
142
143 PxVehicleBrakeCommandResponseUpdate(
144 commands->brakes, commands->nbBrakes, longitudinalSpeed,
145 wheelId, brakeResponseParams,
146 brakeResponseStates[wheelId]);
147
148 PxVehicleDirectDriveThrottleCommandResponseUpdate(
149 commands->throttle, *transmissionCommands, longitudinalSpeed,
150 wheelId, *throttleResponseParams,
151 throttleResponseStates[wheelId]);
152
153 PxVehicleSteerCommandResponseUpdate(
154 commands->steer, longitudinalSpeed,
155 wheelId, *steerResponseParams,
156 steerResponseStates[wheelId]);
157 }
158 if (ackermannParams.size > 0)
159 PxVehicleAckermannSteerUpdate(
160 commands->steer,
161 *steerResponseParams, ackermannParams,
162 steerResponseStates);
163
164 return true;
165 }
166};
167
168
177{
178public:
179
182
183
193 const PxVehicleAxleDescription*& axleDescription,
194 PxVehicleArrayData<const PxReal>& brakeResponseStates,
195 PxVehicleArrayData<const PxReal>& throttleResponseStates,
197
201 virtual bool update(const PxReal dt, const PxVehicleSimulationContext& context)
202 {
203 PX_UNUSED(dt);
204 PX_UNUSED(context);
205
206 PX_PROFILE_ZONE("PxVehicleDirectDriveActuationStateComponent::update", 0);
207
208 const PxVehicleAxleDescription* axleDescription;
209 PxVehicleArrayData<const PxReal> brakeResponseStates;
210 PxVehicleArrayData<const PxReal> throttleResponseStates;
212
214 axleDescription,
215 brakeResponseStates, throttleResponseStates,
216 actuationStates);
217
218 for (PxU32 i = 0; i < axleDescription->nbWheels; i++)
219 {
220 const PxU32 wheelId = axleDescription->wheelIdsInAxleOrder[i];
221 PxVehicleDirectDriveActuationStateUpdate(
222 brakeResponseStates[wheelId], throttleResponseStates[wheelId],
223 actuationStates[wheelId]);
224 }
225
226 return true;
227 }
228};
229
237{
238public:
239
242
243 virtual void getDataForDirectDrivetrainComponent(
244 const PxVehicleAxleDescription*& axleDescription,
245 PxVehicleArrayData<const PxReal>& brakeResponseStates,
246 PxVehicleArrayData<const PxReal>& throttleResponseStates,
250 PxVehicleArrayData<PxVehicleWheelRigidBody1dState>& wheelRigidBody1dStates) = 0;
251
252 virtual bool update(const PxReal dt, const PxVehicleSimulationContext& context)
253 {
254 PX_UNUSED(context);
255
256 PX_PROFILE_ZONE("PxVehicleDirectDrivetrainComponent::update", 0);
257
258 const PxVehicleAxleDescription* axleDescription;
259 PxVehicleArrayData<const PxReal> brakeResponseStates;
260 PxVehicleArrayData<const PxReal> throttleResponseStates;
265
266 getDataForDirectDrivetrainComponent(axleDescription,
267 brakeResponseStates, throttleResponseStates,
268 wheelParams, actuationStates, tireForces,
269 wheelRigidBody1dStates);
270
271 for (PxU32 i = 0; i < axleDescription->nbWheels; i++)
272 {
273 const PxU32 wheelId = axleDescription->wheelIdsInAxleOrder[i];
274
275 PxVehicleDirectDriveUpdate(
276 wheelParams[wheelId], actuationStates[wheelId],
277 brakeResponseStates[wheelId], throttleResponseStates[wheelId],
278 tireForces[wheelId],
279 dt,
280 wheelRigidBody1dStates[wheelId]);
281 }
282
283 return true;
284 }
285};
286
303{
304public:
305
308
336 const PxVehicleAxleDescription*& axleDescription,
338 const PxVehicleSteerCommandResponseParams*& steerResponseParams,
340 const PxVehicleGearboxParams*& gearboxParams,
341 const PxVehicleClutchCommandResponseParams*& clutchResponseParams,
342 const PxVehicleEngineParams*& engineParams,
343 const PxVehicleRigidBodyState*& rigidBodyState,
344 const PxVehicleEngineState*& engineState,
345 const PxVehicleAutoboxParams*& autoboxParams,
346 const PxVehicleCommandState*& commands,
347 const PxVehicleEngineDriveTransmissionCommandState*& transmissionCommands,
348 PxVehicleArrayData<PxReal>& brakeResponseStates,
350 PxVehicleArrayData<PxReal>& steerResponseStates,
351 PxVehicleGearboxState*& gearboxResponseState,
352 PxVehicleClutchCommandResponseState*& clutchResponseState,
353 PxVehicleAutoboxState*& autoboxState) = 0;
354
355 virtual bool update(const PxReal dt, const PxVehicleSimulationContext& context)
356 {
357 PX_UNUSED(dt);
358 PX_UNUSED(context);
359
360 PX_PROFILE_ZONE("PxVehicleEngineDriveCommandResponseComponent::update", 0);
361
362 const PxVehicleAxleDescription* axleDescription;
364 const PxVehicleSteerCommandResponseParams* steerResponseParams;
366 const PxVehicleGearboxParams* gearboxParams;
367 const PxVehicleClutchCommandResponseParams* clutchResponseParams;
368 const PxVehicleEngineParams* engineParams;
369 const PxVehicleRigidBodyState* rigidBodyState;
370 const PxVehicleEngineState* engineState;
371 const PxVehicleAutoboxParams* autoboxParams;
372 const PxVehicleCommandState* commands;
373 const PxVehicleEngineDriveTransmissionCommandState* transmissionCommands;
374 PxVehicleArrayData<PxReal> brakeResponseStates;
376 PxVehicleArrayData<PxReal> steerResponseStates;
377 PxVehicleGearboxState* gearboxResponseState;
378 PxVehicleClutchCommandResponseState* clutchResponseState;
379 PxVehicleAutoboxState* autoboxState;
380
382 brakeResponseParams, steerResponseParams, ackermannParams,
383 gearboxParams, clutchResponseParams, engineParams, rigidBodyState,
384 engineState, autoboxParams,
385 commands, transmissionCommands,
386 brakeResponseStates, throttleResponseState,
387 steerResponseStates,
388 gearboxResponseState, clutchResponseState, autoboxState);
389
390 //The autobox can modify commands like throttle and target gear. Since the user defined
391 //values should not be overwritten, a copy is used to compute the response.
392 PxVehicleCommandState commandsTmp = *commands;
393 PxVehicleEngineDriveTransmissionCommandState transmissionCommandsTmp = *transmissionCommands;
394
395 const PxReal longitudinalSpeed = rigidBodyState->getLongitudinalSpeed(context.frame);
396
397 //Let the autobox set the target gear, unless the user defined target gear requests
398 //a shift already
399 if (autoboxParams)
400 {
401 PX_ASSERT(engineParams);
402 PX_ASSERT(engineState);
403 PX_ASSERT(autoboxState);
404
405 PxVehicleAutoBoxUpdate(
406 *engineParams, *gearboxParams, *autoboxParams,
407 *engineState, *gearboxResponseState, dt,
408 transmissionCommandsTmp.targetGear, *autoboxState, commandsTmp.throttle);
409 }
411 {
412 //If there is no autobox but eAUTOMATIC_GEAR was specified, use the current target gear
413 transmissionCommandsTmp.targetGear = gearboxResponseState->targetGear;
414 }
415
416 //Distribute brake torque to the wheels across each axle.
417 for (PxU32 i = 0; i < axleDescription->nbWheels; i++)
418 {
419 const PxU32 wheelId = axleDescription->wheelIdsInAxleOrder[i];
420 PxVehicleBrakeCommandResponseUpdate(
421 commandsTmp.brakes, commandsTmp.nbBrakes, longitudinalSpeed,
422 wheelId, brakeResponseParams,
423 brakeResponseStates[i]);
424 }
425
426 //Update target gear as required.
427 PxVehicleGearCommandResponseUpdate(
428 transmissionCommandsTmp.targetGear,
429 *gearboxParams,
430 *gearboxResponseState);
431
432 //Compute the response to the clutch command.
433 PxVehicleClutchCommandResponseLinearUpdate(
434 transmissionCommandsTmp.clutch,
435 *clutchResponseParams,
436 *clutchResponseState);
437
438 //Compute the response to the throttle command.
439 PxVehicleEngineDriveThrottleCommandResponseLinearUpdate(
440 commandsTmp,
441 *throttleResponseState);
442
443 //Update the steer angles and Ackermann correction.
444 for (PxU32 i = 0; i < axleDescription->nbWheels; i++)
445 {
446 const PxU32 wheelId = axleDescription->wheelIdsInAxleOrder[i];
447 PxVehicleSteerCommandResponseUpdate(commandsTmp.steer, longitudinalSpeed, wheelId, *steerResponseParams, steerResponseStates[i]);
448 }
449 if (ackermannParams.size > 0)
450 PxVehicleAckermannSteerUpdate(commandsTmp.steer, *steerResponseParams, ackermannParams, steerResponseStates);
451
452 return true;
453 }
454};
455
461{
462public:
463
466
467 virtual void getDataForMultiWheelDriveDifferentialStateComponent(
468 const PxVehicleAxleDescription*& axleDescription,
469 const PxVehicleMultiWheelDriveDifferentialParams*& differentialParams,
470 PxVehicleDifferentialState*& differentialState) = 0;
471
472 virtual bool update(const PxReal dt, const PxVehicleSimulationContext& context)
473 {
474 PX_UNUSED(dt);
475 PX_UNUSED(context);
476
477 PX_PROFILE_ZONE("PxVehicleMultiWheelDriveDifferentialStateComponent::update", 0);
478
479 const PxVehicleAxleDescription* axleDescription;
480 const PxVehicleMultiWheelDriveDifferentialParams* differentialParams;
481 PxVehicleDifferentialState* differentialState;
482
483 getDataForMultiWheelDriveDifferentialStateComponent(axleDescription,
484 differentialParams, differentialState);
485
486 PxVehicleDifferentialStateUpdate(
487 *axleDescription,
488 *differentialParams,
489 *differentialState);
490
491 return true;
492 }
493};
494
501{
502public:
503
506
507 virtual void getDataForFourWheelDriveDifferentialStateComponent(
508 const PxVehicleAxleDescription*& axleDescription,
509 const PxVehicleFourWheelDriveDifferentialParams*& differentialParams,
511 PxVehicleDifferentialState*& differentialState,
512 PxVehicleWheelConstraintGroupState*& wheelConstraintGroupState) = 0;
513
514 virtual bool update(const PxReal dt, const PxVehicleSimulationContext& context)
515 {
516 PX_UNUSED(dt);
517 PX_UNUSED(context);
518
519 PX_PROFILE_ZONE("PxVehicleFourWheelDriveDifferentialStateComponent::update", 0);
520
521 const PxVehicleAxleDescription* axleDescription;
522 const PxVehicleFourWheelDriveDifferentialParams* differentialParams;
524 PxVehicleDifferentialState* differentialState;
525 PxVehicleWheelConstraintGroupState* wheelConstraintGroupState;
526
527 getDataForFourWheelDriveDifferentialStateComponent(axleDescription, differentialParams,
528 wheelRigidbody1dStates,
529 differentialState, wheelConstraintGroupState);
530
531 PxVehicleDifferentialStateUpdate(
532 *axleDescription, *differentialParams,
533 wheelRigidbody1dStates, dt,
534 *differentialState, *wheelConstraintGroupState);
535
536 return true;
537 }
538};
539
545{
546public:
547
550
564 const PxVehicleAxleDescription*& axleDescription,
565 const PxVehicleTankDriveTransmissionCommandState*& transmissionCommands,
567 const PxVehicleTankDriveDifferentialParams*& differentialParams,
568 PxVehicleDifferentialState*& differentialState,
569 PxVehicleWheelConstraintGroupState*& constraintGroupState) = 0;
570
571 virtual bool update(const PxReal dt, const PxVehicleSimulationContext& context)
572 {
573 PX_UNUSED(dt);
574 PX_UNUSED(context);
575
576 PX_PROFILE_ZONE("PxVehicleTankDriveDifferentialStateComponent::update", 0);
577
578 const PxVehicleAxleDescription* axleDescription;
579 const PxVehicleTankDriveTransmissionCommandState* transmissionCommands;
581 const PxVehicleTankDriveDifferentialParams* differentialParams;
582 PxVehicleDifferentialState* differentialState;
583 PxVehicleWheelConstraintGroupState* constraintGroupState;
584
586 axleDescription,
587 transmissionCommands,
588 wheelParams,
589 differentialParams,
590 differentialState, constraintGroupState);
591
592 PxVehicleDifferentialStateUpdate(
593 *axleDescription,
594 wheelParams, *differentialParams,
595 transmissionCommands->thrusts[0], transmissionCommands->thrusts[1],
596 *differentialState, *constraintGroupState);
597
598 return true;
599 }
600};
601
609{
610public:
611
614
615 virtual void getDataForLegacyFourWheelDriveDifferentialStateComponent(
616 const PxVehicleAxleDescription*& axleDescription,
617 const PxVehicleFourWheelDriveDifferentialLegacyParams*& differentialParams,
619 PxVehicleDifferentialState*& differentialState) = 0;
620
621 virtual bool update(const PxReal dt, const PxVehicleSimulationContext& context)
622 {
623 PX_UNUSED(dt);
624 PX_UNUSED(context);
625
626 PX_PROFILE_ZONE("PxVehicleLegacyFourWheelDriveDifferentialStateComponent::update", 0);
627
628 const PxVehicleAxleDescription* axleDescription;
629 const PxVehicleFourWheelDriveDifferentialLegacyParams* differentialParams;
631 PxVehicleDifferentialState* differentialState;
632
633 getDataForLegacyFourWheelDriveDifferentialStateComponent(axleDescription, differentialParams,
634 wheelRigidbody1dStates,
635 differentialState);
636
637 PxVehicleDifferentialStateUpdate(
638 *differentialParams, wheelRigidbody1dStates,
639 *differentialState);
640
641 return true;
642 }
643};
644
651{
652public:
653
656
657 virtual void getDataForEngineDriveActuationStateComponent(
658 const PxVehicleAxleDescription*& axleDescription,
659 const PxVehicleGearboxParams*& gearboxParams,
660 PxVehicleArrayData<const PxReal>& brakeResponseStates,
661 const PxVehicleEngineDriveThrottleCommandResponseState*& throttleResponseState,
662 const PxVehicleGearboxState*& gearboxState,
663 const PxVehicleDifferentialState*& differentialState,
664 const PxVehicleClutchCommandResponseState*& clutchResponseState,
666
667 virtual bool update(const PxReal dt, const PxVehicleSimulationContext& context)
668 {
669 PX_UNUSED(dt);
670 PX_UNUSED(context);
671
672 PX_PROFILE_ZONE("PxVehicleEngineDriveActuationStateComponent::update", 0);
673
674 const PxVehicleAxleDescription* axleDescription;
675 const PxVehicleGearboxParams* gearboxParams;
676 PxVehicleArrayData<const PxReal> brakeResponseStates;
677 const PxVehicleEngineDriveThrottleCommandResponseState* throttleResponseState;
678 const PxVehicleGearboxState* gearboxState;
679 const PxVehicleDifferentialState* differentialState;
680 const PxVehicleClutchCommandResponseState* clutchResponseState;
682
683 getDataForEngineDriveActuationStateComponent(axleDescription, gearboxParams,
684 brakeResponseStates, throttleResponseState,
685 gearboxState, differentialState, clutchResponseState,
686 actuationStates);
687
688 PxVehicleEngineDriveActuationStateUpdate(
689 *axleDescription,
690 *gearboxParams,
691 brakeResponseStates,
692 *throttleResponseState,
693 *gearboxState, *differentialState, *clutchResponseState,
694 actuationStates);
695
696 return true;
697 }
698};
699
707{
708public:
709
712
735 const PxVehicleAxleDescription*& axleDescription,
737 const PxVehicleEngineParams*& engineParams,
738 const PxVehicleClutchParams*& clutchParams,
739 const PxVehicleGearboxParams*& gearboxParams,
740 PxVehicleArrayData<const PxReal>& brakeResponseStates,
743 const PxVehicleEngineDriveThrottleCommandResponseState*& throttleResponseState,
744 const PxVehicleClutchCommandResponseState*& clutchResponseState,
745 const PxVehicleDifferentialState*& differentialState,
746 const PxVehicleWheelConstraintGroupState*& constraintGroupState,
748 PxVehicleEngineState*& engineState,
749 PxVehicleGearboxState*& gearboxState,
750 PxVehicleClutchSlipState*& clutchState) = 0;
751
752 virtual bool update(const PxReal dt, const PxVehicleSimulationContext& context)
753 {
754 PX_UNUSED(context);
755
756 PX_PROFILE_ZONE("PxVehicleEngineDrivetrainComponent::update", 0);
757
758 const PxVehicleAxleDescription* axleDescription;
760 const PxVehicleEngineParams* engineParams;
761 const PxVehicleClutchParams* clutchParams;
762 const PxVehicleGearboxParams* gearboxParams;
763 PxVehicleArrayData<const PxReal> brakeResponseStates;
766 const PxVehicleEngineDriveThrottleCommandResponseState* throttleResponseState;
767 const PxVehicleClutchCommandResponseState* clutchResponseState;
768 const PxVehicleDifferentialState* differentialState;
769 const PxVehicleWheelConstraintGroupState* constraintGroupState;
771 PxVehicleEngineState* engineState;
772 PxVehicleGearboxState* gearboxState;
773 PxVehicleClutchSlipState* clutchState;
774
775 getDataForEngineDrivetrainComponent(axleDescription, wheelParams,
776 engineParams, clutchParams, gearboxParams,
777 brakeResponseStates, actuationStates, tireForces,
778 throttleResponseState, clutchResponseState, differentialState, constraintGroupState,
779 wheelRigidBody1dStates, engineState, gearboxState, clutchState);
780
781 PxVehicleGearboxUpdate(*gearboxParams, dt, *gearboxState);
782
783 PxVehicleEngineDrivetrainUpdate(
784 *axleDescription,
785 wheelParams,
786 *engineParams, *clutchParams, *gearboxParams,
787 brakeResponseStates, actuationStates,
788 tireForces,
789 *gearboxState, *throttleResponseState, *clutchResponseState, *differentialState, constraintGroupState,
790 dt,
791 wheelRigidBody1dStates, *engineState, *clutchState);
792
793 return true;
794 }
795};
796
797#if !PX_DOXYGEN
798} // namespace vehicle2
799} // namespace physx
800#endif
801
Definition base.h:1940
Definition PxVehicleComponent.h:45
Determine the actuation state for each wheel of a direct drive vehicle.
Definition PxVehicleDrivetrainComponents.h:177
virtual bool update(const PxReal dt, const PxVehicleSimulationContext &context)
Compute the actuation state for each wheel given the brake, handbrake and throttle states....
Definition PxVehicleDrivetrainComponents.h:201
virtual void getDataForDirectDriveActuationStateComponent(const PxVehicleAxleDescription *&axleDescription, PxVehicleArrayData< const PxReal > &brakeResponseStates, PxVehicleArrayData< const PxReal > &throttleResponseStates, PxVehicleArrayData< PxVehicleWheelActuationState > &actuationStates)=0
Provide vehicle data items for this component.
Forward the applicable set of control values for a direct drive vehicle to a command response state f...
Definition PxVehicleDrivetrainComponents.h:75
virtual void getDataForDirectDriveCommandResponseComponent(const PxVehicleAxleDescription *&axleDescription, PxVehicleSizedArrayData< const PxVehicleBrakeCommandResponseParams > &brakeResponseParams, const PxVehicleDirectDriveThrottleCommandResponseParams *&throttleResponseParams, const PxVehicleSteerCommandResponseParams *&steerResponseParams, PxVehicleSizedArrayData< const PxVehicleAckermannParams > &ackermannParams, const PxVehicleCommandState *&commands, const PxVehicleDirectDriveTransmissionCommandState *&transmissionCommands, const PxVehicleRigidBodyState *&rigidBodyState, PxVehicleArrayData< PxReal > &brakeResponseStates, PxVehicleArrayData< PxReal > &throttleResponseStates, PxVehicleArrayData< PxReal > &steerResponseStates)=0
Provide vehicle data items for this component.
virtual bool update(const PxReal dt, const PxVehicleSimulationContext &context)
Compute a per wheel response to the input brake/handbrake/throttle/steer commands and determine if ...
Definition PxVehicleDrivetrainComponents.h:112
Forward integrate the angular speed of each wheel on a vehicle by integrating the brake and drive tor...
Definition PxVehicleDrivetrainComponents.h:237
virtual bool update(const PxReal dt, const PxVehicleSimulationContext &context)
Update function for a vehicle component.
Definition PxVehicleDrivetrainComponents.h:252
Determine the actuation state for each wheel for a vehicle propelled by engine torque.
Definition PxVehicleDrivetrainComponents.h:651
virtual bool update(const PxReal dt, const PxVehicleSimulationContext &context)
Update function for a vehicle component.
Definition PxVehicleDrivetrainComponents.h:667
Forward the applicable set of control values for a vehicle driven by an engine to a command response ...
Definition PxVehicleDrivetrainComponents.h:303
virtual bool update(const PxReal dt, const PxVehicleSimulationContext &context)
Update function for a vehicle component.
Definition PxVehicleDrivetrainComponents.h:355
virtual void getDataForEngineDriveCommandResponseComponent(const PxVehicleAxleDescription *&axleDescription, PxVehicleSizedArrayData< const PxVehicleBrakeCommandResponseParams > &brakeResponseParams, const PxVehicleSteerCommandResponseParams *&steerResponseParams, PxVehicleSizedArrayData< const PxVehicleAckermannParams > &ackermannParams, const PxVehicleGearboxParams *&gearboxParams, const PxVehicleClutchCommandResponseParams *&clutchResponseParams, const PxVehicleEngineParams *&engineParams, const PxVehicleRigidBodyState *&rigidBodyState, const PxVehicleEngineState *&engineState, const PxVehicleAutoboxParams *&autoboxParams, const PxVehicleCommandState *&commands, const PxVehicleEngineDriveTransmissionCommandState *&transmissionCommands, PxVehicleArrayData< PxReal > &brakeResponseStates, PxVehicleEngineDriveThrottleCommandResponseState *&throttleResponseState, PxVehicleArrayData< PxReal > &steerResponseStates, PxVehicleGearboxState *&gearboxResponseState, PxVehicleClutchCommandResponseState *&clutchResponseState, PxVehicleAutoboxState *&autoboxState)=0
Provide vehicle data items for this component.
Forward integrate the angular speed of each wheel and of the engine, accounting for the state of the ...
Definition PxVehicleDrivetrainComponents.h:707
virtual void getDataForEngineDrivetrainComponent(const PxVehicleAxleDescription *&axleDescription, PxVehicleArrayData< const PxVehicleWheelParams > &wheelParams, const PxVehicleEngineParams *&engineParams, const PxVehicleClutchParams *&clutchParams, const PxVehicleGearboxParams *&gearboxParams, PxVehicleArrayData< const PxReal > &brakeResponseStates, PxVehicleArrayData< const PxVehicleWheelActuationState > &actuationStates, PxVehicleArrayData< const PxVehicleTireForce > &tireForces, const PxVehicleEngineDriveThrottleCommandResponseState *&throttleResponseState, const PxVehicleClutchCommandResponseState *&clutchResponseState, const PxVehicleDifferentialState *&differentialState, const PxVehicleWheelConstraintGroupState *&constraintGroupState, PxVehicleArrayData< PxVehicleWheelRigidBody1dState > &wheelRigidBody1dStates, PxVehicleEngineState *&engineState, PxVehicleGearboxState *&gearboxState, PxVehicleClutchSlipState *&clutchState)=0
Provide vehicle data items for this component.
virtual bool update(const PxReal dt, const PxVehicleSimulationContext &context)
Update function for a vehicle component.
Definition PxVehicleDrivetrainComponents.h:752
Compute the per wheel drive torque split of a differential delivering torque to multiple wheels with ...
Definition PxVehicleDrivetrainComponents.h:501
virtual bool update(const PxReal dt, const PxVehicleSimulationContext &context)
Update function for a vehicle component.
Definition PxVehicleDrivetrainComponents.h:514
Compute the per wheel drive torque split of a four wheel drive differential.
Definition PxVehicleDrivetrainComponents.h:609
virtual bool update(const PxReal dt, const PxVehicleSimulationContext &context)
Update function for a vehicle component.
Definition PxVehicleDrivetrainComponents.h:621
Compute the per wheel drive torque split of a multi-wheel drive differential.
Definition PxVehicleDrivetrainComponents.h:461
virtual bool update(const PxReal dt, const PxVehicleSimulationContext &context)
Update function for a vehicle component.
Definition PxVehicleDrivetrainComponents.h:472
Compute the per wheel drive torque split of a tank drive differential.
Definition PxVehicleDrivetrainComponents.h:545
virtual void getDataForTankDriveDifferentialStateComponent(const PxVehicleAxleDescription *&axleDescription, const PxVehicleTankDriveTransmissionCommandState *&transmissionCommands, PxVehicleArrayData< const PxVehicleWheelParams > &wheelParams, const PxVehicleTankDriveDifferentialParams *&differentialParams, PxVehicleDifferentialState *&differentialState, PxVehicleWheelConstraintGroupState *&constraintGroupState)=0
Provide vehicle data items for this component.
virtual bool update(const PxReal dt, const PxVehicleSimulationContext &context)
Update function for a vehicle component.
Definition PxVehicleDrivetrainComponents.h:571
#define PX_DEPRECATED
Definition PxPreprocessor.h:418
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
Helper struct to pass array type data to vehice components and functions.
Definition PxVehicleParams.h:249
Definition PxVehicleDrivetrainParams.h:404
Definition PxVehicleDrivetrainStates.h:122
Definition PxVehicleParams.h:53
PxU32 wheelIdsInAxleOrder[PxVehicleLimits::eMAX_NB_WHEELS]
The list of all wheel ids on the vehicle.
Definition PxVehicleParams.h:149
PxU32 nbWheels
The number of wheels on the vehicle.
Definition PxVehicleParams.h:150
Specifies the maximum clutch strength that occurs when the clutch pedal is fully disengaged and the c...
Definition PxVehicleDrivetrainParams.h:84
Definition PxVehicleDrivetrainStates.h:46
The clutch connects two plates together. One plate rotates with the speed of the engine....
Definition PxVehicleDrivetrainParams.h:141
The clutch is modelled as two spinning plates with one connected to the wheels through the gearing an...
Definition PxVehicleDrivetrainStates.h:266
A description of the state of commands that are applied to the vehicle.
Definition PxVehicleCommandStates.h:53
PxReal throttle
The instantaneous state of the throttle controller in range [0,1] with 1 denoting fully pressed and 0...
Definition PxVehicleCommandStates.h:56
PxReal steer
The instantaneous state of the steer controller in range [-1,1].
Definition PxVehicleCommandStates.h:57
PxReal brakes[2]
The instantaneous state of the brake controllers in range [0,1] with 1 denoting fully pressed and 0 f...
Definition PxVehicleCommandStates.h:54
Definition PxVehicleDrivetrainStates.h:143
Distribute a throttle response to the wheels of a direct drive vehicle.
Definition PxVehicleDrivetrainParams.h:57
A description of the state of transmission-related commands that are applied to a vehicle with direct...
Definition PxVehicleCommandStates.h:69
A description of the state of transmission-related commands that are applied to a vehicle with engine...
Definition PxVehicleCommandStates.h:92
PxU32 targetGear
The desired gear of the input gear controller.
Definition PxVehicleCommandStates.h:108
@ eAUTOMATIC_GEAR
Special gear value to denote the automatic shift mode (often referred to as DRIVE).
Definition PxVehicleCommandStates.h:104
PxReal clutch
The instantaneous state of the clutch controller in range [0,1] with 1 denoting fully pressed and 0 f...
Definition PxVehicleCommandStates.h:107
Definition PxVehicleDrivetrainParams.h:192
Definition PxVehicleDrivetrainStates.h:67
PxVehicleFourWheelDriveDifferentialParams specifies the wheels that are to receive drive torque from ...
Definition PxVehicleDrivetrainParams.h:672
Definition PxVehicleDrivetrainParams.h:320
Definition PxVehicleDrivetrainStates.h:85
PxU32 targetGear
Target gear (different from current gear if a gear change is underway)
Definition PxVehicleDrivetrainStates.h:94
PxVehicleMultiWheelDriveDifferentialParams specifies the wheels that are to receive drive torque from...
Definition PxVehicleDrivetrainParams.h:600
Definition PxVehicleRigidBodyStates.h:47
PX_FORCE_INLINE PxReal getLongitudinalSpeed(const PxVehicleFrame &frame) const
Compute the longitudinal speed of the rigid body transformed to the world frame.
Definition PxVehicleRigidBodyStates.h:87
Definition PxVehicleParams.h:672
Definition PxVehicleParams.h:369
Distribute a steer response to the wheels of a vehicle.
Definition PxVehicleSteeringParams.h:58
A description of a tank differential.
Definition PxVehicleDrivetrainParams.h:853
A description of the state of transmission-related commands that are applied to a vehicle with tank d...
Definition PxVehicleCommandStates.h:120
PxReal thrusts[2]
The wheels of each tank track are either all connected to thrusts[0] or all connected to thrusts[1].
Definition PxVehicleCommandStates.h:126
Specify groups of wheels that are to be constrained to have pre-determined angular velocity relations...
Definition PxVehicleDrivetrainStates.h:179