Skip to content
Snippets Groups Projects
Commit 1ee63726 authored by Olivier Stasse's avatar Olivier Stasse
Browse files

Minor fixes

Improves error msg when there is no robot registered in
ParameterServer (parameter-server.cpp)
Improves robustness to pragma inclusion (robot-utils.hh)
Display parameter_tree when calling displayRobotUtils
(robot-utils.cpp)
parent d59a58ec
No related branches found
No related tags found
No related merge requests found
Pipeline #10910 passed with warnings
......@@ -22,11 +22,25 @@
#ifdef BOOST_MPL_LIMIT_VECTOR_SIZE
#pragma push_macro("BOOST_MPL_LIMIT_VECTOR_SIZE")
#define UNDEF_BOOST_MPL_LIMIT_VECTOR_SIZE
#undef BOOST_MPL_LIMIT_VECTOR_SIZE
#endif
#ifdef BOOST_MPL_LIMIT_LIST_SIZE
#pragma push_macro("BOOST_MPL_LIMIT_LIST_SIZE")
#define UNDEF_BOOST_MPL_LIMIT_LIST_SIZE
#undef BOOST_MPL_LIMIT_LIST_SIZE
#endif
#include <boost/property_tree/ptree.hpp>
#ifdef UNDEF_BOOST_MPL_LIMIT_VECTOR_SIZE
#pragma pop_macro("BOOST_MPL_LIMIT_VECTOR_SIZE")
#else
#include <boost/property_tree/ptree.hpp>
#endif
#ifdef UNDEF_BOOST_MPL_LIMIT_LIST_SIZE
#pragma pop_macro("BOOST_MPL_LIMIT_LIST_SIZE")
#endif
#include "boost/assign.hpp"
......
......@@ -225,8 +225,11 @@ void ParameterServer::init_simple(const double &dt) {
if (listOfRobots->size() == 1)
localName = (*listOfRobots)[0];
else {
std::ostringstream oss;
oss << "No robot registered in the parameter server list";
oss << " listOfRobots->size: " << listOfRobots->size();
throw ExceptionTools(ExceptionTools::ErrorCodeEnum::PARAMETER_SERVER,
"No robot registered in the parameter server list");
oss.str());
}
if (!isNameInRobotUtil(localName)) {
......
......@@ -23,6 +23,7 @@
#include <boost/property_tree/xml_parser.hpp>
#endif
#include <dynamic-graph/factory.h>
#include <iostream>
#include <sot/core/debug.hh>
......@@ -113,6 +114,7 @@ void ForceLimits::display(std::ostream &os) const {
os << lower << std::endl;
os << "Upper Limits:" << std::endl;
os << upper << std::endl;
}
/******************** FootUtil ***************************/
......@@ -440,6 +442,9 @@ void RobotUtil::display(std::ostream &os) const {
os << "(" << it->first << "," << it->second << ") ";
}
os << std::endl;
boost::property_tree::write_xml(os,property_tree_);
}
void RobotUtil::sendMsg(const std::string &msg, MsgType t,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment