8 #include "../../include/cost_map_demos/from_ros_costmaps.hpp" 34 const std::string& base_link_transform_name,
39 : transform_listener(
ros::Duration(1.0))
47 private_node_handle.
setParam(name +
"/robot_base_frame", base_link_transform_name);
48 private_node_handle.
setParam(name +
"/origin_x", origin.x());
49 private_node_handle.
setParam(name +
"/origin_y", origin.y());
50 private_node_handle.
setParam(name +
"/width", width);
51 private_node_handle.
setParam(name +
"/height", height);
52 private_node_handle.
setParam(name +
"/plugins", std::vector<std::string>());
53 private_node_handle.
setParam(name +
"/resolution", 0.5);
54 private_node_handle.
setParam(name +
"/robot_radius", 0.03);
57 for (
unsigned int index = 0; index <
costmap->getCostmap()->getSizeInCellsY(); ++index ) {
58 unsigned int dimension =
costmap->getCostmap()->getSizeInCellsX();
61 for (
unsigned int fill_index = 0; fill_index < dimension - 2; ++fill_index )
63 double fraction =
static_cast<double>(fill_index + 1) / static_cast<double>(
costmap->getCostmap()->getSizeInCellsX());
ROSCostmapServer(const std::string &name, const std::string &base_link_transform_name, const cost_map::Position &origin, const double &width, const double &height)
static const unsigned char INSCRIBED_INFLATED_OBSTACLE
static const unsigned char LETHAL_OBSTACLE
static const unsigned char NO_INFORMATION
grid_map::Position Position
void broadcastCostmap2DROSTestSuiteTransforms(TransformBroadcaster &broadcaster)
tf::TransformListener transform_listener
void setParam(const std::string &key, const XmlRpc::XmlRpcValue &v) const