Package org.robwork.sdurw_models
Class WorkCellPtr
- java.lang.Object
-
- org.robwork.sdurw_models.WorkCellPtr
-
public class WorkCellPtr extends java.lang.Object
Ptr stores a pointer and optionally takes ownership of the value.
-
-
Constructor Summary
Constructors Constructor Description WorkCellPtr()
Default constructor yielding a NULL-pointer.WorkCellPtr(long cPtr, boolean cMemoryOwn)
WorkCellPtr(WorkCell 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 Deprecated Methods Modifier and Type Method Description WorkCell
__ref__()
Dereferencing operator.void
add(ControllerModelPtr controller)
Add controllermodel to workcellvoid
add(DevicePtr device)
Add device to workcellvoid
add(ObjectPtr object)
Add object to workcellvoid
add(SensorModelPtr sensor)
Add sensormodel to workcellvoid
addDAF(FramePtr frame)
Adds dynamically attachable frame (DAF) frame with
parent as parent.
If parent == NULL, then world is used as parent
void
addDAF(FramePtr frame, FramePtr parent)
Adds dynamically attachable frame (DAF) frame with
parent as parent.
If parent == NULL, then world is used as parent
void
addDevice(DevicePtr device)
Adds a Device to the WorkCell.
Ownership of device is taken.
void
addFrame(FramePtr frame)
Adds frame with parent as parent.
If parent == NULL, then world is used as parent
void
addFrame(FramePtr frame, FramePtr parent)
Adds frame with parent as parent.
If parent == NULL, then world is used as parent
WorkCellCPtr
cptr()
void
delete()
WorkCell
deref()
The pointer stored in the object.boolean
equals(WorkCell p)
ControllerModelPtr
findController(java.lang.String name)
Returns controller with the specified name.
If multiple controlelrs has the same name, the first controller
encountered will be returned.DevicePtr
findDevice(java.lang.String name)
The device named name of the workcell.
NULL is returned if there is no such device.
FixedFrame
findFixedFrame(java.lang.String name)
Returns FixedFrame with the specified name.
If multiple frames has the same name, the first frame encountered
will be returned.VectorFixedFrame
findFixedFrames()
Returns all FixedFrame.Frame
findFrame(java.lang.String name)
Returns frame with the specified name.
If multiple frames has the same name, the first frame encountered
will be returned.JointDevicePtr
findJointDevice(java.lang.String name)
The device named name of the workcell.
NULL is returned if there is no such device.
JointDevicePtrVector
findJointDevices()
Returns a vector with pointers to the Device(s) with a
specific type JointDevice in the WorkCell
MovableFrame
findMovableFrame(java.lang.String name)
Returns MovableFrame with the specified name.
If multiple frames has the same name, the first frame encountered
will be returned.MovableFrameVector
findMovableFrames()
Returns all MovableFrames.ObjectPtr
findObject(java.lang.String name)
The object named name of the workcell.
NULL is returned if there is no such object.
ParallelDevicePtr
findParallelDevice(java.lang.String name)
The device named name of the workcell.
NULL is returned if there is no such device.
VectorParallelDevicePtr
findParallelDevices()
Returns a vector with pointers to the Device(s) with a
specific type ParallelDevice in the WorkCell
SensorModelPtr
findSensor(java.lang.String name)
Returns sensor with the specified name.
If multiple sensors has the same name, the first sensor
encountered will be returned.SerialDevicePtr
findSerialDevice(java.lang.String name)
The device named name of the workcell.
NULL is returned if there is no such device.
VectorSerialDevicePtr
findSerialDevices()
Returns a vector with pointers to the Device(s) with a
specific type SerialDevice in the WorkCell
TreeDevicePtr
findTreeDevice(java.lang.String name)
The device named name of the workcell.
NULL is returned if there is no such device.
VectorTreeDevicePtr
findTreeDevices()
Returns a vector with pointers to the Device(s) with a
specific type TreeDevice in the WorkCell
java.lang.String
getCalibrationFilename()
Returns the filename of the calibration associated to the
work cell.
Returns an empty string in case no calibration is associated.
To load the file use the getFilePath()+getCalibrationFilename()
to get the absolute locationSWIGTYPE_p_rw__proximity__CollisionSetup
getCollisionSetup()
Returns collision setup associated to work cellControllerModelPtrVector
getControllers()
Returns all controllers in workcellstatic long
getCPtr(WorkCellPtr obj)
State
getDefaultState()
Returns a default StateWorkCell
getDeref()
Member access operator.DevicePtrVector
getDevices()
Returns a reference to a vector with pointers to the
Device(s) in the WorkCell
java.lang.String
getFilename()
Returns the full path and filename of the workcell.
If the workcell is loaded from file, then this method returns the
full filename.java.lang.String
getFilePath()
Returns the path of where the work cell is located
If the workcell is not loaded from file, it returns an empty
stringFrameVector
getFrames()
Returns all frames in workcelljava.lang.String
getName()
The name of the workcell or the empty string if no name
was provided.ObjectPtrVector
getObjects()
Returns all object in the work cell
PropertyMap
getPropertyMap()
Properties of this workcellSWIGTYPE_p_rw__core__PtrT_rw__graphics__SceneDescriptor_t
getSceneDescriptor()
Get the scene descriptor.VectorSensorModelPtr
getSensors()
Returns all frames in workcellStateStructurePtr
getStateStructure()
gets the complete state structure of the workcell.Frame
getWorldFrame()
Returns pointer to the world frame
boolean
isNull()
checks if the pointer is nullboolean
isShared()
check if this Ptr has shared ownership or none
ownershipvoid
remove(FramePtr frame)
Deprecated.Since January 2018.
Please use remove(rw::core::Ptr<rw::kinematics::Frame>)
instead.void
remove(ControllerModelPtr controller)
Remove controllermodel from workcellvoid
remove(DevicePtr device)
Remove device from workcellvoid
remove(ObjectPtr object)
Remove object from workcellvoid
remove(SensorModelPtr sensor)
Remove sensormodel from workcellvoid
removeObject(Object object)
Removes object from workcell
void
setCalibrationFilename(java.lang.String calibrationFilename)
Sets the filename of the calibration file
void
setDefaultState(State state)
set the default state of the WorkCell.
if the given state is an older state then states valid in both
new and old version will be copied to the default state.void
setSceneDescriptor(SWIGTYPE_p_rw__core__PtrT_rw__graphics__SceneDescriptor_t scene)
Set the scene descriptor.java.lang.String
toString()
-
-
-
Constructor Detail
-
WorkCellPtr
public WorkCellPtr(long cPtr, boolean cMemoryOwn)
-
WorkCellPtr
public WorkCellPtr()
Default constructor yielding a NULL-pointer.
-
WorkCellPtr
public WorkCellPtr(WorkCell ptr)
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
-
-
Method Detail
-
getCPtr
public static long getCPtr(WorkCellPtr obj)
-
delete
public void delete()
-
deref
public WorkCell deref()
The pointer stored in the object.
-
__ref__
public WorkCell __ref__()
Dereferencing operator.
-
getDeref
public WorkCell getDeref()
Member access operator.
-
equals
public boolean equals(WorkCell 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 WorkCellCPtr cptr()
-
getName
public java.lang.String getName()
The name of the workcell or the empty string if no name
was provided.- Returns:
- the name of the workcell
-
getWorldFrame
public Frame getWorldFrame()
Returns pointer to the world frame
- Returns:
- Pointer to the world frame
-
addFrame
public void addFrame(FramePtr frame, FramePtr parent)
Adds frame with parent as parent.
If parent == NULL, then world is used as parent
- Parameters:
frame
- [in] Frame to addparent
- [in] Parent frame - uses World is parent == NULL
-
addFrame
public void addFrame(FramePtr frame)
Adds frame with parent as parent.
If parent == NULL, then world is used as parent
- Parameters:
frame
- [in] Frame to add
-
addDAF
public void addDAF(FramePtr frame, FramePtr parent)
Adds dynamically attachable frame (DAF) frame with
parent as parent.
If parent == NULL, then world is used as parent
- Parameters:
frame
- [in] Frame to addparent
- [in] Parent frame - uses World is parent == NULL
-
addDAF
public void addDAF(FramePtr frame)
Adds dynamically attachable frame (DAF) frame with
parent as parent.
If parent == NULL, then world is used as parent
- Parameters:
frame
- [in] Frame to add
-
remove
public void remove(FramePtr frame)
Deprecated.Since January 2018.
Please use remove(rw::core::Ptr<rw::kinematics::Frame>)
instead.Removes frame from work cell
- Parameters:
frame
- [in] Frame to remove
-
remove
public void remove(ObjectPtr object)
Remove object from workcell
-
remove
public void remove(DevicePtr device)
Remove device from workcell
-
remove
public void remove(SensorModelPtr sensor)
Remove sensormodel from workcell
-
remove
public void remove(ControllerModelPtr controller)
Remove controllermodel from workcell
-
removeObject
public void removeObject(Object object)
Removes object from workcell
- Parameters:
object
- [in] Object to remove
-
addDevice
public void addDevice(DevicePtr device)
Adds a Device to the WorkCell.
Ownership of device is taken.
- Parameters:
device
- [in] pointer to device.
-
getDevices
public DevicePtrVector getDevices()
Returns a reference to a vector with pointers to the
Device(s) in the WorkCell
- Returns:
- const vector with pointers to rw::models::Device(s).
-
findFrame
public Frame findFrame(java.lang.String name)
Returns frame with the specified name.
If multiple frames has the same name, the first frame encountered
will be returned. If no frame is found, the method returns NULL.
- Parameters:
name
- [in] name of Frame.
- Returns:
- The frame with name name or NULL if no such frame.
-
getFrames
public FrameVector getFrames()
Returns all frames in workcell- Returns:
- List of all frames
-
findDevice
public DevicePtr findDevice(java.lang.String name)
The device named name of the workcell.
NULL is returned if there is no such device.
- Parameters:
name
- [in] The device name
- Returns:
- The device named name or NULL if no such device.
-
getDefaultState
public State getDefaultState()
Returns a default State- Returns:
- default State
-
setDefaultState
public void setDefaultState(State state)
set the default state of the WorkCell.
if the given state is an older state then states valid in both
new and old version will be copied to the default state.
-
findSensor
public SensorModelPtr findSensor(java.lang.String name)
Returns sensor with the specified name.
If multiple sensors has the same name, the first sensor
encountered will be returned. If no sensor is found, the method
returns NULL.
- Parameters:
name
- [in] name of sensor.
- Returns:
- The sensor with name name or NULL if no such sensor.
-
getSensors
public VectorSensorModelPtr getSensors()
Returns all frames in workcell- Returns:
- List of all frames
-
findController
public ControllerModelPtr findController(java.lang.String name)
Returns controller with the specified name.
If multiple controlelrs has the same name, the first controller
encountered will be returned. If no controller is found, the
method returns NULL.
- Parameters:
name
- [in] name of controller.
- Returns:
- The controller with name name or NULL if no such
controller.
-
getControllers
public ControllerModelPtrVector getControllers()
Returns all controllers in workcell- Returns:
- List of all controllers
-
getObjects
public ObjectPtrVector getObjects()
Returns all object in the work cell
- Returns:
- All object in work cell
-
findObject
public ObjectPtr findObject(java.lang.String name)
The object named name of the workcell.
NULL is returned if there is no such object.
- Parameters:
name
- [in] The object name
- Returns:
- The object named name or NULL if no such object.
-
add
public void add(DevicePtr device)
Add device to workcell
-
add
public void add(ObjectPtr object)
Add object to workcell
-
add
public void add(SensorModelPtr sensor)
Add sensormodel to workcell
-
add
public void add(ControllerModelPtr controller)
Add controllermodel to workcell
-
getStateStructure
public StateStructurePtr getStateStructure()
gets the complete state structure of the workcell.- Returns:
- the state structure of the workcell.
-
getPropertyMap
public PropertyMap getPropertyMap()
Properties of this workcell
-
getCollisionSetup
public SWIGTYPE_p_rw__proximity__CollisionSetup getCollisionSetup()
Returns collision setup associated to work cell- Returns:
- Collision setup
-
getSceneDescriptor
public SWIGTYPE_p_rw__core__PtrT_rw__graphics__SceneDescriptor_t getSceneDescriptor()
Get the scene descriptor.- Returns:
- the scene descriptor.
-
setSceneDescriptor
public void setSceneDescriptor(SWIGTYPE_p_rw__core__PtrT_rw__graphics__SceneDescriptor_t scene)
Set the scene descriptor.- Parameters:
scene
- [in] the scene descriptor.
-
getFilename
public java.lang.String getFilename()
Returns the full path and filename of the workcell.
If the workcell is loaded from file, then this method returns the
full filename. Otherwise it returns an empty string.
-
getFilePath
public java.lang.String getFilePath()
Returns the path of where the work cell is located
If the workcell is not loaded from file, it returns an empty
string
-
getCalibrationFilename
public java.lang.String getCalibrationFilename()
Returns the filename of the calibration associated to the
work cell.
Returns an empty string in case no calibration is associated.
To load the file use the getFilePath()+getCalibrationFilename()
to get the absolute location
-
setCalibrationFilename
public void setCalibrationFilename(java.lang.String calibrationFilename)
Sets the filename of the calibration file
- Parameters:
calibrationFilename
- [in] Filename of calibration file with
path relative to the work cell path.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
findMovableFrame
public MovableFrame findMovableFrame(java.lang.String name)
Returns MovableFrame with the specified name.
If multiple frames has the same name, the first frame encountered
will be returned. If no frame is found, the method returns NULL.
- Parameters:
name
- [in] name of Frame.
- Returns:
- The MovableFrame with name name or NULL if no such frame.
-
findFixedFrame
public FixedFrame findFixedFrame(java.lang.String name)
Returns FixedFrame with the specified name.
If multiple frames has the same name, the first frame encountered
will be returned. If no frame is found, the method returns NULL.
- Parameters:
name
- [in] name of Frame.
- Returns:
- The FixedFrame with name name or NULL if no such frame.
-
findMovableFrames
public MovableFrameVector findMovableFrames()
Returns all MovableFrames.- Returns:
- all frames of type MovableFrames in the workcell
-
findFixedFrames
public VectorFixedFrame findFixedFrames()
Returns all FixedFrame.- Returns:
- all frames of type FixedFrame in the workcell
-
findJointDevice
public JointDevicePtr findJointDevice(java.lang.String name)
The device named name of the workcell.
NULL is returned if there is no such device.
- Parameters:
name
- [in] The device name
- Returns:
- The device named name or NULL if no such device.
-
findSerialDevice
public SerialDevicePtr findSerialDevice(java.lang.String name)
The device named name of the workcell.
NULL is returned if there is no such device.
- Parameters:
name
- [in] The device name
- Returns:
- The device named name or NULL if no such device.
-
findTreeDevice
public TreeDevicePtr findTreeDevice(java.lang.String name)
The device named name of the workcell.
NULL is returned if there is no such device.
- Parameters:
name
- [in] The device name
- Returns:
- The device named name or NULL if no such device.
-
findParallelDevice
public ParallelDevicePtr findParallelDevice(java.lang.String name)
The device named name of the workcell.
NULL is returned if there is no such device.
- Parameters:
name
- [in] The device name
- Returns:
- The device named name or NULL if no such device.
-
findJointDevices
public JointDevicePtrVector findJointDevices()
Returns a vector with pointers to the Device(s) with a
specific type JointDevice in the WorkCell
- Returns:
- vector with pointers to Device(s) of type T.
-
findSerialDevices
public VectorSerialDevicePtr findSerialDevices()
Returns a vector with pointers to the Device(s) with a
specific type SerialDevice in the WorkCell
- Returns:
- vector with pointers to Device(s) of type T.
-
findTreeDevices
public VectorTreeDevicePtr findTreeDevices()
Returns a vector with pointers to the Device(s) with a
specific type TreeDevice in the WorkCell
- Returns:
- vector with pointers to Device(s) of type T.
-
findParallelDevices
public VectorParallelDevicePtr findParallelDevices()
Returns a vector with pointers to the Device(s) with a
specific type ParallelDevice in the WorkCell
- Returns:
- vector with pointers to Device(s) of type T.
-
-