3 #ifndef __CONFIGURATION_SELECTOR_HPP__
4 #define __CONFIGURATION_SELECTOR_HPP__
8 #include <kdl/frames.hpp>
9 #include <kdl/jntarray.hpp>
44 virtual bool configure(
const std::vector<KDL::JntArray> & solutions);
79 void store(
const KDL::JntArray * q)
83 void validate(
const KDL::JntArray & qMin,
const KDL::JntArray & qMax);
98 const KDL::JntArray * q;
102 KDL::JntArray _qMin, _qMax;
104 Configuration optimalConfig;
106 std::vector<Configuration> configs;
132 lastValid(INVALID_CONFIG)
139 std::vector<double>
getDiffs(
const KDL::JntArray & qGuess,
const Configuration & config);
143 static const int INVALID_CONFIG = -1;
201 : _qMin(qMin), _qMax(qMax)
204 KDL::JntArray _qMin, _qMax;
255 if (_qMin.rows() == 6 && _qMax.rows() == 6)
Base factory class for ConfigurationSelector.
Definition: ConfigurationSelector.hpp:183
ConfigurationSelectorFactory(const KDL::JntArray &qMin, const KDL::JntArray &qMax)
Constructor.
Definition: ConfigurationSelector.hpp:200
virtual ConfigurationSelector * create() const =0
Creates an instance of the concrete class.
Implementation factory class for ConfigurationSelectorHumanoidGait.
Definition: ConfigurationSelector.hpp:241
ConfigurationSelectorHumanoidGaitFactory(const KDL::JntArray &qMin, const KDL::JntArray &qMax)
Constructor.
Definition: ConfigurationSelector.hpp:249
ConfigurationSelector * create() const override
Creates an instance of the concrete class.
Definition: ConfigurationSelector.hpp:253
IK solver configuration strategy selector based on human walking.
Definition: ConfigurationSelector.hpp:155
bool applyConstraints(const Configuration &config)
Determines whether the configuration is valid according to this selector's premises.
Definition: ConfigurationSelectorHumanoidGait.cpp:29
bool findOptimalConfiguration(const KDL::JntArray &qGuess) override
Analyzes available configurations and selects the optimal one.
Definition: ConfigurationSelectorHumanoidGait.cpp:11
ConfigurationSelectorHumanoidGait(const KDL::JntArray &qMin, const KDL::JntArray &qMax)
Constructor.
Definition: ConfigurationSelector.hpp:163
Implementation factory class for ConfigurationSelectorLeastOverallAngularDisplacement.
Definition: ConfigurationSelector.hpp:215
ConfigurationSelector * create() const override
Creates an instance of the concrete class.
Definition: ConfigurationSelector.hpp:227
ConfigurationSelectorLeastOverallAngularDisplacementFactory(const KDL::JntArray &qMin, const KDL::JntArray &qMax)
Constructor.
Definition: ConfigurationSelector.hpp:223
IK solver configuration strategy selector based on the overall displacement of all joints.
Definition: ConfigurationSelector.hpp:122
ConfigurationSelectorLeastOverallAngularDisplacement(const KDL::JntArray &qMin, const KDL::JntArray &qMax)
Constructor.
Definition: ConfigurationSelector.hpp:130
std::vector< double > getDiffs(const KDL::JntArray &qGuess, const Configuration &config)
Obtains vector of differences between current and desired joint values.
Definition: ConfigurationSelectorLeastOverallAngularDisplacement.cpp:58
bool findOptimalConfiguration(const KDL::JntArray &qGuess) override
Analyzes available configurations and selects the optimal one.
Definition: ConfigurationSelectorLeastOverallAngularDisplacement.cpp:12
Helper class to store a specific robot configuration.
Definition: ConfigurationSelector.hpp:70
const KDL::JntArray * retrievePose() const
Retrieves stored joint values.
Definition: ConfigurationSelector.hpp:86
Configuration()
Constructor.
Definition: ConfigurationSelector.hpp:73
void validate(const KDL::JntArray &qMin, const KDL::JntArray &qMax)
Checks reachability against provided joint limits.
Definition: ConfigurationSelector.cpp:39
void store(const KDL::JntArray *q)
Initializes joint values.
Definition: ConfigurationSelector.hpp:79
bool isValid() const
Whether this configuration is attainable or not.
Definition: ConfigurationSelector.hpp:90
void invalidate()
Mark this configuration as invalid.
Definition: ConfigurationSelector.hpp:94
Abstract base class for a robot configuration strategy selector.
Definition: ConfigurationSelector.hpp:20
ConfigurationSelector(const KDL::JntArray &qMin, const KDL::JntArray &qMax)
Constructor.
Definition: ConfigurationSelector.hpp:28
virtual bool findOptimalConfiguration(const KDL::JntArray &qGuess)=0
Analyzes available configurations and selects the optimal one.
virtual ~ConfigurationSelector()=default
Destructor.
virtual bool configure(const std::vector< KDL::JntArray > &solutions)
Stores initial values for a specific pose.
Definition: ConfigurationSelector.cpp:21
virtual void retrievePose(KDL::JntArray &q) const
Queries computed joint values for the optimal configuration.
Definition: ConfigurationSelector.hpp:60
The main, catch-all namespace for Robotics Lab UC3M.
Definition: groups.dox:6