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;
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;
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 )
static string displaybool(const char c, const bool reverse=false )
{
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;
if(reverse) oss<< (!((c>>j)&0x1)); else oss<< (((c>>j)&0x1));//?"1":"0");
......
......@@ -35,13 +35,13 @@ DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(ExpMovingAvg,"ExpMovingAvg");
ExpMovingAvg::
ExpMovingAvg( const std::string& n )
:Entity(n)
,updateSIN(NULL, "ExpMovingAvg(" + n + ")::input(vector)::update")
,alpha(0.)
,init(false)
,refresherSINTERN( "ExpMovingAvg("+n+")::intern(dummy)::refresher" )
,averageSOUT(
boost::bind(&ExpMovingAvg::update,this,_1,_2),
updateSIN << refresherSINTERN, "ExpMovingAvg(" + n + ")::output(vector)::average")
,updateSIN(NULL, "ExpMovingAvg(" + n + ")::input(vector)::update")
,refresherSINTERN( "ExpMovingAvg("+n+")::intern(dummy)::refresher" )
,averageSOUT(
boost::bind(&ExpMovingAvg::update,this,_1,_2),
updateSIN << refresherSINTERN, "ExpMovingAvg(" + n + ")::output(vector)::average")
,alpha(0.)
,init(false)
{
// Register signals into the entity.
signalRegistration(updateSIN << averageSOUT);
......
......@@ -35,13 +35,13 @@ DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(GradientAscent,"GradientAscent");
GradientAscent::
GradientAscent( const std::string& n )
:Entity(n)
,gradientSIN(NULL, "GradientAscent(" + n + ")::input(vector)::gradient")
,learningRateSIN(NULL, "GradientAscent(" + n + ")::input(double)::learningRate")
,init(false)
,refresherSINTERN( "GradientAscent("+n+")::intern(dummy)::refresher" )
,valueSOUT(
boost::bind(&GradientAscent::update,this,_1,_2),
gradientSIN << refresherSINTERN, "GradientAscent(" + n + ")::output(vector)::value")
,gradientSIN(NULL, "GradientAscent(" + n + ")::input(vector)::gradient")
,learningRateSIN(NULL, "GradientAscent(" + n + ")::input(double)::learningRate")
,refresherSINTERN( "GradientAscent("+n+")::intern(dummy)::refresher" )
,valueSOUT(
boost::bind(&GradientAscent::update,this,_1,_2),
gradientSIN << refresherSINTERN, "GradientAscent(" + n + ")::output(vector)::value")
,init(false)
{
// Register signals into the entity.
signalRegistration(gradientSIN << learningRateSIN << valueSOUT);
......
......@@ -282,12 +282,12 @@ namespace dynamicgraph
bool ParameterServer::convertJointNameToJointId(const std::string& name, unsigned int& id)
{
// 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)
{
SEND_MSG("The specified joint name does not exist: "+name, MSG_TYPE_ERROR);
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) <<", ";
SEND_MSG("Possible joint names are: "+ss.str(), MSG_TYPE_INFO);
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