RobWorkProject  23.9.11-
Classes | Public Types | Public Member Functions | Protected Types | Protected Member Functions | List of all members
SerialDeviceController Class Reference

a SerialDeviceController that enables control of the robot in both position, velocity and force modes. Also both joint and cartesean control is available. More...

#include <SerialDeviceController.hpp>

Inherits SimulatedController.

Classes

struct  CompiledTarget
 
struct  Target
 

Public Types

typedef rw::core::Ptr< SerialDeviceControllerPtr
 
- Public Types inherited from SimulatedController
typedef rw::core::Ptr< SimulatedControllerPtr
 smart pointer type of this class
 
- Public Types inherited from Stateless
typedef rw::core::Ptr< StatelessPtr
 Smart pointer type for Stateless.
 

Public Member Functions

 SerialDeviceController (const std::string &name, dynamics::DynamicDevice::Ptr ddev)
 
 SerialDeviceController (const std::string &name, rw::core::Ptr< rwsim::dynamics::RigidDevice > ddev)
 construct using RigidDevice. More...
 
virtual ~SerialDeviceController ()
 destructor
 
bool moveLin (const rw::math::Transform3D<> &target, float speed=100, float blend=0)
 move robot in a linear Cartesian path
 
bool movePTP (const rw::math::Q &target, float speed=100, float blend=0)
 move robot from point to point
 
bool movePTP_T (const rw::math::Transform3D<> &target, float speed=100, float blend=0)
 move robot from point to point but using a pose as target (require invkin)
 
bool moveTraj (const rw::trajectory::QTrajectory::Ptr traj, float speed=100)
 
void flushQueue ()
 flushes the move command queue. This is usefull for braking the current trajectory without stopping the robot. However, if no commands are placed on the queue after calling flush then the robot will stop.
 
virtual bool moveVelQ (const rw::math::Q &target_joint_velocity)
 move robot in a servoing fasion
 
virtual bool moveVelT (const rw::math::VelocityScrew6D<> &vel)
 
virtual bool moveLinFC (const rw::math::Transform3D<> &target, const rw::math::Wrench6D<> &wtarget, float selection[6], std::string refframe, rw::math::Rotation3D<> offset, float speed=100, float blend=0)
 move robot with a hybrid position/force control
 
bool stop ()
 
bool pause ()
 stops the robot but without flushing the command queue. Please notice that the trajectories will
 
bool isStopped ()
 
bool start ()
 reenable control after calling stop More...
 
bool setSafeModeEnabled (bool enable)
 enable safe mode, so that robot stops when collisions are detected
 
void setMaxLinearVelocity (double maxVel)
 the max linear/translational velocity in m/s
 
void setMaxAngularVelocity (double maxVel)
 the max angular velocity in rad/s
 
rw::math::Q getQ ()
 
rw::math::Q getQd ()
 
bool isMoving ()
 
dynamics::DynamicDevice::Ptr getDynamicDevice ()
 
void update (const rwlibs::simulation::Simulator::UpdateInfo &info, rw::kinematics::State &state)
 updates/steps the controller with time step dt. It will update the state state accordingly More...
 
void updateFTcontrolWrist (const rwlibs::simulation::Simulator::UpdateInfo &info, rw::kinematics::State &state)
 
std::string getControllerName ()
 get the name of this controller More...
 
void reset (const rw::kinematics::State &state)
 reset the controller to the applied state More...
 
rwlibs::control::ControllergetController ()
 
void setEnabled (bool enabled)
 disable or enable this controller More...
 
bool isEnabled () const
 true if this controller is enabled More...
 
void setFTSensor (rw::sensor::FTSensor *sensor)
 Set a FTSensor. More...
 
rwlibs::control::Controller::Ptr getControllerHandle (rwlibs::simulation::Simulator::Ptr sim)
 
- Public Member Functions inherited from SimulatedController
virtual rw::core::Ptr< rwlibs::control::ControllergetControllerHandle (rw::core::Ptr< rwlibs::simulation::Simulator > sim)=0
 get the controller handle eg. statefull handle, associated with this simulated controller More...
 
rw::core::Ptr< rw::models::ControllerModelgetControllerModel ()
 get the controllermodel of this simulated controller More...
 
- Public Member Functions inherited from Stateless
virtual ~Stateless ()
 destructor
 
virtual void registerIn (State &state)
 initialize this stateless data to a specific state More...
 
virtual void registerIn (StateStructure::Ptr state)
 register this stateless object in a statestructure.
 
virtual void unregister ()
 unregisters all state data of this stateless object
 
StateStructure::Ptr getStateStructure ()
 Get the state structure. More...
 
const StateStructure::Ptr getStateStructure () const
 Get the state structure. More...
 
bool isRegistered ()
 Check if object has registered its state. More...
 

Protected Types

enum  TargetType {
  PTP , PTP_T , Lin , VelQ ,
  VelT , LinFC , TrajQ
}
 

Protected Member Functions

CompiledTarget makeTrajectory (const std::vector< Target > &targets, rw::kinematics::State &state)
 create trajectory from current joint position and joint velocity
 
- Protected Member Functions inherited from SimulatedController
 SimulatedController (rw::models::ControllerModel::Ptr model)
 Constructor. More...
 
- Protected Member Functions inherited from Stateless
 Stateless ()
 constructor
 
template<class T >
void add (StatelessData< T > &data)
 implementations of sensor should add all their stateless data on initialization
 
void add (StateData *data)
 Add data. More...
 
void add (rw::core::Ptr< StateData > data)
 implementations of sensor should add all their state data on initialization
 

Additional Inherited Members

- Protected Attributes inherited from Stateless
bool _registered
 True if object has registered its state.
 
std::vector< rw::core::Ptr< StateData > > _datas
 Data.
 
StateStructure::Ptr _stateStruct
 The state structure.
 

Detailed Description

a SerialDeviceController that enables control of the robot in both position, velocity and force modes. Also both joint and cartesean control is available.

Constructor & Destructor Documentation

◆ SerialDeviceController() [1/2]

SerialDeviceController ( const std::string &  name,
dynamics::DynamicDevice::Ptr  ddev 
)
Parameters
name[in] controller name
ddev[in]

◆ SerialDeviceController() [2/2]

SerialDeviceController ( const std::string &  name,
rw::core::Ptr< rwsim::dynamics::RigidDevice ddev 
)

construct using RigidDevice.

Parameters
name[in] name of controller
ddev[in] the RigidDevice that should be controlled

Member Function Documentation

◆ getControllerName()

std::string getControllerName ( )
inlinevirtual

get the name of this controller

Returns
name of this controller

Implements SimulatedController.

◆ isEnabled()

bool isEnabled ( ) const
inlinevirtual

true if this controller is enabled

Returns

Implements SimulatedController.

◆ reset()

void reset ( const rw::kinematics::State state)
inlinevirtual

reset the controller to the applied state

Parameters
state[in] the state to reset to

Implements SimulatedController.

◆ setEnabled()

void setEnabled ( bool  enabled)
inlinevirtual

disable or enable this controller

Parameters
enabled

Implements SimulatedController.

◆ setFTSensor()

void setFTSensor ( rw::sensor::FTSensor sensor)

Set a FTSensor.

When using hybrid position and force/torque control it is important to set the sensor used, such that the measured force/torque can be taken into account when calculating the required motor forces.

Parameters
sensor[in] a pointer to the FTSensor (must have its frame at one of the joints of the robot).

◆ start()

bool start ( )

reenable control after calling stop

Returns

◆ stop()

bool stop ( )

Other control commands that effects the robot movements. hard stop the robot,

◆ update()

void update ( const rwlibs::simulation::Simulator::UpdateInfo info,
rw::kinematics::State state 
)
virtual

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

Implements SimulatedController.


The documentation for this class was generated from the following file: