Commit 33597c50 authored by Olivier Stasse's avatar Olivier Stasse
Browse files

Fix Index issue on parameter-server.cpp + fix warnings.

parent 6d6a2d9d
Pipeline #3520 passed with stage
in 31 minutes and 46 seconds
...@@ -29,7 +29,7 @@ using namespace dynamicgraph::sot; ...@@ -29,7 +29,7 @@ using namespace dynamicgraph::sot;
static void displaybool( ostream& os, const char c, const bool reverse=false ) static void displaybool( ostream& os, const char c, const bool reverse=false )
{ {
for( unsigned int j=sizeof(char)*8;j-->0; ) for( std::size_t j=sizeof(char)*8;j-->0; )
{ {
//os<<i<<","<<j<<": "<<c+0<<std::endl; //os<<i<<","<<j<<": "<<c+0<<std::endl;
if(reverse) os<< (!((c>>j)&0x1)); else os<< (((c>>j)&0x1));//?"1":"0"); if(reverse) os<< (!((c>>j)&0x1)); else os<< (((c>>j)&0x1));//?"1":"0");
...@@ -38,7 +38,7 @@ static void displaybool( ostream& os, const char c, const bool reverse=false ) ...@@ -38,7 +38,7 @@ static void displaybool( ostream& os, const char c, const bool reverse=false )
static string displaybool(const char c, const bool reverse=false ) static string displaybool(const char c, const bool reverse=false )
{ {
stringstream oss; stringstream oss;
for( unsigned int j=sizeof(char)*8;j-->0; ) for( std::size_t j=sizeof(char)*8;j-->0; )
{ {
//os<<i<<","<<j<<": "<<c+0<<std::endl; //os<<i<<","<<j<<": "<<c+0<<std::endl;
if(reverse) oss<< (!((c>>j)&0x1)); else oss<< (((c>>j)&0x1));//?"1":"0"); if(reverse) oss<< (!((c>>j)&0x1)); else oss<< (((c>>j)&0x1));//?"1":"0");
......
...@@ -35,13 +35,13 @@ DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(ExpMovingAvg,"ExpMovingAvg"); ...@@ -35,13 +35,13 @@ DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(ExpMovingAvg,"ExpMovingAvg");
ExpMovingAvg:: ExpMovingAvg::
ExpMovingAvg( const std::string& n ) ExpMovingAvg( const std::string& n )
:Entity(n) :Entity(n)
,updateSIN(NULL, "ExpMovingAvg(" + n + ")::input(vector)::update") ,updateSIN(NULL, "ExpMovingAvg(" + n + ")::input(vector)::update")
,alpha(0.) ,refresherSINTERN( "ExpMovingAvg("+n+")::intern(dummy)::refresher" )
,init(false) ,averageSOUT(
,refresherSINTERN( "ExpMovingAvg("+n+")::intern(dummy)::refresher" ) boost::bind(&ExpMovingAvg::update,this,_1,_2),
,averageSOUT( updateSIN << refresherSINTERN, "ExpMovingAvg(" + n + ")::output(vector)::average")
boost::bind(&ExpMovingAvg::update,this,_1,_2), ,alpha(0.)
updateSIN << refresherSINTERN, "ExpMovingAvg(" + n + ")::output(vector)::average") ,init(false)
{ {
// Register signals into the entity. // Register signals into the entity.
signalRegistration(updateSIN << averageSOUT); signalRegistration(updateSIN << averageSOUT);
......
...@@ -35,13 +35,13 @@ DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(GradientAscent,"GradientAscent"); ...@@ -35,13 +35,13 @@ DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(GradientAscent,"GradientAscent");
GradientAscent:: GradientAscent::
GradientAscent( const std::string& n ) GradientAscent( const std::string& n )
:Entity(n) :Entity(n)
,gradientSIN(NULL, "GradientAscent(" + n + ")::input(vector)::gradient") ,gradientSIN(NULL, "GradientAscent(" + n + ")::input(vector)::gradient")
,learningRateSIN(NULL, "GradientAscent(" + n + ")::input(double)::learningRate") ,learningRateSIN(NULL, "GradientAscent(" + n + ")::input(double)::learningRate")
,init(false) ,refresherSINTERN( "GradientAscent("+n+")::intern(dummy)::refresher" )
,refresherSINTERN( "GradientAscent("+n+")::intern(dummy)::refresher" ) ,valueSOUT(
,valueSOUT( boost::bind(&GradientAscent::update,this,_1,_2),
boost::bind(&GradientAscent::update,this,_1,_2), gradientSIN << refresherSINTERN, "GradientAscent(" + n + ")::output(vector)::value")
gradientSIN << refresherSINTERN, "GradientAscent(" + n + ")::output(vector)::value") ,init(false)
{ {
// Register signals into the entity. // Register signals into the entity.
signalRegistration(gradientSIN << learningRateSIN << valueSOUT); signalRegistration(gradientSIN << learningRateSIN << valueSOUT);
......
...@@ -282,12 +282,12 @@ namespace dynamicgraph ...@@ -282,12 +282,12 @@ namespace dynamicgraph
bool ParameterServer::convertJointNameToJointId(const std::string& name, unsigned int& id) bool ParameterServer::convertJointNameToJointId(const std::string& name, unsigned int& id)
{ {
// Check if the joint name exists // Check if the joint name exists
Eigen::Index jid = m_robot_util->get_id_from_name(name); sot::Index jid = m_robot_util->get_id_from_name(name);
if (jid<0) if (jid<0)
{ {
SEND_MSG("The specified joint name does not exist: "+name, MSG_TYPE_ERROR); SEND_MSG("The specified joint name does not exist: "+name, MSG_TYPE_ERROR);
std::stringstream ss; std::stringstream ss;
for(Eigen::Index it=0; it< m_robot_util->m_nbJoints;it++) for(long unsigned int it=0; it< m_robot_util->m_nbJoints;it++)
ss<< m_robot_util->get_name_from_id(it) <<", "; ss<< m_robot_util->get_name_from_id(it) <<", ";
SEND_MSG("Possible joint names are: "+ss.str(), MSG_TYPE_INFO); SEND_MSG("Possible joint names are: "+ss.str(), MSG_TYPE_INFO);
return false; return false;
......
Supports Markdown
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