update to tf3
This commit is contained in:
@@ -35,20 +35,22 @@
|
||||
* Author: Eitan Marder-Eppstein
|
||||
* David V. Lu!!
|
||||
*********************************************************************/
|
||||
#ifndef COSTMAP_2D_COSTMAP_2D_ROS_H_
|
||||
#define COSTMAP_2D_COSTMAP_2D_ROS_H_
|
||||
#ifndef COSTMAP_2D_COSTMAP_2D_ROBOT_H_
|
||||
#define COSTMAP_2D_COSTMAP_2D_ROBOT_H_
|
||||
|
||||
#include <costmap_2d/layered_costmap.h>
|
||||
#include <costmap_2d/layer.h>
|
||||
#include <costmap_2d/costmap_2d_publisher.h>
|
||||
#include <costmap_2d/Costmap2DConfig.h>
|
||||
// #include <costmap_2d/costmap_2d_publisher.h>
|
||||
// #include <costmap_2d/Costmap2DConfig.h>
|
||||
#include <costmap_2d/footprint.h>
|
||||
#include <geometry_msgs/Polygon.h>
|
||||
#include <geometry_msgs/PolygonStamped.h>
|
||||
#include <geometry_msgs/PoseStamped.h>
|
||||
#include <dynamic_reconfigure/server.h>
|
||||
// #include <dynamic_reconfigure/server.h>
|
||||
// #include <pluginlib/class_loader.hpp>
|
||||
#include <tf2/LinearMath/Transform.h>
|
||||
#include <tf3/LinearMath/Transform.h>
|
||||
#include <robot/rate.h>
|
||||
#include <costmap_2d/data_convert.h>
|
||||
|
||||
// class SuperValue : public XmlRpc::XmlRpcValue
|
||||
// {
|
||||
@@ -71,7 +73,7 @@ namespace costmap_2d
|
||||
/** @brief A ROS wrapper for a 2D Costmap. Handles subscribing to
|
||||
* topics that provide observations about obstacles in either the form
|
||||
* of PointCloud or LaserScan messages. */
|
||||
class Costmap2DROS
|
||||
class Costmap2DROBOT
|
||||
{
|
||||
public:
|
||||
/**
|
||||
@@ -79,8 +81,8 @@ public:
|
||||
* @param name The name for this costmap
|
||||
* @param tf A reference to a TransformListener
|
||||
*/
|
||||
Costmap2DROS(const std::string &name, tf2_ros::Buffer& tf);
|
||||
~Costmap2DROS();
|
||||
Costmap2DROBOT(const std::string &name, tf3::BufferCore& tf);
|
||||
~Costmap2DROBOT();
|
||||
|
||||
/**
|
||||
* @brief Subscribes to sensor topics if necessary and starts costmap
|
||||
@@ -238,45 +240,48 @@ public:
|
||||
protected:
|
||||
LayeredCostmap* layered_costmap_;
|
||||
std::string name_;
|
||||
tf2_ros::Buffer& tf_; ///< @brief Used for transforming point clouds
|
||||
tf3::BufferCore& tf_; ///< @brief Used for transforming point clouds
|
||||
std::string global_frame_; ///< @brief The global frame for the costmap
|
||||
std::string robot_base_frame_; ///< @brief The frame_id of the robot base
|
||||
double transform_tolerance_; ///< timeout before transform errors
|
||||
|
||||
private:
|
||||
/** @brief Set the footprint from the new_config object.
|
||||
*
|
||||
* If the values of footprint and robot_radius are the same in
|
||||
* new_config and old_config, nothing is changed. */
|
||||
void readFootprintFromConfig(const costmap_2d::Costmap2DConfig &new_config,
|
||||
const costmap_2d::Costmap2DConfig &old_config);
|
||||
// /** @brief Set the footprint from the new_config object.
|
||||
// *
|
||||
// * If the values of footprint and robot_radius are the same in
|
||||
// * new_config and old_config, nothing is changed. */
|
||||
// void readFootprintFromConfig(const costmap_2d::Costmap2DConfig &new_config,
|
||||
// const costmap_2d::Costmap2DConfig &old_config);
|
||||
|
||||
void loadOldParameters(ros::NodeHandle& nh);
|
||||
void warnForOldParameters(ros::NodeHandle& nh);
|
||||
void checkOldParam(ros::NodeHandle& nh, const std::string ¶m_name);
|
||||
void copyParentParameters(const std::string& plugin_name, const std::string& plugin_type, ros::NodeHandle& nh);
|
||||
void reconfigureCB(costmap_2d::Costmap2DConfig &config, uint32_t level);
|
||||
void movementCB(const ros::TimerEvent &event);
|
||||
// void loadOldParameters(ros::NodeHandle& nh);
|
||||
// void warnForOldParameters(ros::NodeHandle& nh);
|
||||
// void checkOldParam(ros::NodeHandle& nh, const std::string ¶m_name);
|
||||
// void copyParentParameters(const std::string& plugin_name, const std::string& plugin_type, ros::NodeHandle& nh);
|
||||
// void reconfigureCB(costmap_2d::Costmap2DConfig &config, uint32_t level);
|
||||
// void movementCB(const ros::TimerEvent &event);
|
||||
void mapUpdateLoop(double frequency);
|
||||
bool map_update_thread_shutdown_;
|
||||
bool stop_updates_, initialized_, stopped_;
|
||||
boost::thread* map_update_thread_; ///< @brief A thread for updating the map
|
||||
ros::Time last_publish_;
|
||||
ros::Duration publish_cycle;
|
||||
pluginlib::ClassLoader<costmap_2d::Layer> plugin_loader_;
|
||||
Costmap2DPublisher* publisher_;
|
||||
dynamic_reconfigure::Server<costmap_2d::Costmap2DConfig> *dsrv_;
|
||||
robot::Time last_publish_;
|
||||
robot::Duration publish_cycle;
|
||||
// pluginlib::ClassLoader<costmap_2d::Layer> plugin_loader_;
|
||||
// Costmap2DPublisher* publisher_;
|
||||
// dynamic_reconfigure::Server<costmap_2d::Costmap2DConfig> *dsrv_;
|
||||
|
||||
boost::recursive_mutex configuration_mutex_;
|
||||
|
||||
ros::Subscriber footprint_sub_;
|
||||
ros::Publisher footprint_pub_;
|
||||
// ros::Subscriber footprint_sub_;
|
||||
// ros::Publisher footprint_pub_;
|
||||
std::vector<geometry_msgs::Point> unpadded_footprint_;
|
||||
std::vector<geometry_msgs::Point> padded_footprint_;
|
||||
float footprint_padding_;
|
||||
costmap_2d::Costmap2DConfig old_config_;
|
||||
// costmap_2d::Costmap2DConfig old_config_;
|
||||
|
||||
private:
|
||||
void getParams();
|
||||
};
|
||||
// class Costmap2DROS
|
||||
// class Costmap2DROBOT
|
||||
} // namespace costmap_2d
|
||||
|
||||
#endif // COSTMAP_2D_COSTMAP_2D_ROS_H
|
||||
#endif // COSTMAP_2D_COSTMAP_2D_ROBOT_H
|
||||
|
||||
Reference in New Issue
Block a user