Package org.robwork.sdurw_simulation
Class SimulatedControllerPtr
- java.lang.Object
-
- org.robwork.sdurw_simulation.SimulatedControllerPtr
-
public class SimulatedControllerPtr extends java.lang.Object
Ptr stores a pointer and optionally takes ownership of the value.
-
-
Constructor Summary
Constructors Constructor Description SimulatedControllerPtr()
Default constructor yielding a NULL-pointer.SimulatedControllerPtr(long cPtr, boolean cMemoryOwn)
SimulatedControllerPtr(SimulatedController 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 SimulatedController
__ref__()
Dereferencing operator.void
delete()
SimulatedController
deref()
The pointer stored in the object.boolean
equals(SimulatedController p)
ControllerPtr
getControllerHandle(SimulatorPtr sim)
get the controller handle eg.ControllerModelPtr
getControllerModel()
get the controllermodel of this simulated controllerjava.lang.String
getControllerName()
get the name of this controllerstatic long
getCPtr(SimulatedControllerPtr obj)
SimulatedController
getDeref()
Member access operator.StateStructurePtr
getStateStructure()
Get the state structure.boolean
isEnabled()
true if this controller is enabledboolean
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
reset(State state)
reset the controller to the applied statevoid
setEnabled(boolean enabled)
disable or enable this controllervoid
unregister()
unregisters all state data of this stateless objectvoid
update(Simulator.UpdateInfo info, State state)
updates/steps the controller with time step dt.
-
-
-
Constructor Detail
-
SimulatedControllerPtr
public SimulatedControllerPtr(long cPtr, boolean cMemoryOwn)
-
SimulatedControllerPtr
public SimulatedControllerPtr()
Default constructor yielding a NULL-pointer.
-
SimulatedControllerPtr
public SimulatedControllerPtr(SimulatedController ptr)
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
-
-
Method Detail
-
getCPtr
public static long getCPtr(SimulatedControllerPtr obj)
-
delete
public void delete()
-
deref
public SimulatedController deref()
The pointer stored in the object.
-
__ref__
public SimulatedController __ref__()
Dereferencing operator.
-
getDeref
public SimulatedController getDeref()
Member access operator.
-
equals
public boolean equals(SimulatedController 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
-
getControllerName
public java.lang.String getControllerName()
get the name of this controller- Returns:
- name of this controller
-
update
public void update(Simulator.UpdateInfo info, State state)
updates/steps the controller with time step dt. It will update
the state state accordingly- Parameters:
info
- [in] update information related to the time step.state
- [in/out] the current state
-
reset
public void reset(State state)
reset the controller to the applied state- Parameters:
state
- [in] the state to reset to
-
getControllerHandle
public ControllerPtr getControllerHandle(SimulatorPtr sim)
get the controller handle eg. statefull handle, associated with this simulated
controller- Returns:
-
getControllerModel
public ControllerModelPtr getControllerModel()
get the controllermodel of this simulated controller- Returns:
-
setEnabled
public void setEnabled(boolean enabled)
disable or enable this controller- Parameters:
enabled
-
-
isEnabled
public boolean isEnabled()
true if this controller is enabled- Returns:
-
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.
-
-