3#ifndef __KDL_SOLVER_HPP__
4#define __KDL_SOLVER_HPP__
8#include <yarp/dev/DeviceDriver.h>
10#include <kdl/chain.hpp>
11#include <kdl/chainfksolver.hpp>
12#include <kdl/chainiksolver.hpp>
13#include <kdl/chainidsolver.hpp>
15#include "ICartesianSolver.h"
16#include "KdlSolver_ParamsParser.h"
17#include "LogComponent.hpp"
38 yarp::dev::ReturnValue
getNumJoints(std::size_t & numJoints)
override;
41 yarp::dev::ReturnValue
getNumTcps(std::size_t & numTcps)
override;
44 yarp::dev::ReturnValue
appendLink(
const std::vector<double> & x)
override;
50 yarp::dev::ReturnValue
changeOrigin(
const std::vector<double> & x_old_obj,
const std::vector<double> & x_new_old, std::vector<double> & x_new_obj)
override;
53 yarp::dev::ReturnValue
forwardKinematics(
const std::vector<double> & q, std::vector<double> & x)
override;
56 yarp::dev::ReturnValue
poseDiff(
const std::vector<double> & xLhs,
const std::vector<double> & xRhs, std::vector<double> & xOut)
override;
59 yarp::dev::ReturnValue
inverseKinematics(
const std::vector<double> & xd,
const std::vector<double> & qGuess, std::vector<double> & q,
Frame frame)
override;
62 yarp::dev::ReturnValue
diffInverseKinematics(
const std::vector<double> & q,
const std::vector<double> & xdot, std::vector<double> & qdot,
Frame frame)
override;
65 yarp::dev::ReturnValue
inverseDynamics(
const std::vector<double> & q, std::vector<double> & t)
override;
68 yarp::dev::ReturnValue
inverseDynamics(
const std::vector<double> & q,
const std::vector<double> & qdot,
const std::vector<double> & qdotdot,
69 const std::vector<double> & ftip, std::vector<double> & t,
Frame frame)
override;
73 bool open(yarp::os::Searchable & config)
override;
74 bool close()
override;
77 inline const yarp::os::LogComponent & logc()
const
78 {
return !m_quiet ? KDLS() : KDLS_QUIET(); }
80 mutable std::mutex mtx;
83 KDL::Chain originalChain;
85 KDL::ChainFkSolverPos * fkSolverPos {
nullptr};
86 KDL::ChainIkSolverPos * ikSolverPos {
nullptr};
87 KDL::ChainIkSolverVel * ikSolverVel {
nullptr};
88 KDL::ChainIdSolver * idSolver {
nullptr};
Definition KdlSolver_ParamsParser.h:57
The KdlSolver class implements ICartesianSolver.
Definition KdlSolver.hpp:33
yarp::dev::ReturnValue getNumJoints(std::size_t &numJoints) override
Get number of joints for which the solver has been configured.
Definition ICartesianSolverImpl.cpp:19
yarp::dev::ReturnValue restoreOriginalChain() override
Restore original kinematic chain.
Definition ICartesianSolverImpl.cpp:53
yarp::dev::ReturnValue inverseKinematics(const std::vector< double > &xd, const std::vector< double > &qGuess, std::vector< double > &q, Frame frame) override
Perform inverse kinematics.
Definition ICartesianSolverImpl.cpp:118
yarp::dev::ReturnValue inverseDynamics(const std::vector< double > &q, std::vector< double > &t) override
Perform inverse dynamics.
Definition ICartesianSolverImpl.cpp:227
yarp::dev::ReturnValue getNumTcps(std::size_t &numTcps) override
Get number of TCPs for which the solver has been configured.
Definition ICartesianSolverImpl.cpp:27
yarp::dev::ReturnValue poseDiff(const std::vector< double > &xLhs, const std::vector< double > &xRhs, std::vector< double > &xOut) override
Obtain difference between supplied pose inputs.
Definition ICartesianSolverImpl.cpp:105
yarp::dev::ReturnValue diffInverseKinematics(const std::vector< double > &q, const std::vector< double > &xdot, std::vector< double > &qdot, Frame frame) override
Perform differential inverse kinematics.
Definition ICartesianSolverImpl.cpp:171
yarp::dev::ReturnValue appendLink(const std::vector< double > &x) override
Append an additional link.
Definition ICartesianSolverImpl.cpp:35
yarp::dev::ReturnValue changeOrigin(const std::vector< double > &x_old_obj, const std::vector< double > &x_new_old, std::vector< double > &x_new_obj) override
Change origin in which a pose is expressed.
Definition ICartesianSolverImpl.cpp:69
yarp::dev::ReturnValue forwardKinematics(const std::vector< double > &q, std::vector< double > &x) override
Perform forward kinematics.
Definition ICartesianSolverImpl.cpp:82
Abstract base class for a cartesian solver.
Definition ICartesianSolver.h:19
Frame
Lists supported reference frames.
Definition ICartesianSolver.h:23