32 template<
typename T1,
typename T2>
72 class VelocityConstraint;
131 const T&
at(
size_t index )
const;
183 ID_COLLISION_OCCURRED
190 FULL = MOTION + DYNAMIC
205 bool useRotation =
true
208 : m_body(body), m_transform(
transform), m_translationalCompliance(translationalCompliance),
209 m_rotationalCompliance(rotationalCompliance), m_translationalThreshold(translationalThreshold),
210 m_rotationThreshold(rotationThreshold), m_useRotation(useRotation)
214 m_rotationalCompliance(
agx::
Real(1)), m_translationalThreshold(
agx::
Real(1)),
215 m_rotationThreshold(
agx::
Real(1)), m_useRotation(true)
428 agx::Real time,
agx::Real positionThreshold,
agx::Real rotationThreshold,
const bool stopAtCollision =
false,
const bool onlyMotionSimulation =
false);
451 const agx::RealVector& timestamps,
agx::Real positionThreshold,
agx::Real rotationThreshold,
const bool stopAtCollision =
false,
const bool onlyMotionSimulation =
false);
476 const bool stopAtCollision =
false,
477 const bool onlyMotionSimulation =
false);
490 const bool stopAtCollision =
false,
491 const bool onlyMotionSimulation =
false);
711 using PowerLineRefPair = std::pair<agxPowerLine::PowerLineRef, agxPowerLine::PowerLineRef>;
714 using PowerLineUnitPair = std::pair<agxPowerLine::Unit*, agxPowerLine::Unit*>;
717 void reserveData(
const size_t numReserveFrames);
732 const bool stopAtCollision =
false,
733 const bool onlyMotionSimulation =
false);
740 const bool stopAtCollision =
false,
741 const bool onlyMotionSimulation =
false);
745 void removeKinematicObjects();
765 void setupInternalPowerlines(
799 const bool stopAtCollision =
false,
800 const bool onlyMotionSimulation =
false);
842 agx::UInt m_numPowerLineValuesPerTimestep;
857 return *(m_ptr + index);
864 return *(m_ptr + index);
A read-only view into data computed by InverseDynamics.
const T & at(size_t index) const
Fetch value at index. Input index must be less than size.
const T & operator[](size_t index) const
size_t size() const
Number of elements accessible via this view into the data.
Class for computing forces/torques which can be used to reach a desired configuration.
agx::AffineMatrix4x4 getLastTrajectoryTransform()
Return the last transform the solve method reached during the trajectory computation.
agx::Real getLastTrajectoryTimeStamp() const
Returns the last timestamp used during trajectory computation.
InverseDynamicsStatus solve(const agx::RigidBody *body, agx::AffineMatrix4x4 transform, agx::Real time, agx::Real positionThreshold, agx::Real rotationThreshold, const bool stopAtCollision=false, const bool onlyMotionSimulation=false)
Try to find a pose for the structure so the specified body has the requested transform after the spec...
IDUnitValueView getPowerLineValues(size_t frameIndex)
Fetch possible values for agxPowerLine Units.
InverseDynamicsStatus solveLinear(const agx::RigidBody *body, agx::AffineMatrix4x4 transform, agx::Real time, agx::Real positionThreshold, agx::Real rotationThreshold, const bool stopAtCollision=false, const bool onlyMotionSimulation=false)
Try to find a pose for the structure so the specified body has the requested transform after the spec...
agx::UInt getCurrentFrameIndex() const
Return the internal frame count.
bool sync(agxModel::InverseDynamics::SyncLevel level=agxModel::InverseDynamics::FULL)
This method will synchronize transforms and velocities so that solve calls operate on data that is in...
InverseDynamicsStatus gravityCompensation()
Compute joint forces needed to compensate for gravity.
bool setMotionControl(const agx::RigidBody *body, agx::RigidBody::MotionControl mc)
Update the motion control to specified value for the internal bodies that are mirroring the specified...
agx::Real computeRotationalDifference(const agx::RigidBody *body) const
Compute the rotational difference between body and the matching internal clone that is used in dynami...
InverseDynamics::InverseDynamicsStatus finalizeAdaptiveSolveN()
End the adaptive solve.
agx::AffineMatrix4x4 getLastDynamicsTransform()
Return the last transform the solve method reached during the force computations.
agx::Real getLastDynamicsTimeStamp() const
Returns the last timestamp reached during the force computations.
void forceStepDynamicsSimulation()
Will step the dynamics simulation one time step.
@ FULL
Sync everything given the source.
const agxSDK::Assembly * getMotionData() const
Fetch the internal Collection holding the cloned bodies and constraints that are used for motion/traj...
InverseDynamics(const agxSDK::Simulation *sim, const agx::RigidBodyRefVector &bodies, const agx::ConstraintRefVector &constraints)
Create an InverseDynamics instance holding structures matching the input bodies and constraints.
const agxSDK::Assembly * getDynamicsData() const
Fetch the internal Collection holding the cloned bodies and constraints that are used for dynamics/fo...
InverseDynamicsStatus solve(const agx::RigidBody *body, const agx::AffineMatrix4x4Vector &transforms, const agx::RealVector ×tamps, agx::Real positionThreshold, agx::Real rotationThreshold, const bool stopAtCollision=false, const bool onlyMotionSimulation=false)
Similar to solve, but with a series of transforms and delta timestamps.
InverseDynamics(const agxSDK::Simulation *sim, const agx::RigidBodyRefVector &bodies, const agx::ConstraintRefVector &constraints, const agx::ConstraintRefVector &otherConstraints)
This constructor is similar to the three argument constructor but also includes an additional vector ...
InverseDynamics(const agxSDK::Simulation *sim, const agx::RigidBodyRefVector &bodies, const agx::ConstraintRefVector &constraints, const agx::ConstraintRefVector &otherConstraints, const agxPowerLine::PowerLineRefVector &powerlines, const agxPowerLine::UnitRefVector &units)
Create an InverseDynamics instance holding structures matching the input bodies, constraints and powe...
agx::Real computeTranslationalDifference(const agx::RigidBody *body, const agx::AffineMatrix4x4 &transform) const
Compute the translational difference between input transform and the internal body used for dynamics ...
InverseDynamics(const agxSDK::Simulation *sim, const agx::RigidBodyRefVector &bodies, const agx::ConstraintRefVector &constraints, const agxPowerLine::PowerLineRefVector &powerlines, const agxPowerLine::UnitRefVector &units)
Create an InverseDynamics instance holding structures matching the input bodies, constraints and powe...
agx::Real computeTranslationalDifference(const agx::RigidBody *body) const
Compute the translational difference between body and the matching internal clone that is used in dyn...
const agxSDK::Assembly * getSourceData() const
Fetch the internal Collection holding the input bodies and constraints.
InverseDynamics::InverseDynamicsStatus solveLinearN(const InverseDynamics::MoveOperationVector &moves, agx::Real time, const bool stopAtCollision=false, const bool onlyMotionSimulation=false)
This solve method will try to move the specified bodies along individual linear paths,...
agx::Vector< InverseDynamics::MoveOperation > MoveOperationVector
agx::Real computeRotationalDifference(const agx::RigidBody *body, const agx::AffineMatrix4x4 &transform) const
Compute the rotational difference between input transform and the internal body used for dynamics com...
InverseDynamics::InverseDynamicsStatus updateAdaptiveSolveN(const InverseDynamics::MoveOperationVector &moves, agx::Real time)
This update will define new target transforms for the moves already assigned at intitializeAdaptiveSo...
IDJointValueView getJointAngles(size_t frameIndex)
If solve saved angles, fetch the values for specified frame.
InverseDynamicsStatus
Enumeration with status values returned from InverseDynamics.
@ ID_INVALID_TIME
Invalid timestamp provided as argument.
@ ID_BODY_NOT_FOUND
Provided body argument not found.
@ ID_VALID_POSE_NOT_FOUND
A valid pose could not be found with provided thresholds.
@ ID_SUCCESS
Return value for successful operation.
@ ID_BAD_ARGUMENTS
Problem with timestamp and/or transform input values.
void forceStepMotionSimulation()
Will step the motion simulation one time step.
IDJointValueView getJointForces(size_t frameIndex)
Fetch joint forces produced by solve call or gravityCompensation.
InverseDynamics::InverseDynamicsStatus stepAdaptiveSolveN()
Step the adaptive solve one timestep.
size_t getNumFrames() const
Return the number of frames worth of force data that is available.
InverseDynamics::InverseDynamicsStatus initializeAdaptiveSolveN(const InverseDynamics::MoveOperationVector &moves, agx::Real time)
Initialize a solve for N bodies, with desired end transforms.
PowerLine is the base class for a system of power transfer integrated into the rigid body simulation.
An assembly is a collection of basic simulation objects, such as rigid bodies, constraints,...
A Collection is a collection of basic simulation objects, such as rigid bodies, constraints,...
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
The base class for a constraint.
Constraint that removes all 6 DOF between two bodies, or one body and the world.
Base class providing referencing counted objects.
The rigid body class, combining a geometric model and a frame of reference.
MotionControl
The MotionControl enumeration indicates what makes a RigidBody move.
This class is a combined container which has the find complexity of a HashTable, deterministic iterat...
Vector containing 'raw' data.
Smart pointer for handling referenced counted objects.
void AGXCORE_EXPORT transform(void *target, const Format *targetFormat, const void *source, const Format *sourceFormat, size_t numElements)
Transform data between two buffers.
A library of agxPowerLine components designed to model the various parts of a vehicle drive train.
Contain classes for higher level modeling primitives, such as Tree, Terrain etc.
struct agxModel::IDUnitValue IDUnitValue
Struct holding information about an agxPowerLine::Unit.
struct agxModel::IDJointValue IDJointValue
Struct holding information about a joint.
agxPowerLine contains a collection of connected components that transport power across a system.
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
agx::ref_ptr< Simulation > SimulationRef
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
AffineMatrix4x4T< Real > AffineMatrix4x4
agx::ref_ptr< const RigidBody > RigidBodyConstRef
Struct holding information about a joint.
Struct holding information about an agxPowerLine::Unit.
agx::UInt32 dimensionIndex
agxPowerLine::Unit * unit
Struct for defining a move operation during one call to one of the solve functions of InverseDynamics...
agx::Real m_rotationThreshold
agx::Real m_translationalCompliance
agx::Real m_rotationalCompliance
agx::RigidBodyObserver m_body
MoveOperation(agx::RigidBody *body, const agx::AffineMatrix4x4 &transform, agx::Real translationalCompliance, agx::Real rotationalCompliance, agx::Real translationalThreshold, agx::Real rotationThreshold, bool useRotation=true)
agx::AffineMatrix4x4 m_transform
agx::Real m_translationalThreshold