Package org.robwork.sdurwsim
Class DynamicWorkCell
- java.lang.Object
-
- org.robwork.sdurwsim.DynamicWorkCell
-
public class DynamicWorkCell extends java.lang.Objectthe DynamicWorkcell class is a container class for dynamic
information/data in a workcell, much like WorkCell is a container
class for the kinematic information/data in a workcell
The dynamic description includes:
- Body: severel different forms of bodies that may be constrained by rules
- Constraint: constraining the bodies to move in a specific way relative to each other
- Controllers: severel controllers that in some way control/influence the bodies
- Sensors: bodies that have tactile sensing capability
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDynamicWorkCell.DWCEventTypeTypes of events a DynamicWorkCell can emit.
-
Constructor Summary
Constructors Constructor Description DynamicWorkCell(long cPtr, boolean cMemoryOwn)DynamicWorkCell(WorkCellPtr workcell)ConstructorDynamicWorkCell(WorkCellPtr workcell, SWIGTYPE_p_std__vectorT_Body__Ptr_t allbodies, SWIGTYPE_p_std__vectorT_Constraint__Ptr_t constraints, SWIGTYPE_p_std__vectorT_DynamicDevice__Ptr_t devices, SWIGTYPE_p_std__vectorT_rw__core__PtrT_rwlibs__simulation__SimulatedController_t_t controllers)Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBody(SWIGTYPE_p_Body__Ptr body)adds a body to the dynamic workcell.
Notice that this will change the length of the default
State.voidaddConstraint(SWIGTYPE_p_Constraint__Ptr constraint)Add a constraint to the dynamic workcell.voidaddController(SimulatedControllerPtr manipulator)adds a body controller to the dynamic workcell.
Notice that this will change the length of the default
State.voidaddDevice(SWIGTYPE_p_DynamicDevice__Ptr device)add a device to the dynamic workcellvoidaddSensor(SimulatedSensorPtr sensor)add a sensor to the dynamic workcellSWIGTYPE_p_rw__core__EventT_boost__functionT_void_frwsim__dynamics__DynamicWorkCell__DWCEventType_boost__anyF_t_rwsim__dynamics__DynamicWorkCell__DWCEventType_boost__any_rw__core___n1_rw__core___n1_tchangedEvent()Returns StateChangeEvent needed for subscribing and firing the event.voiddelete()SWIGTYPE_p_Body__PtrfindBody(java.lang.String name)find a specific body with name nameSWIGTYPE_p_Constraint__PtrfindConstraint(java.lang.String name)find a specific constraint with name nameSimulatedControllerPtrfindController(java.lang.String name)Find a simulated controller.SWIGTYPE_p_DynamicDevice__PtrfindDevice(java.lang.String name)find a dynamic device of name nameFixedBodyPtrfindFixedBody(java.lang.String name)SimulatedFTSensorPtrfindFTSensor(java.lang.String name)KinematicBodyPtrfindKinematicBody(java.lang.String name)PDControllerPtrfindPDController(java.lang.String name)RigidBodyPtrfindRigidBody(java.lang.String name)RigidDevicePtrfindRigidDevice(java.lang.String name)SimulatedSensorPtrfindSensor(java.lang.String name)find a sensorSerialDeviceControllerPtrfindSerialDeviceController(java.lang.String name)SuctionCupPtrfindSuctionCup(java.lang.String name)SWIGTYPE_p_std__vectorT_Body__Ptr_tgetBodies()gets a list of all bodies in the dynamic workcellBodyPtrgetBody(java.lang.String name)SWIGTYPE_p_Body__PtrgetBody(FramePtr f)gets the body associated with frame f if any.doublegetCollisionMargin()the collision margin describe how closeSWIGTYPE_p_std__vectorT_Constraint__Ptr_tgetConstraints()gets a list of all constraints in the dynamic workcellSWIGTYPE_p_ContactDataMapgetContactData()gets the static contact data informationSWIGTYPE_p_std__vectorT_rw__core__PtrT_rwlibs__simulation__SimulatedController_t_tgetControllers()gets a list of all controllers in the dynamic workcellstatic longgetCPtr(DynamicWorkCell obj)SWIGTYPE_p_std__vectorT_DynamicDevice__Ptr_tgetDynamicDevices()gets a list of all dynamic devices in the dynamic workcellPropertyMapgetEngineSettings()get the settings and properties for the physics engineVector3DgetGravity()get the gravity in this dynamic workcellSWIGTYPE_p_MaterialDataMapgetMaterialData()gets the material data information, like friction
propertiesSWIGTYPE_p_std__vectorT_rw__core__PtrT_rwlibs__simulation__SimulatedSensor_t_tgetSensors()get the list of sensorsWorkCellPtrgetWorkcell()gets the default kinematic workcellWorkCellPtrgetWorkCell()gets the default kinematic workcellWorkCellDimensiongetWorldDimension()Get dimensions of workspace.booleaninDevice(SWIGTYPE_p_rw__core__PtrT_Body_const_t body)tests if a body is part of a devicebooleanremove(SWIGTYPE_p_Body__Ptr body)Remove a body from the list of bodiesvoidsetCollisionMargin(double margin)Set the collision margin.voidsetGravity(double x, double y, double z)voidsetGravity(Vector3D grav)Set the gravity in this dynamic workcell
-
-
-
Constructor Detail
-
DynamicWorkCell
public DynamicWorkCell(long cPtr, boolean cMemoryOwn)
-
DynamicWorkCell
public DynamicWorkCell(WorkCellPtr workcell)
Constructor- Parameters:
workcell- [in] a smart pointer to the rw::models::WorkCell
-
DynamicWorkCell
public DynamicWorkCell(WorkCellPtr workcell, SWIGTYPE_p_std__vectorT_Body__Ptr_t allbodies, SWIGTYPE_p_std__vectorT_Constraint__Ptr_t constraints, SWIGTYPE_p_std__vectorT_DynamicDevice__Ptr_t devices, SWIGTYPE_p_std__vectorT_rw__core__PtrT_rwlibs__simulation__SimulatedController_t_t controllers)
Constructor- Parameters:
workcell- [in] a smart pointer to the rw::models::WorkCellallbodies- [in] a list of bodies.constraints- [in] a list of constraints.devices- [in] a list of devices.controllers- [in] a list of controllers.
-
-
Method Detail
-
getCPtr
public static long getCPtr(DynamicWorkCell obj)
-
delete
public void delete()
-
getBodies
public SWIGTYPE_p_std__vectorT_Body__Ptr_t getBodies()
gets a list of all bodies in the dynamic workcell
-
findBody
public SWIGTYPE_p_Body__Ptr findBody(java.lang.String name)
find a specific body with name name- Parameters:
name- [in] name of body- Returns:
- body if found, NULL otherwise
-
addConstraint
public void addConstraint(SWIGTYPE_p_Constraint__Ptr constraint)
Add a constraint to the dynamic workcell.- Parameters:
constraint- [in] a smart pointer to the constraint to add.
-
getConstraints
public SWIGTYPE_p_std__vectorT_Constraint__Ptr_t getConstraints()
gets a list of all constraints in the dynamic workcell
-
findConstraint
public SWIGTYPE_p_Constraint__Ptr findConstraint(java.lang.String name)
find a specific constraint with name name- Parameters:
name- [in] name of constraint- Returns:
- constraint if found, NULL otherwise
-
getDynamicDevices
public SWIGTYPE_p_std__vectorT_DynamicDevice__Ptr_t getDynamicDevices()
gets a list of all dynamic devices in the dynamic workcell- Returns:
- a list of dynamic devices.
-
addDevice
public void addDevice(SWIGTYPE_p_DynamicDevice__Ptr device)
add a device to the dynamic workcell- Parameters:
device- [in] a device
-
findDevice
public SWIGTYPE_p_DynamicDevice__Ptr findDevice(java.lang.String name)
find a dynamic device of name name- Parameters:
name- [in] name of device- Returns:
- a device with name name or null
-
getControllers
public SWIGTYPE_p_std__vectorT_rw__core__PtrT_rwlibs__simulation__SimulatedController_t_t getControllers()
gets a list of all controllers in the dynamic workcell
-
getSensors
public SWIGTYPE_p_std__vectorT_rw__core__PtrT_rwlibs__simulation__SimulatedSensor_t_t getSensors()
get the list of sensors
-
addSensor
public void addSensor(SimulatedSensorPtr sensor)
add a sensor to the dynamic workcell- Parameters:
sensor- [in] a simulated sensor
-
findSensor
public SimulatedSensorPtr findSensor(java.lang.String name)
find a sensor- Parameters:
name- [in] the sensor- Returns:
-
addBody
public void addBody(SWIGTYPE_p_Body__Ptr body)
adds a body to the dynamic workcell.
Notice that this will change the length of the default
State.
-
addController
public void addController(SimulatedControllerPtr manipulator)
adds a body controller to the dynamic workcell.
Notice that this will change the length of the default
State.
-
findController
public SimulatedControllerPtr findController(java.lang.String name)
Find a simulated controller.- Parameters:
name- [in] name of the controller.- Returns:
- the simulated controller if found, NULL otherwise.
-
getContactData
public SWIGTYPE_p_ContactDataMap getContactData()
gets the static contact data information
-
getMaterialData
public SWIGTYPE_p_MaterialDataMap getMaterialData()
gets the material data information, like friction
properties
-
getBody
public SWIGTYPE_p_Body__Ptr getBody(FramePtr f)
gets the body associated with frame f if any.
-
getWorkcell
public WorkCellPtr getWorkcell()
gets the default kinematic workcell
-
getWorkCell
public WorkCellPtr getWorkCell()
gets the default kinematic workcell
-
getCollisionMargin
public double getCollisionMargin()
the collision margin describe how close
-
setCollisionMargin
public void setCollisionMargin(double margin)
Set the collision margin.- Parameters:
margin- [in] the new margin.
-
getWorldDimension
public WorkCellDimension getWorldDimension()
Get dimensions of workspace.- Returns:
- the dimensions.
-
inDevice
public boolean inDevice(SWIGTYPE_p_rw__core__PtrT_Body_const_t body)
tests if a body is part of a device- Parameters:
body- [in] the body to test for.- Returns:
- true if body is part of the device.
-
setGravity
public void setGravity(Vector3D grav)
Set the gravity in this dynamic workcell- Parameters:
grav- [in] the direction and strength of gravity
-
getGravity
public Vector3D getGravity()
get the gravity in this dynamic workcell- Returns:
- gravity
-
getEngineSettings
public PropertyMap getEngineSettings()
get the settings and properties for the physics engine- Returns:
- propertymap
-
remove
public boolean remove(SWIGTYPE_p_Body__Ptr body)
Remove a body from the list of bodies- Parameters:
body- [in] the body to be removed- Returns:
- True if body was removed otherwise false
-
changedEvent
public SWIGTYPE_p_rw__core__EventT_boost__functionT_void_frwsim__dynamics__DynamicWorkCell__DWCEventType_boost__anyF_t_rwsim__dynamics__DynamicWorkCell__DWCEventType_boost__any_rw__core___n1_rw__core___n1_t changedEvent()
Returns StateChangeEvent needed for subscribing and firing the event.- Returns:
- Reference to the StateChangedEvent
-
findRigidBody
public RigidBodyPtr findRigidBody(java.lang.String name)
-
findKinematicBody
public KinematicBodyPtr findKinematicBody(java.lang.String name)
-
findFixedBody
public FixedBodyPtr findFixedBody(java.lang.String name)
-
findRigidDevice
public RigidDevicePtr findRigidDevice(java.lang.String name)
-
findSuctionCup
public SuctionCupPtr findSuctionCup(java.lang.String name)
-
findFTSensor
public SimulatedFTSensorPtr findFTSensor(java.lang.String name)
-
findSerialDeviceController
public SerialDeviceControllerPtr findSerialDeviceController(java.lang.String name)
-
findPDController
public PDControllerPtr findPDController(java.lang.String name)
-
setGravity
public void setGravity(double x, double y, double z)
-
getBody
public BodyPtr getBody(java.lang.String name)
-
-