abstract_param_reader.cpp
Go to the documentation of this file.
2 
3 float AbstractParamReader::floatOf(XmlRpc::XmlRpcValue& val){
4  float t = 0;
5  try{
6  switch (val.getType()){
7  case XmlRpc::XmlRpcValue::TypeInt:
8  t = static_cast<int>(val);
9  break;
10  case XmlRpc::XmlRpcValue::TypeDouble:
11  t = static_cast<double>(val);
12  break;
13  case XmlRpc::XmlRpcValue::TypeString:
14  t = std::stof(val);
15  break;
16  default:
17  ROS_INFO("value type is some unknown type");
18  }
19  } catch (XmlRpc::XmlRpcException){
20  ROS_INFO("Something went wrong, returning 0");
21  }
22  return t;
23 }
abstract_param_reader.h
AbstractParamReader::floatOf
float floatOf(XmlRpc::XmlRpcValue &val)
Xmlrpc parser.
Definition: abstract_param_reader.cpp:3


multi_cell_builder
Author(s): Matteo Anedda
autogenerated on Sun Apr 9 2023 23:59:51