Hiep sua file
This commit is contained in:
parent
a28f05c6d5
commit
ed54b7b8db
|
|
@ -55,18 +55,18 @@
|
||||||
|
|
||||||
#include <robot/node_handle.h>
|
#include <robot/node_handle.h>
|
||||||
#include <robot/plugin_loader_helper.h>
|
#include <robot/plugin_loader_helper.h>
|
||||||
class SuperValue : public XmlRpc::XmlRpcValue
|
class SuperValue : public robot::XmlRpc::XmlRpcValue
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void setStruct(XmlRpc::XmlRpcValue::ValueStruct* a)
|
void setStruct(robot::XmlRpc::XmlRpcValue::ValueStruct* a)
|
||||||
{
|
{
|
||||||
_type = TypeStruct;
|
_type = TypeStruct;
|
||||||
_value.asStruct = new XmlRpc::XmlRpcValue::ValueStruct(*a);
|
_value.asStruct = new robot::XmlRpc::XmlRpcValue::ValueStruct(*a);
|
||||||
}
|
}
|
||||||
void setArray(XmlRpc::XmlRpcValue::ValueArray* a)
|
void setArray(robot::XmlRpc::XmlRpcValue::ValueArray* a)
|
||||||
{
|
{
|
||||||
_type = TypeArray;
|
_type = TypeArray;
|
||||||
_value.asArray = new std::vector<XmlRpc::XmlRpcValue>(*a);
|
_value.asArray = new std::vector<robot::XmlRpc::XmlRpcValue>(*a);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -136,7 +136,7 @@ std::vector<geometry_msgs::Point> makeFootprintFromParams(robot::NodeHandle& nh)
|
||||||
* @param full_param_name this is the full name of the rosparam from
|
* @param full_param_name this is the full name of the rosparam from
|
||||||
* which the footprint_xmlrpc value came. It is used only for
|
* which the footprint_xmlrpc value came. It is used only for
|
||||||
* reporting errors. */
|
* reporting errors. */
|
||||||
std::vector<geometry_msgs::Point> makeFootprintFromXMLRPC(XmlRpc::XmlRpcValue& footprint_xmlrpc,
|
std::vector<geometry_msgs::Point> makeFootprintFromXMLRPC(robot::XmlRpc::XmlRpcValue& footprint_xmlrpc,
|
||||||
const std::string& full_param_name);
|
const std::string& full_param_name);
|
||||||
|
|
||||||
// /** @brief Write the current unpadded_footprint_ to the "footprint"
|
// /** @brief Write the current unpadded_footprint_ to the "footprint"
|
||||||
|
|
|
||||||
26
package.xml
Normal file
26
package.xml
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
<package>
|
||||||
|
<name>costmap_2d</name>
|
||||||
|
<version>0.7.10</version>
|
||||||
|
<description>
|
||||||
|
tf3 is the second generation of the transform library, which lets
|
||||||
|
the user keep track of multiple coordinate frames over time. tf3
|
||||||
|
maintains the relationship between coordinate frames in a tree
|
||||||
|
structure buffered in time, and lets the user transform points,
|
||||||
|
vectors, etc between any two coordinate frames at any desired
|
||||||
|
point in time.
|
||||||
|
</description>
|
||||||
|
<author>Tully Foote</author>
|
||||||
|
<author>Eitan Marder-Eppstein</author>
|
||||||
|
<author>Wim Meeussen</author>
|
||||||
|
<maintainer email="tfoote@osrfoundation.org">Tully Foote</maintainer>
|
||||||
|
<license>BSD</license>
|
||||||
|
|
||||||
|
<url type="website">http://www.ros.org/wiki/tf3</url>
|
||||||
|
|
||||||
|
<buildtool_depend version_gte="0.5.68">catkin</buildtool_depend>
|
||||||
|
|
||||||
|
<build_depend>libconsole-bridge-dev</build_depend>
|
||||||
|
|
||||||
|
<run_depend>libconsole-bridge-dev</run_depend>
|
||||||
|
|
||||||
|
</package>
|
||||||
|
|
@ -249,25 +249,25 @@ std::vector<geometry_msgs::Point> makeFootprintFromParams(robot::NodeHandle& nh)
|
||||||
// nh.setParam("footprint", oss.str().c_str());
|
// nh.setParam("footprint", oss.str().c_str());
|
||||||
// }
|
// }
|
||||||
|
|
||||||
double getNumberFromXMLRPC(XmlRpc::XmlRpcValue& value, const std::string& full_param_name)
|
double getNumberFromXMLRPC(robot::XmlRpc::XmlRpcValue& value, const std::string& full_param_name)
|
||||||
{
|
{
|
||||||
// Make sure that the value we're looking at is either a double or an int.
|
// Make sure that the value we're looking at is either a double or an int.
|
||||||
if (value.getType() != XmlRpc::XmlRpcValue::TypeInt &&
|
if (value.getType() != robot::XmlRpc::XmlRpcValue::TypeInt &&
|
||||||
value.getType() != XmlRpc::XmlRpcValue::TypeDouble)
|
value.getType() != robot::XmlRpc::XmlRpcValue::TypeDouble)
|
||||||
{
|
{
|
||||||
std::string& value_string = value;
|
std::string& value_string = value;
|
||||||
printf("Values in the footprint specification (param %s) must be numbers. Found value %s.\n",
|
printf("Values in the footprint specification (param %s) must be numbers. Found value %s.\n",
|
||||||
full_param_name.c_str(), value_string.c_str());
|
full_param_name.c_str(), value_string.c_str());
|
||||||
throw std::runtime_error("Values in the footprint specification must be numbers");
|
throw std::runtime_error("Values in the footprint specification must be numbers");
|
||||||
}
|
}
|
||||||
return value.getType() == XmlRpc::XmlRpcValue::TypeInt ? (int)(value) : (double)(value);
|
return value.getType() == robot::XmlRpc::XmlRpcValue::TypeInt ? (int)(value) : (double)(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<geometry_msgs::Point> makeFootprintFromXMLRPC(XmlRpc::XmlRpcValue& footprint_xmlrpc,
|
std::vector<geometry_msgs::Point> makeFootprintFromXMLRPC(robot::XmlRpc::XmlRpcValue& footprint_xmlrpc,
|
||||||
const std::string& full_param_name)
|
const std::string& full_param_name)
|
||||||
{
|
{
|
||||||
// Make sure we have an array of at least 3 elements.
|
// Make sure we have an array of at least 3 elements.
|
||||||
if (footprint_xmlrpc.getType() != XmlRpc::XmlRpcValue::TypeArray ||
|
if (footprint_xmlrpc.getType() != robot::XmlRpc::XmlRpcValue::TypeArray ||
|
||||||
footprint_xmlrpc.size() < 3)
|
footprint_xmlrpc.size() < 3)
|
||||||
{
|
{
|
||||||
printf("The footprint must be specified as list of lists on the parameter server, %s was specified as %s\n",
|
printf("The footprint must be specified as list of lists on the parameter server, %s was specified as %s\n",
|
||||||
|
|
@ -282,8 +282,8 @@ std::vector<geometry_msgs::Point> makeFootprintFromXMLRPC(XmlRpc::XmlRpcValue& f
|
||||||
for (int i = 0; i < footprint_xmlrpc.size(); ++i)
|
for (int i = 0; i < footprint_xmlrpc.size(); ++i)
|
||||||
{
|
{
|
||||||
// Make sure each element of the list is an array of size 2. (x and y coordinates)
|
// Make sure each element of the list is an array of size 2. (x and y coordinates)
|
||||||
XmlRpc::XmlRpcValue point = footprint_xmlrpc[ i ];
|
robot::XmlRpc::XmlRpcValue point = footprint_xmlrpc[ i ];
|
||||||
if (point.getType() != XmlRpc::XmlRpcValue::TypeArray ||
|
if (point.getType() != robot::XmlRpc::XmlRpcValue::TypeArray ||
|
||||||
point.size() != 2)
|
point.size() != 2)
|
||||||
{
|
{
|
||||||
printf("The footprint (parameter %s) must be specified as list of lists on the parameter server eg: "
|
printf("The footprint (parameter %s) must be specified as list of lists on the parameter server eg: "
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user