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 @@
/* --- API ------------------------------------------------------------- */
/* --------------------------------------------------------------------- */
#if defined (WIN32)
# if defined (position_controller_EXPORTS)
# define JOINTPOSITIONCONTROLLER_EXPORT __declspec(dllexport)
# else
# define JOINTPOSITIONCONTROLLER_EXPORT __declspec(dllimport)
# endif
#if defined(WIN32)
#if defined(position_controller_EXPORTS)
#define JOINTPOSITIONCONTROLLER_EXPORT __declspec(dllexport)
#else
# define JOINTPOSITIONCONTROLLER_EXPORT
#define JOINTPOSITIONCONTROLLER_EXPORT __declspec(dllimport)
#endif
#else
#define JOINTPOSITIONCONTROLLER_EXPORT
#endif
/* --------------------------------------------------------------------- */
/* --- INCLUDE --------------------------------------------------------- */
/* --------------------------------------------------------------------- */
#include "utils/signal-helper.hh"
#include "utils/logger.hh"
#include <dynamic-graph/signal-helper.h>
#include <map>
#include "boost/assign.hpp"
namespace dynamicgraph {
namespace sot {
namespace talos_balance {
namespace sot {
namespace talos_balance {
/* --------------------------------------------------------------------- */
/* --- CLASS ----------------------------------------------------------- */
/* --------------------------------------------------------------------- */
class JOINTPOSITIONCONTROLLER_EXPORT JointPositionController
: public ::dynamicgraph::Entity
{
DYNAMIC_GRAPH_ENTITY_DECL();
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
/* --- CONSTRUCTOR ---- */
JointPositionController( const std::string & name );
/* --------------------------------------------------------------------- */
/* --- CLASS ----------------------------------------------------------- */
/* --------------------------------------------------------------------- */
void init(const unsigned & n);
class JOINTPOSITIONCONTROLLER_EXPORT JointPositionController
: public ::dynamicgraph::Entity {
DYNAMIC_GRAPH_ENTITY_DECL();
/* --- SIGNALS --- */
DECLARE_SIGNAL_IN(Kp, dynamicgraph::Vector);
DECLARE_SIGNAL_IN(state, dynamicgraph::Vector);
DECLARE_SIGNAL_IN(qDes, dynamicgraph::Vector);
DECLARE_SIGNAL_IN(dqDes, dynamicgraph::Vector);
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
DECLARE_SIGNAL_OUT(dqRef, dynamicgraph::Vector);
/* --- CONSTRUCTOR ---- */
JointPositionController(const std::string& name);
/* --- COMMANDS --- */
/* --- ENTITY INHERITANCE --- */
virtual void display( std::ostream& os ) const;
void init(const unsigned& n);
void sendMsg(const std::string& msg, MsgType t=MSG_TYPE_INFO, const char* file="", int line=0)
{
getLogger().sendMsg("[JointPositionController-"+name+"] "+msg, t, file, line);
}
/* --- SIGNALS --- */
DECLARE_SIGNAL_IN(Kp, dynamicgraph::Vector);
DECLARE_SIGNAL_IN(state, dynamicgraph::Vector);
DECLARE_SIGNAL_IN(qDes, dynamicgraph::Vector);
DECLARE_SIGNAL_IN(dqDes, dynamicgraph::Vector);
protected:
int m_n;
bool m_initSucceeded; /// true if the entity has been successfully initialized
dynamicgraph::Vector m_Kp;
DECLARE_SIGNAL_OUT(dqRef, dynamicgraph::Vector);
}; // class JointPositionController
/* --- COMMANDS --- */
/* --- ENTITY INHERITANCE --- */
virtual void display(std::ostream& os) const;
} // namespace talos_balance
} // namespace sot
} // namespace dynamicgraph
protected:
int m_n;
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 @@
#include <Eigen/Core>
#ifdef EIGEN_RUNTIME_NO_MALLOC
#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_ALLOWED Eigen::internal::set_is_malloc_allowed(true);
#define EIGEN_MALLOC_NOT_ALLOWED Eigen::internal::set_is_malloc_allowed(false);
#else
#define EIGEN_MALLOC_ALLOWED
#define EIGEN_MALLOC_NOT_ALLOWED
#define EIGEN_MALLOC_ALLOWED
#define EIGEN_MALLOC_NOT_ALLOWED
#endif
namespace dynamicgraph
{
namespace sot
{
namespace talos_balance
{
namespace math
{
typedef double Scalar;
typedef Eigen::Matrix<Scalar,Eigen::Dynamic,1> Vector;
typedef Eigen::Matrix<Scalar,Eigen::Dynamic,Eigen::Dynamic> Matrix;
typedef Eigen::VectorXi VectorXi;
typedef Eigen::Matrix<bool,Eigen::Dynamic,1> VectorXb;
typedef Eigen::Matrix<Scalar,3,1> Vector3;
typedef Eigen::Matrix<Scalar,6,1> Vector6;
typedef Eigen::Matrix<Scalar,3,Eigen::Dynamic> Matrix3x;
typedef Eigen::Ref<Vector3> RefVector3;
typedef const Eigen::Ref<const Vector3> ConstRefVector3;
typedef Eigen::Ref<Vector> RefVector;
typedef const Eigen::Ref<const Vector> ConstRefVector;
typedef Eigen::Ref<Matrix> RefMatrix;
typedef const Eigen::Ref<const Matrix> ConstRefMatrix;
typedef std::size_t Index;
// Forward declaration of constraints
class ConstraintBase;
class ConstraintEquality;
class ConstraintInequality;
class ConstraintBound;
}
}
}
}
#endif // ifndef __invdyn_math_fwd_hpp__
namespace dynamicgraph {
namespace sot {
namespace talos_balance {
namespace math {
typedef double Scalar;
typedef Eigen::Matrix<Scalar, Eigen::Dynamic, 1> Vector;
typedef Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic> Matrix;
typedef Eigen::VectorXi VectorXi;
typedef Eigen::Matrix<bool, Eigen::Dynamic, 1> VectorXb;
typedef Eigen::Matrix<Scalar, 3, 1> Vector3;
typedef Eigen::Matrix<Scalar, 6, 1> Vector6;
typedef Eigen::Matrix<Scalar, 3, Eigen::Dynamic> Matrix3x;
typedef Eigen::Ref<Vector3> RefVector3;
typedef const Eigen::Ref<const Vector3> ConstRefVector3;
typedef Eigen::Ref<Vector> RefVector;
typedef const Eigen::Ref<const Vector> ConstRefVector;
typedef Eigen::Ref<Matrix> RefMatrix;
typedef const Eigen::Ref<const Matrix> ConstRefMatrix;
typedef std::size_t Index;
// Forward declaration of constraints
class ConstraintBase;
class ConstraintEquality;
class ConstraintInequality;
class ConstraintBound;
} // namespace math
} // namespace talos_balance
} // namespace sot
} // namespace dynamicgraph
#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.