Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • lscherrer/sot-talos-balance
  • imaroger/sot-talos-balance
  • pfernbac/sot-talos-balance
  • ostasse/sot-talos-balance
  • gsaurel/sot-talos-balance
  • loco-3d/sot-talos-balance
6 results
Show changes
Showing
with 2449 additions and 670 deletions
/*
* Copyright 2018, Gepetto team, LAAS-CNRS
*
* This file is part of sot-talos-balance.
* sot-talos-balance is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
* sot-talos-balance is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details. You should
* have received a copy of the GNU Lesser General Public License along
* with sot-talos-balance. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __sot_talos_balance_int_identity_H__
#define __sot_talos_balance_int_identity_H__
/* --------------------------------------------------------------------- */
/* --- API ------------------------------------------------------------- */
/* --------------------------------------------------------------------- */
#if defined(WIN32)
#if defined(position_controller_EXPORTS)
#define INT_IDENTITY_EXPORT __declspec(dllexport)
#else
#define INT_IDENTITY_EXPORT __declspec(dllimport)
#endif
#else
#define INT_IDENTITY_EXPORT
#endif
/* --------------------------------------------------------------------- */
/* --- INCLUDE --------------------------------------------------------- */
/* --------------------------------------------------------------------- */
#include <dynamic-graph/signal-helper.h>
#include <map>
#include "boost/assign.hpp"
namespace dynamicgraph {
namespace sot {
namespace talos_balance {
/* --------------------------------------------------------------------- */
/* --- CLASS ----------------------------------------------------------- */
/* --------------------------------------------------------------------- */
class INT_IDENTITY_EXPORT IntIdentity : public ::dynamicgraph::Entity {
DYNAMIC_GRAPH_ENTITY_DECL();
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
/* --- CONSTRUCTOR ---- */
IntIdentity(const std::string& name);
void init() {}
/* --- SIGNALS --- */
DECLARE_SIGNAL_IN(sin, int);
DECLARE_SIGNAL_OUT(sout, int);
/* --- COMMANDS --- */
/* --- ENTITY INHERITANCE --- */
virtual void display(std::ostream& os) const;
}; // class IntIdentity
} // namespace talos_balance
} // namespace sot
} // namespace dynamicgraph
#endif // #ifndef __sot_talos_balance_int_identity_H__
...@@ -21,75 +21,68 @@ ...@@ -21,75 +21,68 @@
/* --- API ------------------------------------------------------------- */ /* --- API ------------------------------------------------------------- */
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
#if defined (WIN32) #if defined(WIN32)
# if defined (position_controller_EXPORTS) #if defined(position_controller_EXPORTS)
# define JOINTPOSITIONCONTROLLER_EXPORT __declspec(dllexport) #define JOINTPOSITIONCONTROLLER_EXPORT __declspec(dllexport)
# else
# define JOINTPOSITIONCONTROLLER_EXPORT __declspec(dllimport)
# endif
#else #else
# define JOINTPOSITIONCONTROLLER_EXPORT #define JOINTPOSITIONCONTROLLER_EXPORT __declspec(dllimport)
#endif
#else
#define JOINTPOSITIONCONTROLLER_EXPORT
#endif #endif
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
/* --- INCLUDE --------------------------------------------------------- */ /* --- INCLUDE --------------------------------------------------------- */
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
#include "utils/signal-helper.hh" #include <dynamic-graph/signal-helper.h>
#include "utils/logger.hh"
#include <map> #include <map>
#include "boost/assign.hpp" #include "boost/assign.hpp"
namespace dynamicgraph { namespace dynamicgraph {
namespace sot { namespace sot {
namespace talos_balance { namespace talos_balance {
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
/* --- CLASS ----------------------------------------------------------- */ /* --- CLASS ----------------------------------------------------------- */
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
class JOINTPOSITIONCONTROLLER_EXPORT JointPositionController
: public ::dynamicgraph::Entity
{
DYNAMIC_GRAPH_ENTITY_DECL();
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
/* --- CONSTRUCTOR ---- */
JointPositionController( const std::string & name );
void init(const unsigned & n); class JOINTPOSITIONCONTROLLER_EXPORT JointPositionController
: public ::dynamicgraph::Entity {
DYNAMIC_GRAPH_ENTITY_DECL();
/* --- SIGNALS --- */ public:
DECLARE_SIGNAL_IN(Kp, dynamicgraph::Vector); EIGEN_MAKE_ALIGNED_OPERATOR_NEW
DECLARE_SIGNAL_IN(state, dynamicgraph::Vector);
DECLARE_SIGNAL_IN(qDes, dynamicgraph::Vector);
DECLARE_SIGNAL_IN(dqDes, dynamicgraph::Vector);
DECLARE_SIGNAL_OUT(dqRef, dynamicgraph::Vector); /* --- CONSTRUCTOR ---- */
JointPositionController(const std::string& name);
/* --- COMMANDS --- */ void init(const unsigned& n);
/* --- ENTITY INHERITANCE --- */
virtual void display( std::ostream& os ) const;
void sendMsg(const std::string& msg, MsgType t=MSG_TYPE_INFO, const char* file="", int line=0) /* --- SIGNALS --- */
{ DECLARE_SIGNAL_IN(Kp, dynamicgraph::Vector);
getLogger().sendMsg("[JointPositionController-"+name+"] "+msg, t, file, line); DECLARE_SIGNAL_IN(state, dynamicgraph::Vector);
} DECLARE_SIGNAL_IN(qDes, dynamicgraph::Vector);
DECLARE_SIGNAL_IN(dqDes, dynamicgraph::Vector);
protected: DECLARE_SIGNAL_OUT(dqRef, dynamicgraph::Vector);
int m_n;
bool m_initSucceeded; /// true if the entity has been successfully initialized
dynamicgraph::Vector m_Kp;
}; // class JointPositionController /* --- COMMANDS --- */
/* --- ENTITY INHERITANCE --- */
virtual void display(std::ostream& os) const;
} // namespace talos_balance protected:
} // namespace sot int m_n;
} // namespace dynamicgraph bool
m_initSucceeded; /// true if the entity has been successfully initialized
dynamicgraph::Vector m_Kp;
}; // class JointPositionController
} // namespace talos_balance
} // namespace sot
} // namespace dynamicgraph
#endif // #ifndef __sot_talos_balance_joint_position_controller_H__ #endif // #ifndef __sot_talos_balance_joint_position_controller_H__
This diff is collapsed.
...@@ -21,50 +21,46 @@ ...@@ -21,50 +21,46 @@
#include <Eigen/Core> #include <Eigen/Core>
#ifdef EIGEN_RUNTIME_NO_MALLOC #ifdef EIGEN_RUNTIME_NO_MALLOC
#define EIGEN_MALLOC_ALLOWED Eigen::internal::set_is_malloc_allowed(true); #define EIGEN_MALLOC_ALLOWED Eigen::internal::set_is_malloc_allowed(true);
#define EIGEN_MALLOC_NOT_ALLOWED Eigen::internal::set_is_malloc_allowed(false); #define EIGEN_MALLOC_NOT_ALLOWED Eigen::internal::set_is_malloc_allowed(false);
#else #else
#define EIGEN_MALLOC_ALLOWED #define EIGEN_MALLOC_ALLOWED
#define EIGEN_MALLOC_NOT_ALLOWED #define EIGEN_MALLOC_NOT_ALLOWED
#endif #endif
namespace dynamicgraph namespace dynamicgraph {
{ namespace sot {
namespace sot namespace talos_balance {
{ namespace math {
namespace talos_balance
{ typedef double Scalar;
namespace math typedef Eigen::Matrix<Scalar, Eigen::Dynamic, 1> Vector;
{ typedef Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic> Matrix;
typedef Eigen::VectorXi VectorXi;
typedef double Scalar; typedef Eigen::Matrix<bool, Eigen::Dynamic, 1> VectorXb;
typedef Eigen::Matrix<Scalar,Eigen::Dynamic,1> Vector;
typedef Eigen::Matrix<Scalar,Eigen::Dynamic,Eigen::Dynamic> Matrix; typedef Eigen::Matrix<Scalar, 3, 1> Vector3;
typedef Eigen::VectorXi VectorXi; typedef Eigen::Matrix<Scalar, 6, 1> Vector6;
typedef Eigen::Matrix<bool,Eigen::Dynamic,1> VectorXb; typedef Eigen::Matrix<Scalar, 3, Eigen::Dynamic> Matrix3x;
typedef Eigen::Matrix<Scalar,3,1> Vector3; typedef Eigen::Ref<Vector3> RefVector3;
typedef Eigen::Matrix<Scalar,6,1> Vector6; typedef const Eigen::Ref<const Vector3> ConstRefVector3;
typedef Eigen::Matrix<Scalar,3,Eigen::Dynamic> Matrix3x;
typedef Eigen::Ref<Vector> RefVector;
typedef Eigen::Ref<Vector3> RefVector3; typedef const Eigen::Ref<const Vector> ConstRefVector;
typedef const Eigen::Ref<const Vector3> ConstRefVector3;
typedef Eigen::Ref<Matrix> RefMatrix;
typedef Eigen::Ref<Vector> RefVector; typedef const Eigen::Ref<const Matrix> ConstRefMatrix;
typedef const Eigen::Ref<const Vector> ConstRefVector;
typedef std::size_t Index;
typedef Eigen::Ref<Matrix> RefMatrix;
typedef const Eigen::Ref<const Matrix> ConstRefMatrix; // Forward declaration of constraints
class ConstraintBase;
typedef std::size_t Index; class ConstraintEquality;
class ConstraintInequality;
// Forward declaration of constraints class ConstraintBound;
class ConstraintBase;
class ConstraintEquality; } // namespace math
class ConstraintInequality; } // namespace talos_balance
class ConstraintBound; } // namespace sot
} // namespace dynamicgraph
} #endif // ifndef __invdyn_math_fwd_hpp__
}
}
}
#endif // ifndef __invdyn_math_fwd_hpp__
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.