Skip to content

Commit 1ee6372

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)
1 parent d59a58e commit 1ee6372

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

include/sot/core/robot-utils.hh

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,25 @@
2222

2323
#ifdef BOOST_MPL_LIMIT_VECTOR_SIZE
2424
#pragma push_macro("BOOST_MPL_LIMIT_VECTOR_SIZE")
25+
#define UNDEF_BOOST_MPL_LIMIT_VECTOR_SIZE
2526
#undef BOOST_MPL_LIMIT_VECTOR_SIZE
27+
#endif
28+
29+
#ifdef BOOST_MPL_LIMIT_LIST_SIZE
30+
#pragma push_macro("BOOST_MPL_LIMIT_LIST_SIZE")
31+
#define UNDEF_BOOST_MPL_LIMIT_LIST_SIZE
32+
#undef BOOST_MPL_LIMIT_LIST_SIZE
33+
#endif
34+
35+
2636
#include <boost/property_tree/ptree.hpp>
37+
38+
#ifdef UNDEF_BOOST_MPL_LIMIT_VECTOR_SIZE
2739
#pragma pop_macro("BOOST_MPL_LIMIT_VECTOR_SIZE")
28-
#else
29-
#include <boost/property_tree/ptree.hpp>
40+
#endif
41+
42+
#ifdef UNDEF_BOOST_MPL_LIMIT_LIST_SIZE
43+
#pragma pop_macro("BOOST_MPL_LIMIT_LIST_SIZE")
3044
#endif
3145

3246
#include "boost/assign.hpp"

src/tools/parameter-server.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,11 @@ void ParameterServer::init_simple(const double &dt) {
225225
if (listOfRobots->size() == 1)
226226
localName = (*listOfRobots)[0];
227227
else {
228+
std::ostringstream oss;
229+
oss << "No robot registered in the parameter server list";
230+
oss << " listOfRobots->size: " << listOfRobots->size();
228231
throw ExceptionTools(ExceptionTools::ErrorCodeEnum::PARAMETER_SERVER,
229-
"No robot registered in the parameter server list");
232+
oss.str());
230233
}
231234

232235
if (!isNameInRobotUtil(localName)) {

src/tools/robot-utils.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <boost/property_tree/xml_parser.hpp>
2424
#endif
2525

26+
2627
#include <dynamic-graph/factory.h>
2728
#include <iostream>
2829
#include <sot/core/debug.hh>
@@ -113,6 +114,7 @@ void ForceLimits::display(std::ostream &os) const {
113114
os << lower << std::endl;
114115
os << "Upper Limits:" << std::endl;
115116
os << upper << std::endl;
117+
116118
}
117119

118120
/******************** FootUtil ***************************/
@@ -440,6 +442,9 @@ void RobotUtil::display(std::ostream &os) const {
440442
os << "(" << it->first << "," << it->second << ") ";
441443
}
442444
os << std::endl;
445+
446+
boost::property_tree::write_xml(os,property_tree_);
447+
443448
}
444449

445450
void RobotUtil::sendMsg(const std::string &msg, MsgType t,

0 commit comments

Comments
 (0)