iCub-main
iKinHlp.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT)
3  * Copyright (C) 2006-2010 RobotCub Consortium
4  * All rights reserved.
5  *
6  * This software may be modified and distributed under the terms
7  * of the BSD-3-Clause license. See the accompanying LICENSE file for
8  * details.
9 */
10 
24 #ifndef __IKINHLP_H__
25 #define __IKINHLP_H__
26 
27 #define IKIN_ALMOST_ZERO 1e-6
28 
29 #include <yarp/os/Bottle.h>
30 #include <yarp/sig/all.h>
31 
32 #include <iCub/iKin/iKinFwd.h>
33 
34 
35 namespace iCub
36 {
37 
38 namespace iKin
39 {
40 
48 {
49 protected:
50  static void addVectorOption(yarp::os::Bottle &b, const int vcb, const yarp::sig::Vector &v);
51  static bool getDesiredOption(const yarp::os::Bottle &reply, yarp::sig::Vector &xdhat,
52  yarp::sig::Vector &odhat, yarp::sig::Vector &qdhat);
53 
54 public:
60  static void addTargetOption(yarp::os::Bottle &b, const yarp::sig::Vector &xd);
61 
68  static void addDOFOption(yarp::os::Bottle &b, const yarp::sig::Vector &dof);
69 
77  static void addJointsResPosOption(yarp::os::Bottle &b, const yarp::sig::Vector &restPos);
78 
85  static void addJointsRestWeightsOption(yarp::os::Bottle &b, const yarp::sig::Vector &restWeights);
86 
94  static void addPoseOption(yarp::os::Bottle &b, const unsigned int pose);
95 
102  static void addModeOption(yarp::os::Bottle &b, const bool tracking);
103 
110  static void addTokenOption(yarp::os::Bottle &b, const double token);
111 
118  static yarp::os::Bottle *getTargetOption(const yarp::os::Bottle &b);
119 
126  static yarp::os::Bottle *getEndEffectorPoseOption(const yarp::os::Bottle &b);
127 
134  static yarp::os::Bottle *getJointsOption(const yarp::os::Bottle &b);
135 
143  static bool getTokenOption(const yarp::os::Bottle &b, double *token);
144 
155  static bool computeFixationPointData(iKinChain &eyeL, iKinChain &eyeR,
156  yarp::sig::Vector &fp);
157 
170  static bool computeFixationPointData(iKinChain &eyeL, iKinChain &eyeR,
171  yarp::sig::Vector &fp, yarp::sig::Matrix &J);
172 };
173 
174 }
175 
176 }
177 
178 #endif
179 
static void addPoseOption(yarp::os::Bottle &b, const unsigned int pose)
Appends to a bottle all data needed to change the pose mode.
Definition: iKinHlp.cpp:114
static bool computeFixationPointData(iKinChain &eyeL, iKinChain &eyeR, yarp::sig::Vector &fp)
Retrieves current fixation point given the current kinematics configuration of the eyes...
static void addJointsResPosOption(yarp::os::Bottle &b, const yarp::sig::Vector &restPos)
Appends to a bottle all data needed to modify joints rest position.
Definition: iKinHlp.cpp:100
static yarp::os::Bottle * getEndEffectorPoseOption(const yarp::os::Bottle &b)
Retrieves the end-effector pose data.
Definition: iKinHlp.cpp:156
static bool getTokenOption(const yarp::os::Bottle &b, double *token)
Retrieves the token from the bottle.
Definition: iKinHlp.cpp:170
A Base class for defining a Serial Link Chain.
Definition: iKinFwd.h:354
static void addTokenOption(yarp::os::Bottle &b, const double token)
Appends to a bottle a token to be exchanged with the solver.
Definition: iKinHlp.cpp:140
static int v
Definition: iCub_Sim.cpp:47
static void addJointsRestWeightsOption(yarp::os::Bottle &b, const yarp::sig::Vector &restWeights)
Appends to a bottle all data needed to modify joints rest weights.
Definition: iKinHlp.cpp:107
static struct bpf_program fp
Helper class providing useful methods to deal with Cartesian Solver options.
Definition: iKinHlp.h:47
static void addDOFOption(yarp::os::Bottle &b, const yarp::sig::Vector &dof)
Appends to a bottle all data needed to reconfigure chain&#39;s dof.
Definition: iKinHlp.cpp:93
static void addModeOption(yarp::os::Bottle &b, const bool tracking)
Appends to a bottle all data needed to change the tracking mode.
Definition: iKinHlp.cpp:127
static void addVectorOption(yarp::os::Bottle &b, const int vcb, const yarp::sig::Vector &v)
Definition: iKinHlp.cpp:26
static yarp::os::Bottle * getTargetOption(const yarp::os::Bottle &b)
Retrieves commanded target data from a bottle.
Definition: iKinHlp.cpp:149
This file contains the definition of unique IDs for the body parts and the skin parts of the robot...
static yarp::os::Bottle * getJointsOption(const yarp::os::Bottle &b)
Retrieves the joints configuration data.
Definition: iKinHlp.cpp:163
static bool getDesiredOption(const yarp::os::Bottle &reply, yarp::sig::Vector &xdhat, yarp::sig::Vector &odhat, yarp::sig::Vector &qdhat)
Definition: iKinHlp.cpp:38
static void addTargetOption(yarp::os::Bottle &b, const yarp::sig::Vector &xd)
Appends to a bottle all data needed to command a target.
Definition: iKinHlp.cpp:86