Package org.robwork.sdurw_models
Class RigidObjectPtr
- java.lang.Object
-
- org.robwork.sdurw_models.RigidObjectPtr
-
public class RigidObjectPtr extends java.lang.Object
Ptr stores a pointer and optionally takes ownership of the value.
-
-
Constructor Summary
Constructors Constructor Description RigidObjectPtr()
Default constructor yielding a NULL-pointer.RigidObjectPtr(long cPtr, boolean cMemoryOwn)
RigidObjectPtr(RigidObject ptr)
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RigidObject
__ref__()
Dereferencing operator.void
addFrame(FramePtr frame)
associate a frame to this Object.void
addGeometry(GeometryPtr geom)
add collision geometry from this objectvoid
addModel(Model3DPtr model)
add visualization model to this objectvoid
approximateInertia()
approximates inertia based on geometry, mass and center of mass propertiesvoid
approximateInertiaCOM()
approximates inertia and center of mass based on geometry and mass propertiesRigidObjectCPtr
cptr()
void
delete()
RigidObject
deref()
The pointer stored in the object.boolean
equals(RigidObject p)
Frame
getBase()
get base frame of this objectVector3D
getCOM()
get the center of mass of this rigid body seen in the base frameVector3D
getCOM(State state)
static long
getCPtr(RigidObjectPtr obj)
RigidObject
getDeref()
Member access operator.FrameVector
getFrames()
get all associated frames of this objectVectorGeometryPtr
getGeometry()
get geometry of this rigid objectInertiaMatrixd
getInertia()
get the inertia matrix of this rigid body seen in the base frameInertiaMatrixd
getInertia(State state)
double
getMass()
returns the mass of this RigidObjectdouble
getMass(State state)
Model3DPtrVector
getModels()
get visualization models for this rigid objectjava.lang.String
getName()
get name of this object.StateStructurePtr
getStateStructure()
Get the state structure.boolean
isNull()
checks if the pointer is nullboolean
isRegistered()
Check if object has registered its state.boolean
isShared()
check if this Ptr has shared ownership or none
ownershipvoid
registerIn(State state)
initialize this stateless data to a specific statevoid
registerIn(StateStructurePtr state)
register this stateless object in a statestructure.void
removeGeometry(GeometryPtr geom)
remove collision geometry from this objectvoid
removeModel(Model3DPtr model)
remove visualization model to this rigid objectvoid
setCOM(Vector3D com)
set the center of mass of this rigid body seen in the base framevoid
setInertia(InertiaMatrixd inertia)
set inertia of this rigid objectvoid
setMass(double mass)
set mass of this RigidObjectvoid
unregister()
unregisters all state data of this stateless object
-
-
-
Constructor Detail
-
RigidObjectPtr
public RigidObjectPtr(long cPtr, boolean cMemoryOwn)
-
RigidObjectPtr
public RigidObjectPtr()
Default constructor yielding a NULL-pointer.
-
RigidObjectPtr
public RigidObjectPtr(RigidObject ptr)
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
-
-
Method Detail
-
getCPtr
public static long getCPtr(RigidObjectPtr obj)
-
delete
public void delete()
-
deref
public RigidObject deref()
The pointer stored in the object.
-
__ref__
public RigidObject __ref__()
Dereferencing operator.
-
getDeref
public RigidObject getDeref()
Member access operator.
-
equals
public boolean equals(RigidObject p)
-
isShared
public boolean isShared()
check if this Ptr has shared ownership or none
ownership- Returns:
- true if Ptr has shared ownership, false if it has no ownership.
-
isNull
public boolean isNull()
checks if the pointer is null- Returns:
- Returns true if the pointer is null
-
cptr
public RigidObjectCPtr cptr()
-
addGeometry
public void addGeometry(GeometryPtr geom)
add collision geometry from this object- Parameters:
geom
- [in] the geometry to add
-
removeGeometry
public void removeGeometry(GeometryPtr geom)
remove collision geometry from this object- Parameters:
geom
- [in] the geometry to remove
-
addModel
public void addModel(Model3DPtr model)
add visualization model to this object- Parameters:
model
- [in] the model to be added
-
removeModel
public void removeModel(Model3DPtr model)
remove visualization model to this rigid object- Parameters:
model
- [in] the model to be removed
-
getMass
public double getMass()
returns the mass of this RigidObject- Returns:
- mass of the Object
-
getMass
public double getMass(State state)
-
setMass
public void setMass(double mass)
set mass of this RigidObject- Parameters:
mass
- [in] the mass of this object
-
getInertia
public InertiaMatrixd getInertia()
get the inertia matrix of this rigid body seen in the base frame- Returns:
- IntertiaMatrix
-
getInertia
public InertiaMatrixd getInertia(State state)
-
setInertia
public void setInertia(InertiaMatrixd inertia)
set inertia of this rigid object- Parameters:
inertia
- [in] the inertia of this object
-
getCOM
public Vector3D getCOM()
get the center of mass of this rigid body seen in the base frame- Returns:
- the center of mass 3D coordinate
-
setCOM
public void setCOM(Vector3D com)
set the center of mass of this rigid body seen in the base frame
-
approximateInertia
public void approximateInertia()
approximates inertia based on geometry, mass and center of mass properties
-
approximateInertiaCOM
public void approximateInertiaCOM()
approximates inertia and center of mass based on geometry and mass properties
-
getGeometry
public VectorGeometryPtr getGeometry()
get geometry of this rigid object- Returns:
- a list of all Geometries
-
getModels
public Model3DPtrVector getModels()
get visualization models for this rigid object- Returns:
- a list of all models
-
getName
public java.lang.String getName()
get name of this object. Name is always the same as the name of the
base frame.- Returns:
- name of object.
-
getBase
public Frame getBase()
get base frame of this object- Returns:
- base frame of object
-
getFrames
public FrameVector getFrames()
get all associated frames of this object- Returns:
- a vector of frames
-
addFrame
public void addFrame(FramePtr frame)
associate a frame to this Object.- Parameters:
frame
- [in] frame to associate to object
-
registerIn
public void registerIn(State state)
initialize this stateless data to a specific state- Parameters:
state
- [in] the state in which to register the data.
Note: the data will be registered in the state structure of the state
and any copies or other instances of the state will therefore also
contain the added states.
-
registerIn
public void registerIn(StateStructurePtr state)
register this stateless object in a statestructure.
-
unregister
public void unregister()
unregisters all state data of this stateless object
-
getStateStructure
public StateStructurePtr getStateStructure()
Get the state structure.- Returns:
- the state structure.
-
isRegistered
public boolean isRegistered()
Check if object has registered its state.- Returns:
- true if registered, false otherwise.
-
-