ocra-wbi-plugins
Doxygen documentation for the ocra-wbi-plugins repository
ocra-wbi-plugins/ocra-icub/include/ocra-icub/Utilities.h
Go to the documentation of this file.
00001 
00008 /*
00009  *  This file is part of ocra-icub.
00010  *  Copyright (C) 2016 Institut des Systèmes Intelligents et de Robotique (ISIR)
00011  *
00012  *  This program is free software: you can redistribute it and/or modify
00013  *  it under the terms of the GNU General Public License as published by
00014  *  the Free Software Foundation, either version 3 of the License, or
00015  *  (at your option) any later version.
00016  *
00017  *  This program is distributed in the hope that it will be useful,
00018  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020  *  GNU General Public License for more details.
00021  *
00022  *  You should have received a copy of the GNU General Public License
00023  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
00024 */
00025 
00026 #ifndef OCRA_ICUB_UTILITIES_H
00027 #define OCRA_ICUB_UTILITIES_H
00028 
00029 /*
00030  *  Let's include some shit!!!! Here we go...
00031  */
00032 
00033 // STL includes
00034 #include <memory>
00035 #include <cmath>
00036 #include <iostream>
00037 #include <string>
00038 #include <vector>
00039 #include <sstream>
00040 
00041 
00042 // Yarp includes
00043 #include <yarp/os/BufferedPort.h>
00044 #include <yarp/os/Bottle.h>
00045 #include <yarp/os/RateThread.h>
00046 #include <yarp/os/ResourceFinder.h>
00047 #include <yarp/os/PortReader.h>
00048 #include <yarp/os/RpcClient.h>
00049 #include <yarp/os/RpcServer.h>
00050 #include <yarp/os/ConnectionReader.h>
00051 #include <yarp/os/Time.h>
00052 #include <yarp/os/Log.h>
00053 #include <yarp/os/LogStream.h>
00054 #include <yarp/os/Property.h>
00055 #include <yarp/sig/Vector.h>
00056 #include <yarp/sig/Matrix.h>
00057 
00058 // WholeBodyInterface includes
00059 #include <wbi/wbi.h>
00060 
00061 // Ocra includes
00062 #include "ocra/control/Model.h"
00063 #include "ocra/util/StringUtilities.h"
00064 
00065 // Eigen includes
00066 #include <Eigen/Dense>
00067 #include <Eigen/Lgsm>
00068 
00069 
00070 namespace ocra_icub
00071 {
00072 
00076 #ifndef CLASS_POINTER_TYPEDEFS
00077 #define CLASS_POINTER_TYPEDEFS(Class) public:\
00078 using ptr           = std::shared_ptr   <Class>;  \
00079 using shared_ptr    = std::shared_ptr   <Class>;  \
00080 using unique_ptr    = std::unique_ptr   <Class>;  \
00081 using weak_ptr      = std::weak_ptr     <Class>;  \
00082 using const_ptr           = const std::shared_ptr   <Class>;  \
00083 using const_shared_ptr    = const std::shared_ptr   <Class>;  \
00084 using const_unique_ptr    = const std::unique_ptr   <Class>;  \
00085 using const_weak_ptr      = const std::weak_ptr     <Class>;
00086 #endif
00087 
00088 
00089 
00090 static constexpr double DEG_TO_RAD = M_PI/180.0;
00091 
00092 enum OCRA_ICUB_MESSAGE
00093 {
00094     STRING_MESSAGE = -1,
00095     FAILURE = 0,
00096     SUCCESS,
00097 
00098     GET_MODEL_CONFIG_INFO,
00099     GET_CONTROLLER_SERVER_STATUS,
00100 
00101     CONTROLLER_SERVER_RUNNING,
00102     CONTROLLER_SERVER_STOPPED,
00103     CONTROLLER_SERVER_PAUSED,
00104 
00105     GET_L_FOOT_POSE,
00106 
00107     HELP
00108 };
00109 
00110 void getNominalPosture(const ocra::Model &model, Eigen::VectorXd &q);
00111 void getHomePosture(const ocra::Model &model, Eigen::VectorXd &q);
00112 
00113 
00114 } /* ocra_icub */
00115 #endif //OCRA_ICUB_UTILITIES_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines