![]() |
RobWorkProject
23.9.11-
|
a JointController that use a PD loop on each joint to control the velocity such that the position target is reached. More...
#include <PDController.hpp>
Inherits JointController, and SimulatedController.
Public Types | |
| typedef rw::core::Ptr< PDController > | Ptr |
Public Types inherited from JointController | |
| enum | ControlMode { POSITION = 1 , CNT_POSITION = 2 , VELOCITY = 4 , FORCE = 8 , CURRENT = 16 } |
| control mode | |
| typedef rw::core::Ptr< JointController > | Ptr |
| smart pointer of this class | |
Public Types inherited from Controller | |
| typedef rw::core::Ptr< Controller > | Ptr |
| smart poiner definition for controller | |
Public Types inherited from SimulatedController | |
| typedef rw::core::Ptr< SimulatedController > | Ptr |
| smart pointer type of this class | |
Public Types inherited from Stateless | |
| typedef rw::core::Ptr< Stateless > | Ptr |
| Smart pointer type for Stateless. | |
Public Member Functions | |
| PDController (const std::string &name, rw::core::Ptr< rwsim::dynamics::DynamicDevice > rdev, ControlMode cmode, const std::vector< PDParam > &pdparams, double dt) | |
| constructor More... | |
| PDController (const std::string &name, rw::core::Ptr< rwsim::dynamics::DynamicDevice > rdev, ControlMode cmode, const PDParam &pdparam, double dt) | |
| constructor More... | |
| virtual | ~PDController () |
| destructor | |
| std::vector< PDParam > | getParameters () |
| the PD parameters More... | |
| void | setParameters (const std::vector< PDParam > ¶ms) |
| set the PD parameters More... | |
| double | getSampleTime () |
| the time between samples More... | |
| void | setSampleTime (double stime) |
| set the time between samples in seconds More... | |
| 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 | reset (const rw::kinematics::State &state) |
| reset the controller to the applied state More... | |
| Controller * | getController () |
| get the name of this controller More... | |
| std::string | getControllerName () |
| get the name of this controller More... | |
| unsigned int | getControlModes () |
| gets the control mode mask. Defines which types of control the JointController supports More... | |
| void | setControlMode (ControlMode mode) |
| sets the control mode of this JointController. If the mode is unsupported an exception is thrown More... | |
| void | setTargetPos (const rw::math::Q &target) |
| sets the target joint value for the current control mode. More... | |
| void | setTargetVel (const rw::math::Q &vals) |
| sets the target velocity More... | |
| void | setTargetAcc (const rw::math::Q &vals) |
| sets the target acceleration More... | |
| rw::math::Q | getQ () |
| return the current position of the controlled robot More... | |
| rw::math::Q | getQd () |
| return the current velocity More... | |
| void | setEnabled (bool enabled) |
| disable or enable this controller More... | |
| bool | isEnabled () const |
| true if this controller is enabled More... | |
| rwlibs::control::Controller::Ptr | getControllerHandle (rwlibs::simulation::Simulator::Ptr sim) |
Public Member Functions inherited from JointController | |
| virtual | ~JointController () |
| destructor | |
| virtual rw::models::Device & | getModel () |
| get kinematic model of device that is controlled | |
Public Member Functions inherited from Controller | |
| virtual | ~Controller () |
| destructor | |
| const std::string & | getName () const |
| get the unique name of this controller More... | |
| void | setName (const std::string &name) |
| set the name of the controller More... | |
Public Member Functions inherited from SimulatedController | |
| virtual rw::core::Ptr< rwlibs::control::Controller > | getControllerHandle (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::ControllerModel > | getControllerModel () |
| 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... | |
Additional Inherited Members | |
Protected Member Functions inherited from JointController | |
| JointController (const std::string &name, rw::models::Device *dev) | |
| constructor More... | |
Protected Member Functions inherited from Controller | |
| Controller (const std::string &name) | |
| constructor More... | |
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 | |
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. | |
a JointController that use a PD loop on each joint to control the velocity such that the position target is reached.
| PDController | ( | const std::string & | name, |
| rw::core::Ptr< rwsim::dynamics::DynamicDevice > | rdev, | ||
| ControlMode | cmode, | ||
| const std::vector< PDParam > & | pdparams, | ||
| double | dt | ||
| ) |
constructor
| name | |
| rdev | [in] device that is to be controlled |
| cmode | [in] the control mode used |
| pdparams | [in] list of pd parameters. must be same length as number of joints. |
| dt | [in] the sampletime (time between samples in seconds) used in the control loop, this should be larger than the expected update sample time. |
| PDController | ( | const std::string & | name, |
| rw::core::Ptr< rwsim::dynamics::DynamicDevice > | rdev, | ||
| ControlMode | cmode, | ||
| const PDParam & | pdparam, | ||
| double | dt | ||
| ) |
constructor
| name | |
| rdev | [in] device that is to be controlled |
| cmode | [in] the control mode used |
| pdparam | [in] pd parameter - used for all joints |
| dt | [in] the sampletime (time between samples in seconds) used in the control loop, this should be larger than the expected update sample time. |
|
inline |
get the name of this controller
|
inlinevirtual |
|
inlinevirtual |
gets the control mode mask. Defines which types of control the JointController supports
This controller supports both position and velocity control.
Implements JointController.
| std::vector<PDParam> getParameters | ( | ) |
the PD parameters
|
inlinevirtual |
return the current position of the controlled robot
Implements JointController.
|
inlinevirtual |
return the current velocity
Implements JointController.
| double getSampleTime | ( | ) |
the time between samples
|
inlinevirtual |
|
virtual |
reset the controller to the applied state
| state | [in] the state to reset to |
Implements SimulatedController.
|
virtual |
sets the control mode of this JointController. If the mode is unsupported an exception is thrown
Implements JointController.
|
inlinevirtual |
| void setParameters | ( | const std::vector< PDParam > & | params | ) |
set the PD parameters
| params | [in] list of parameters. must be same length as DOF of controlling device |
| void setSampleTime | ( | double | stime | ) |
set the time between samples in seconds
| stime | [in] sample time |
|
virtual |
|
virtual |
sets the target joint value for the current control mode.
Implements JointController.
|
virtual |
|
virtual |
updates/steps the controller with time step dt. It will update the state state accordingly
| info | [in] update information related to the time step. |
| state | [in/out] the current state |
Implements SimulatedController.