iCub-main
gazeNlp.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2010 RobotCub Consortium, European Commission FP6 Project IST-004370
3  * Author: Ugo Pattacini, Alessandro Roncone
4  * email: ugo.pattacini@iit.it, alessandro.roncone@iit.it
5  * website: www.robotcub.org
6  * Permission is granted to copy, distribute, and/or modify this program
7  * under the terms of the GNU General Public License, version 2 or any
8  * later version published by the Free Software Foundation.
9  *
10  * A copy of the license can be found at
11  * http://www.robotcub.org/icub/license/gpl.txt
12  *
13  * This program is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
16  * Public License for more details
17 */
18 
19 #ifndef __GAZENLP_H__
20 #define __GAZENLP_H__
21 
22 #include <string>
23 
24 #include <yarp/sig/all.h>
25 #include <yarp/math/Math.h>
26 
27 #include <iCub/iKin/iKinHlp.h>
28 #include <iCub/iKin/iKinFwd.h>
29 #include <iCub/iKin/iKinInv.h>
30 #include <iCub/iKin/iKinIpOpt.h>
31 
32 using namespace std;
33 using namespace yarp::sig;
34 using namespace yarp::math;
35 using namespace iCub::ctrl;
36 using namespace iCub::iKin;
37 
38 
39 // Solve through IPOPT the nonlinear problem
40 class GazeIpOptMin : public iKinIpOptMin
41 {
42 private:
43  GazeIpOptMin();
44  GazeIpOptMin(const GazeIpOptMin&);
45  GazeIpOptMin &operator=(const GazeIpOptMin&);
46 
47 public:
48  GazeIpOptMin(iKinChain &_chain, const double tol, const double constr_tol,
49  const int max_iter=IKINCTRL_DISABLED,
50  const unsigned int verbose=0) :
51  iKinIpOptMin(_chain,IKINCTRL_POSE_XYZ,tol,constr_tol,
52  max_iter,verbose,false) { }
53 
54  void set_ctrlPose(const unsigned int _ctrlPose) { }
55  bool set_posePriority(const string &priority) { return false; }
56  void setHessianOpt(const bool useHessian) { } // Hessian not implemented
57  Vector solve(const Vector &q0, Vector &xd, const Vector &gDir);
58 };
59 
60 
61 #endif
62 
63 
void set_ctrlPose(const unsigned int _ctrlPose)
Definition: gazeNlp.h:54
bool set_posePriority(const string &priority)
Definition: gazeNlp.h:55
void setHessianOpt(const bool useHessian)
Definition: gazeNlp.h:56
GazeIpOptMin(iKinChain &_chain, const double tol, const double constr_tol, const int max_iter=IKINCTRL_DISABLED, const unsigned int verbose=0)
Definition: gazeNlp.h:48
A Base class for defining a Serial Link Chain.
Definition: iKinFwd.h:355
Class for inverting chain's kinematics based on IpOpt lib.
Definition: iKinIpOpt.h:199
#define IKINCTRL_POSE_XYZ
Definition: iKinInv.h:38
#define IKINCTRL_DISABLED
Definition: iKinInv.h:50