46 const std::string name,
50 const TFPtr &tf_listener_ptr,
52 const MoveBaseFlexConfig &config,
53 boost::function<
void()> setup_fn,
54 boost::function<
void()> cleanup_fn)
55 : AbstractControllerExecution(name, controller_ptr, vel_pub, goal_pub, tf_listener_ptr,
56 toAbstract(config), setup_fn, cleanup_fn),
57 costmap_ptr_(costmap_ptr)
70 mbf_abstract_nav::MoveBaseFlexConfig abstract_config;
71 abstract_config.controller_frequency = config.controller_frequency;
72 abstract_config.controller_patience = config.controller_patience;
73 abstract_config.controller_max_retries = config.controller_max_retries;
74 abstract_config.oscillation_timeout = config.oscillation_timeout;
75 abstract_config.oscillation_distance = config.oscillation_distance;
76 return abstract_config;
80 const geometry_msgs::PoseStamped& robot_pose,
81 const geometry_msgs::TwistStamped& robot_velocity,
82 geometry_msgs::TwistStamped& vel_cmd,
88 boost::lock_guard<costmap_2d::Costmap2D::mutex_t> lock(*(
costmap_ptr_->getCostmap()->getMutex()));
89 return controller_->computeVelocityCommands(robot_pose, robot_velocity, vel_cmd, message);
91 return controller_->computeVelocityCommands(robot_pose, robot_velocity, vel_cmd, message);
mbf_abstract_nav::MoveBaseFlexConfig toAbstract(const MoveBaseFlexConfig &config)
virtual ~CostmapControllerExecution()
Destructor.
CostmapPtr & costmap_ptr_
costmap for 2d navigation planning
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
mbf_abstract_core::AbstractController::Ptr controller_
bool lock_costmap_
Whether to lock costmap before calling the controller (see issue #4 for details)
CostmapControllerExecution(const std::string name, const mbf_costmap_core::CostmapController::Ptr &controller_ptr, const ros::Publisher &vel_pub, const ros::Publisher &goal_pub, const TFPtr &tf_listener_ptr, CostmapPtr &costmap_ptr, const MoveBaseFlexConfig &config, boost::function< void()> setup_fn, boost::function< void()> cleanup_fn)
Constructor.
virtual uint32_t computeVelocityCmd(const geometry_msgs::PoseStamped &robot_pose, const geometry_msgs::TwistStamped &robot_velocity, geometry_msgs::TwistStamped &vel_cmd, std::string &message)
Request plugin for a new velocity command. We override this method so we can lock the local costmap b...