488 virtual
bool addNotification(
agxSDK::Simulation* simulation) override;
492 virtual
bool removeNotification(
agxUtil::ConstraintHolder* constraintHolder,
agxSDK::Simulation* simulation) override;
497 virtual
bool store(
agxStream::StorageStream& str) const override;
502 virtual
bool postStore(
agxStream::StorageStream& str) const override;
507 virtual
bool restore(
agxStream::StorageStream& str) override;
512 virtual
bool postRestore(
agxStream::StorageStream& str) override;
#define AGX_DECLARE_POINTER_TYPES(type)
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
Power generator that adds torque to the engine according to a lookup table.
virtual bool store(agxStream::StorageStream &str) const override
Stores internal data into stream.
EnginePowerGenerator(agxPowerLine::RotationalDimension *dimension, agx::Real minTorque)
Create an engine power generator.
void setMinTorque(agx::Real minTorque)
The min torque is the torque an engine produces at idle.
virtual agx::Real resultScalerFunction() const override
Scales the resulting torque with the throttle input to the engine.
virtual bool restore(agxStream::StorageStream &str) override
Restores internal data from stream.
agx::Real getMinTorque() const
virtual agx::Real variableLookupFunction() const override
Finds the current RPM (and not angular velocity)
virtual agx::Real getCurrentPowerTimeIntegral() const override
Return the current torque to add (time integral of power)
virtual ~EnginePowerGenerator()
An engine that is driven by an EnginePowerGenerator.
virtual bool preUpdate(agx::Real timeStep) override
Function called by static functions.
void setIdleRPM(agx::Real idleRPM)
Set the wanted RPM when there is no throttle.
Engine()
Create an engine with an EnginePowerGenerator.
virtual bool restore(agxStream::StorageStream &str) override
Restores internal data from stream.
agx::Real getRPM() const
Get revolutions per minute.
void setThrottle(agx::Real throttle)
Set the throttle input.
agxPowerLine::PowerGenerator * getPowerGenerator() const
virtual agx::Real getThrottle() const
virtual bool store(agxStream::StorageStream &str) const override
Stores internal data into stream.
agx::Real getIdleRPM() const
void setPowerGenerator(agxPowerLine::PowerGenerator *generator)
Set the power generator to use for this engine.
agxPowerLine::PowerGeneratorRef m_generator
An engine that tries to hold a fixed velocity.
agxDriveTrain::VelocityConstraint * getConstraint()
void setTargetVelocity(agx::Real velocity)
Set the target velocity of the engine.
void setTorqueRange(agx::RangeReal range)
Set the torque range to limit the available torque of the engine.
agx::RangeReal getTorqueRange()
const agxDriveTrain::VelocityConstraint * getConstraint() const
FixedVelocityEngine()
Create an engine with target velocity set to zero.
agx::Real getTargetVelocity()
agx::Real getCurrentTorque()
Get the torque applied on the engine during the last time step.
void setTargetRpm(agx::Real rpm)
Set the RPM that the engine should try to hold.
Implementation of a combustion engine.
ThrottleCalculatorRef m_pidController
void setExtraLoad(agx::Real torque)
Use the extra load to be able to set an extra torque loss to simulate friction, electrical systems lo...
agx::Real getLoadTorque() const
agx::Real getTorqueAtRPM(agx::Real rpm) const
virtual ~PidControlledEngine()
PidControlledEngine()
Create an engine with an empty torque table and no ThrottleCalculator.
void setRPMTorqueTable(const agx::RealPairVector &rpm_torques)
Give the engine output torque at different engine RPMs.
void setThrottleCalculator(ThrottleCalculator *controller)
Set a throttle controller that will be asked for a throttle every time step while the engine is turne...
virtual bool preUpdate(agx::Real timeStamp) override
Function that has to be public since it is called by static functions.
agx::Real getTorque() const
agx::Real getExtraLoad() const
const ThrottleCalculator * getThrottleCalculator() const
virtual bool store(agxStream::StorageStream &str) const override
Stores internal data into stream.
void setRPMPowerTable(const agx::RealPairVector &rpm_power)
Give the engine output power at different engine RPMs.
ThrottleCalculator * getThrottleCalculator()
void shutdown(bool shutdown)
Turn off the ignition key.
virtual bool restore(agxStream::StorageStream &str) override
Restores internal data from stream.
void ignition(bool ignition)
If ignition is true - start the engine.
ThrottleCalculator that strives to keep the engine at some given RPM.
RpmController(PidControlledEngine *engine, agx::Real targetRpm, agx::Real pGain, agx::Real dGain, agx::Real iGain, agx::Real iRange)
Create a RpmController that operates on the given engine.
agx::Real getLastThrottle() const
virtual bool store(agxStream::StorageStream &str) const override
Stores internal data into stream.
virtual bool restore(agxStream::StorageStream &str) override
Restores internal data from stream.
virtual agx::Real calculateThrottle() override
Classes inheriting from ThrottleCalculator has to implement the calculateThrottle function.
agx::Real getTargetRpm() const
void setTargetRpm(agx::Real targetRpm)
A Shaft is the most basic PowerLine Unit.
Inherit from the ThrottleCalculator and implement the calculateThrottle() function to control the tor...
virtual ~ThrottleCalculator()
void store(agxStream::OutputArchive &out) const override
AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE(agxDriveTrain::ThrottleCalculator)
virtual bool store(agxStream::StorageStream &str) const
Stores internal data into stream.
virtual agx::Real calculateThrottle()=0
Classes inheriting from ThrottleCalculator has to implement the calculateThrottle function.
virtual bool restore(agxStream::StorageStream &str)
Restores internal data from stream.
PidControlledEngine * m_engine
void setEngine(PidControlledEngine *engine)
Set an engine to the controller.
void restore(agxStream::InputArchive &in) override
const PidControlledEngine * getEngine() const
PidControlledEngine * getEngine()
ThrottleCalculator(PidControlledEngine *engine)
Create a ThrottleCalculator given a PidControlledEngine.
A constraint holding a single VelocityConstraintImplementation.
Will generate power by adding a load to a physical dimension.
The rotational has one rotational degree of freedom.
A torque generator adds torque to the body of a rotational dimension.
Class for writing serialized data in binary format to a stream.
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Abstract base class for storing/restoring a line/drums with version control.
Base class providing referencing counted objects.
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
A library of agxPowerLine components designed to model the various parts of a vehicle drive train.
agx::ref_ptr< RpmController > RpmControllerRef
agx::ref_ptr< PidControlledEngine > PidControlledEngineRef
agx::ref_ptr< ThrottleCalculator > ThrottleCalculatorRef
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
This namespace contain classes for streaming classes into archives, ASCII, binary for storage (serial...
The agxUtil namespace contain classes and methods for utility functionality.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.