Commit ca0675f2 authored by Gabriele Buondonno's avatar Gabriele Buondonno

[boolean-identity] New entity

parent 1e628ae5
/*
* 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_boolean_identity_H__
#define __sot_talos_balance_boolean_identity_H__
/* --------------------------------------------------------------------- */
/* --- API ------------------------------------------------------------- */
/* --------------------------------------------------------------------- */
#if defined (WIN32)
# if defined (position_controller_EXPORTS)
# define BOOLEAN_IDENTITY_EXPORT __declspec(dllexport)
# else
# define BOOLEAN_IDENTITY_EXPORT __declspec(dllimport)
# endif
#else
# define BOOLEAN_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 BOOLEAN_IDENTITY_EXPORT BooleanIdentity
: public ::dynamicgraph::Entity
{
DYNAMIC_GRAPH_ENTITY_DECL();
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
/* --- CONSTRUCTOR ---- */
BooleanIdentity( const std::string & name );
void init(){}
/* --- SIGNALS --- */
DECLARE_SIGNAL_IN(sin, bool);
DECLARE_SIGNAL_OUT(sout, bool);
/* --- COMMANDS --- */
/* --- ENTITY INHERITANCE --- */
virtual void display( std::ostream& os ) const;
}; // class BooleanIdentity
} // namespace talos_balance
} // namespace sot
} // namespace dynamicgraph
#endif // #ifndef __sot_talos_balance_boolean_identity_H__
......@@ -16,9 +16,11 @@ from sot_talos_balance.pose_quaternion_to_matrix_homo import PoseQuaternionToMat
from dynamic_graph.sot.core.operator import Mix_of_vector
from dynamic_graph.sot.core.operator import Selec_of_vector
from dynamic_graph.sot.core.operator import Component_of_vector
from dynamic_graph.sot.core.operator import MatrixHomoToPoseQuaternion
from dynamic_graph.sot.core.operator import PoseRollPitchYawToMatrixHomo
from dynamic_graph.sot.core.operator import MatrixHomoToPoseRollPitchYaw
from sot_talos_balance.boolean_identity import BooleanIdentity
from sot_talos_balance.nd_trajectory_generator import NdTrajectoryGenerator
from sot_talos_balance.joint_position_controller import JointPositionController
from sot_talos_balance.admittance_controller import AdmittanceController
......
......@@ -36,6 +36,7 @@ ENDIF(UNIX)
#This project will create many plugins as shared libraries, listed here
SET(plugins
example
boolean-identity
pose-quaternion-to-matrix-homo
euler-to-quat
quat-to-euler
......
/*
* 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/>.
*/
#include "sot/talos_balance/boolean-identity.hh"
#include <sot/core/debug.hh>
#include <dynamic-graph/factory.h>
#include <dynamic-graph/all-commands.h>
namespace dynamicgraph
{
namespace sot
{
namespace talos_balance
{
namespace dg = ::dynamicgraph;
using namespace dg;
using namespace dg::command;
#define INPUT_SIGNALS m_sinSIN
#define OUTPUT_SIGNALS m_soutSOUT
/// Define EntityClassName here rather than in the header file
/// so that it can be used by the macros DEFINE_SIGNAL_**_FUNCTION.
typedef BooleanIdentity EntityClassName;
/* --- DG FACTORY ---------------------------------------------------- */
DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(BooleanIdentity,
"BooleanIdentity");
/* ------------------------------------------------------------------- */
/* --- CONSTRUCTION -------------------------------------------------- */
/* ------------------------------------------------------------------- */
BooleanIdentity::BooleanIdentity(const std::string& name)
: Entity(name)
, CONSTRUCT_SIGNAL_IN(sin, bool)
, CONSTRUCT_SIGNAL_OUT(sout, bool, INPUT_SIGNALS)
{
Entity::signalRegistration( INPUT_SIGNALS << OUTPUT_SIGNALS );
/* Commands. */
addCommand("init", makeCommandVoid0(*this, &BooleanIdentity::init, docCommandVoid0("Initialize the entity.")));
}
/* ------------------------------------------------------------------- */
/* --- SIGNALS ------------------------------------------------------- */
/* ------------------------------------------------------------------- */
DEFINE_SIGNAL_OUT_FUNCTION(sout,bool)
{
s = m_sinSIN(iter);
return s;
}
/* ------------------------------------------------------------------- */
/* --- ENTITY -------------------------------------------------------- */
/* ------------------------------------------------------------------- */
void BooleanIdentity::display(std::ostream& os) const
{
os << "BooleanIdentity " << getName();
// try
// {
// getProfiler().report_all(3, os);
// }
// catch (ExceptionSignal e) {}
}
} // namespace talos_balance
} // namespace sot
} // namespace dynamicgraph
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment