PPL API Reference
Overview Core Algorithm Abstractions Utilities Parallel Methods
Modules Class Hierarchy Classes Functions
Todo List Bug List Dead Code
List of all members
MatlabNeedleController Class Reference

Public Member Functions

Construction
 MatlabNeedleController (Robot *const _r)
 
 MatlabNeedleController (Robot *const _r, XMLNode &_node)
 
 MatlabNeedleController (Robot *const _r, const MatlabNeedleController &_c)
 
virtual std::unique_ptr< ControllerMethodClone (Robot *const _r) const override
 
virtual ~MatlabNeedleController ()
 
ControllerMethod Overrides
virtual Control operator() (const Cfg &_current, const Cfg &_target, const double _steps) override
 
virtual Control GetRandomControl (const Cfg &_current, const double _steps) const noexcept override
 
Interface
ControlSet * GetControlSet () noexcept
 
void SetControlSet (ControlSet *const _c) noexcept
 

Static Public Member Functions

Construction
static std::unique_ptr< ControllerMethodFactory (Robot *const _r, XMLNode &_node)
 

Protected Member Functions

Control Selection Overrides
virtual std::vector< double > ComputeDesiredForce (const Cfg &_current, const Cfg &_target, const double _steps) override
 Not used within this class. More...
 
Control Selection
virtual Control ComputeNearestControl (const Cfg &_current, std::vector< double > &&_force)
 
virtual Control ComputeNearestContinuousControl (const Cfg &_current, std::vector< double > &&_force)
 
virtual Control ComputeNearestDiscreteControl (const Cfg &_current, std::vector< double > &&_force)
 

Protected Attributes

Internal State
Robot *const m_robot
 The owning robot object.
 
ControlSet * m_controls {nullptr}
 The discrete controls, if any.
 
bool m_debug {false}
 Show debug messages?
 

Detailed Description

A controller for a steerable needle using a matlab mechanics model.

Warning
Controls mean something entirely different for this kind of robot - they are not generalized DOF forces/velocities.
Note
This currently only works with the problem at envs/2D/HingedNeedle.

Constructor & Destructor Documentation

◆ MatlabNeedleController() [1/3]

MatlabNeedleController::MatlabNeedleController ( Robot *const  _r)

Construct a simple controller.

Parameters
_rThe robot to control.

◆ MatlabNeedleController() [2/3]

MatlabNeedleController::MatlabNeedleController ( Robot *const  _r,
XMLNode _node 
)

Construct a simple controller from an XML node.

Parameters
_rThe robot to control.
_nodeThe XML node to parse.

◆ MatlabNeedleController() [3/3]

MatlabNeedleController::MatlabNeedleController ( Robot *const  _r,
const MatlabNeedleController _c 
)

Copy a controller for another robot.

Parameters
_rThe destination robot.
_cThe controller to copy.

Member Function Documentation

◆ Clone()

std::unique_ptr< ControllerMethod > MatlabNeedleController::Clone ( Robot *const  _r) const
overridevirtual

Create a copy of this controller for another robot. This is provided so that we can copy controllers without knowing their derived type.

Parameters
_rThe robot receiving the cloned controller.
Returns
The cloned controller.

Implements ControllerMethod.

◆ operator()()

Control MatlabNeedleController::operator() ( const Cfg _current,
const Cfg _target,
const double  _steps 
)
overridevirtual

This is different from other controllers - it takes a number of steps instead of a time span.

Parameters
_currentThe current configuration.
_targetThe target configuration.
_stepsThe number of steps to take.
Returns
The computed control.

Reimplemented from ControllerMethod.

◆ GetRandomControl()

Control MatlabNeedleController::GetRandomControl ( const Cfg _current,
const double  _steps 
) const
overridevirtualnoexcept

This is different from other controllers - it takes a number of steps instead of a time span.

Parameters
_currentThe current configuration.
_stepsThe number of steps to take.
Returns
The computed control.

Reimplemented from ControllerMethod.

◆ ComputeDesiredForce()

std::vector< double > MatlabNeedleController::ComputeDesiredForce ( const Cfg _current,
const Cfg _target,
const double  _steps 
)
overrideprotectedvirtual

Not used within this class.

Implements ControllerMethod.

◆ Factory()

std::unique_ptr< ControllerMethod > ControllerMethod::Factory ( Robot *const  _r,
XMLNode _node 
)
staticinherited

Create a dynamically-allocated controller from an XML node.

Parameters
_rThe robot to control.
_nodeThe XML node to read parameters from.
Returns
A controller of the type described by _node.

◆ GetControlSet()

ControlSet * ControllerMethod::GetControlSet ( )
noexceptinherited

Get the discrete set of controls that this controller can use, if any.

Returns
The discrete set of controls for this controller, or null if it uses a continuous space(s) of controls.

◆ SetControlSet()

void ControllerMethod::SetControlSet ( ControlSet *const  _c)
noexceptinherited

Set a discrete set of controls for this controller to use. This limits the controller to a subset of all possible controls accepted by a robot's actuators.

Parameters
_cThe control set to use.

◆ ComputeNearestControl()

Control ControllerMethod::ComputeNearestControl ( const Cfg _current,
std::vector< double > &&  _force 
)
protectedvirtualinherited

Compute the control that produces the closest force to the ideal.

Parameters
_currentThe current configuration.
_forceThe desired force in the robot's local frame.
Returns
The control whose result is nearest to _force.

◆ ComputeNearestContinuousControl()

Control ControllerMethod::ComputeNearestContinuousControl ( const Cfg _current,
std::vector< double > &&  _force 
)
protectedvirtualinherited

Compute the continuous control that produces the closest force to the ideal.

Parameters
_currentThe current configuration.
_forceThe desired force in the robot's local frame.
Returns
The control whose result is nearest to _force.

Reimplemented in CarlikeNeedleController.

◆ ComputeNearestDiscreteControl()

Control ControllerMethod::ComputeNearestDiscreteControl ( const Cfg _current,
std::vector< double > &&  _force 
)
protectedvirtualinherited

Compute the discrete control that produces the closest force to the ideal.

Parameters
_currentThe current configuration.
_forceThe desired force in the robot's local frame.
Returns
The control whose result is nearest to _force.

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