update
This commit is contained in:
parent
c220246618
commit
6bd0600eb8
|
|
@ -1 +1 @@
|
|||
Subproject commit a28f05c6d5cb6cf2d8c4ffb52a637ecfa2878db2
|
||||
Subproject commit 59b0b1a806d8da28c32694f04d83985c727ea280
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit cf3f04d82c1d41f90160c31630b0250a348e7385
|
||||
Subproject commit 60c97b940ecc9087c79ba5e5563f6b8ff204979e
|
||||
|
|
@ -99,7 +99,7 @@ robot_nav_2d_msgs::Polygon2D polygonFromString(const std::string& polygon_string
|
|||
* 3 or more elements, and the sub-arrays should all have exactly 2 elements
|
||||
* (x and y coordinates).
|
||||
*/
|
||||
robot_nav_2d_msgs::Polygon2D polygonFromXMLRPC(XmlRpc::XmlRpcValue& polygon_xmlrpc);
|
||||
robot_nav_2d_msgs::Polygon2D polygonFromXMLRPC(robot::XmlRpc::XmlRpcValue& polygon_xmlrpc);
|
||||
|
||||
/**
|
||||
* @brief Create XMLRPC Value for writing the polygon to the parameter server
|
||||
|
|
@ -107,7 +107,7 @@ robot_nav_2d_msgs::Polygon2D polygonFromXMLRPC(XmlRpc::XmlRpcValue& polygon_xmlr
|
|||
* @param array_of_arrays If true, write an array of arrays. Otherwise, write two parallel arrays
|
||||
* @return XmlRpcValue
|
||||
*/
|
||||
XmlRpc::XmlRpcValue polygonToXMLRPC(const robot_nav_2d_msgs::Polygon2D& polygon, bool array_of_arrays = true);
|
||||
robot::XmlRpc::XmlRpcValue polygonToXMLRPC(const robot_nav_2d_msgs::Polygon2D& polygon, bool array_of_arrays = true);
|
||||
|
||||
// /**
|
||||
// * @brief Save a polygon to a parameter
|
||||
|
|
|
|||
|
|
@ -159,13 +159,13 @@ Polygon2D polygonFromString(const std::string& polygon_string)
|
|||
/**
|
||||
* @brief Helper function. Convert value to double
|
||||
*/
|
||||
double getNumberFromXMLRPC(XmlRpc::XmlRpcValue& value)
|
||||
double getNumberFromXMLRPC(robot::XmlRpc::XmlRpcValue& value)
|
||||
{
|
||||
if (value.getType() == XmlRpc::XmlRpcValue::TypeInt)
|
||||
if (value.getType() == robot::XmlRpc::XmlRpcValue::TypeInt)
|
||||
{
|
||||
return static_cast<double>(static_cast<int>(value));
|
||||
}
|
||||
else if (value.getType() == XmlRpc::XmlRpcValue::TypeDouble)
|
||||
else if (value.getType() == robot::XmlRpc::XmlRpcValue::TypeDouble)
|
||||
{
|
||||
return static_cast<double>(value);
|
||||
}
|
||||
|
|
@ -178,9 +178,9 @@ double getNumberFromXMLRPC(XmlRpc::XmlRpcValue& value)
|
|||
/**
|
||||
* @brief Helper function. Convert value to double array
|
||||
*/
|
||||
std::vector<double> getNumberVectorFromXMLRPC(XmlRpc::XmlRpcValue& value)
|
||||
std::vector<double> getNumberVectorFromXMLRPC(robot::XmlRpc::XmlRpcValue& value)
|
||||
{
|
||||
if (value.getType() != XmlRpc::XmlRpcValue::TypeArray)
|
||||
if (value.getType() != robot::XmlRpc::XmlRpcValue::TypeArray)
|
||||
{
|
||||
throw PolygonParseException("Subarray must have type list.");
|
||||
}
|
||||
|
|
@ -192,15 +192,15 @@ std::vector<double> getNumberVectorFromXMLRPC(XmlRpc::XmlRpcValue& value)
|
|||
return array;
|
||||
}
|
||||
|
||||
Polygon2D polygonFromXMLRPC(XmlRpc::XmlRpcValue& polygon_xmlrpc)
|
||||
Polygon2D polygonFromXMLRPC(robot::XmlRpc::XmlRpcValue& polygon_xmlrpc)
|
||||
{
|
||||
if (polygon_xmlrpc.getType() == XmlRpc::XmlRpcValue::TypeString &&
|
||||
if (polygon_xmlrpc.getType() == robot::XmlRpc::XmlRpcValue::TypeString &&
|
||||
polygon_xmlrpc != "" && polygon_xmlrpc != "[]")
|
||||
{
|
||||
return polygonFromString(std::string(polygon_xmlrpc));
|
||||
}
|
||||
|
||||
if (polygon_xmlrpc.getType() == XmlRpc::XmlRpcValue::TypeStruct)
|
||||
if (polygon_xmlrpc.getType() == robot::XmlRpc::XmlRpcValue::TypeStruct)
|
||||
{
|
||||
if (!polygon_xmlrpc.hasMember("x") || !polygon_xmlrpc.hasMember("y"))
|
||||
{
|
||||
|
|
@ -212,7 +212,7 @@ Polygon2D polygonFromXMLRPC(XmlRpc::XmlRpcValue& polygon_xmlrpc)
|
|||
}
|
||||
|
||||
// Make sure we have an array of at least 3 elements.
|
||||
if (polygon_xmlrpc.getType() != XmlRpc::XmlRpcValue::TypeArray)
|
||||
if (polygon_xmlrpc.getType() != robot::XmlRpc::XmlRpcValue::TypeArray)
|
||||
{
|
||||
std::stringstream err_ss;
|
||||
err_ss << "Polygon must be specified as a list of lists. Found object of type " << polygon_xmlrpc.getType()
|
||||
|
|
@ -229,8 +229,8 @@ Polygon2D polygonFromXMLRPC(XmlRpc::XmlRpcValue& polygon_xmlrpc)
|
|||
for (int i = 0; i < polygon_xmlrpc.size(); ++i)
|
||||
{
|
||||
// Make sure each element of the list is an array of size 2. (x and y coordinates)
|
||||
XmlRpc::XmlRpcValue& point_xml = polygon_xmlrpc[i];
|
||||
if (point_xml.getType() != XmlRpc::XmlRpcValue::TypeArray)
|
||||
robot::XmlRpc::XmlRpcValue& point_xml = polygon_xmlrpc[i];
|
||||
if (point_xml.getType() != robot::XmlRpc::XmlRpcValue::TypeArray)
|
||||
{
|
||||
std::stringstream err_ss;
|
||||
err_ss << "Each point must be specified as a list. Found object of type " << point_xml.getType() << " instead.";
|
||||
|
|
@ -274,9 +274,9 @@ Polygon2D polygonFromXMLRPC(XmlRpc::XmlRpcValue& polygon_xmlrpc)
|
|||
/**
|
||||
* @brief Helper method to convert a vector of doubles
|
||||
*/
|
||||
XmlRpc::XmlRpcValue vectorToXMLRPC(const std::vector<double>& array)
|
||||
robot::XmlRpc::XmlRpcValue vectorToXMLRPC(const std::vector<double>& array)
|
||||
{
|
||||
XmlRpc::XmlRpcValue xml;
|
||||
robot::XmlRpc::XmlRpcValue xml;
|
||||
xml.setSize(array.size());
|
||||
for (unsigned int i = 0; i < array.size(); ++i)
|
||||
{
|
||||
|
|
@ -285,9 +285,9 @@ XmlRpc::XmlRpcValue vectorToXMLRPC(const std::vector<double>& array)
|
|||
return xml;
|
||||
}
|
||||
|
||||
XmlRpc::XmlRpcValue polygonToXMLRPC(const robot_nav_2d_msgs::Polygon2D& polygon, bool array_of_arrays)
|
||||
robot::XmlRpc::XmlRpcValue polygonToXMLRPC(const robot_nav_2d_msgs::Polygon2D& polygon, bool array_of_arrays)
|
||||
{
|
||||
XmlRpc::XmlRpcValue xml;
|
||||
robot::XmlRpc::XmlRpcValue xml;
|
||||
if (array_of_arrays)
|
||||
{
|
||||
xml.setSize(polygon.points.size());
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit d8b17df5931a8726885ea89f055480f9bbc5e19a
|
||||
Subproject commit 5bdd606fffa7dcaa24448c112c4921778b24c9cd
|
||||
Loading…
Reference in New Issue
Block a user