Open 3D Engine ROS2 Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
ROS2::VehicleDynamics::DriveModel Class Referenceabstract

Abstract class for turning vehicle inputs into behavior of wheels and steering elements. More...

#include <DriveModel.h>

Inherited by ROS2::VehicleDynamics::AckermannDriveModel, and ROS2::VehicleDynamics::SkidSteeringDriveModel.

Public Types

enum class  DriveModelType { SimplifiedDriveModelType }
 

Public Member Functions

 AZ_RTTI (DriveModel, "{1B57E83D-19BF-4403-8712-1AE98A12F0CD}")
 
virtual void Activate (const VehicleConfiguration &vehicleConfig)=0
 
void ApplyInputState (const VehicleInputs &inputs, AZ::u64 deltaTimeNs)
 
virtual AZStd::pair< AZ::Vector3, AZ::Vector3 > GetVelocityFromModel ()=0
 
void SetDisabled (bool isDisable)
 
VehicleInputs GetMaximumPossibleInputs () const
 Get vehicle maximum limits.
 

Static Public Member Functions

static void Reflect (AZ::ReflectContext *context)
 

Protected Member Functions

virtual const VehicleModelLimitsGetVehicleLimitPtr () const =0
 Returns pointer to implementation specific Vehicle limits.
 
virtual void ApplyState (const VehicleInputs &inputs, AZ::u64 deltaTimeNs)=0
 Apply input to implemented vehicle model.
 

Protected Attributes

bool m_disabled { false }
 True if model is disabled.
 

Detailed Description

Abstract class for turning vehicle inputs into behavior of wheels and steering elements.

Member Function Documentation

◆ Activate()

virtual void ROS2::VehicleDynamics::DriveModel::Activate ( const VehicleConfiguration vehicleConfig)
pure virtual

Activate the model. Vehicle configuration is to remain the same until another Activate is called.

Parameters
vehicleConfigconfiguration containing axes and wheels information

Implemented in ROS2::VehicleDynamics::AckermannDriveModel, and ROS2::VehicleDynamics::SkidSteeringDriveModel.

◆ ApplyInputState()

void ROS2::VehicleDynamics::DriveModel::ApplyInputState ( const VehicleInputs inputs,
AZ::u64  deltaTimeNs 
)

Applies inputs to the drive. This model will calculate and apply physical forces.

Parameters
inputscaptured state of inputs to use.
deltaTimeNsnanoseconds passed since last call of this function.

◆ ApplyState()

virtual void ROS2::VehicleDynamics::DriveModel::ApplyState ( const VehicleInputs inputs,
AZ::u64  deltaTimeNs 
)
protectedpure virtual

Apply input to implemented vehicle model.

Implemented in ROS2::VehicleDynamics::AckermannDriveModel, and ROS2::VehicleDynamics::SkidSteeringDriveModel.

◆ GetVehicleLimitPtr()

virtual const VehicleModelLimits * ROS2::VehicleDynamics::DriveModel::GetVehicleLimitPtr ( ) const
protectedpure virtual

Returns pointer to implementation specific Vehicle limits.

Implemented in ROS2::VehicleDynamics::AckermannDriveModel, and ROS2::VehicleDynamics::SkidSteeringDriveModel.

◆ GetVelocityFromModel()

virtual AZStd::pair< AZ::Vector3, AZ::Vector3 > ROS2::VehicleDynamics::DriveModel::GetVelocityFromModel ( )
pure virtual

Computes expected velocity from individual wheels velocity. The method queries all wheels for rotation speed, and computes vehicle's expected velocity in its coordinate frame.

Returns
pair of linear and angular velocities

Implemented in ROS2::VehicleDynamics::AckermannDriveModel, and ROS2::VehicleDynamics::SkidSteeringDriveModel.

◆ SetDisabled()

void ROS2::VehicleDynamics::DriveModel::SetDisabled ( bool  isDisable)

Allows to disable vehicle dynamics.

Parameters
isDisabletrue if drive model should be disabled.

The documentation for this class was generated from the following file: