56 global_costmap_(NULL), local_costmap_(NULL),
tf_(NULL), initialized_(false)
83 ROS_FATAL_STREAM (
"Didn't find twist parameters in " << private_nh.getNamespace());
88 private_nh.param(
"duration",
duration_, 1.0);
102 gm::Twist
scaleTwist (
const gm::Twist& twist,
const double scale)
105 t.linear.x = twist.linear.x * scale;
106 t.linear.y = twist.linear.y * scale;
107 t.angular.z = twist.angular.z * scale;
111 gm::Pose2D
forwardSimulate (
const gm::Pose2D& p,
const gm::Twist& twist,
const double t=1.0)
114 p2.x = p.x + twist.linear.x*
t;
115 p2.y = p.y + twist.linear.y*
t;
116 p2.theta = p.theta + twist.angular.z*
t;
124 return c < 0 ? 1e9 : c;
138 if (next_cost > cost) {
140 <<
" is " << next_cost <<
" which is greater than previous cost " << cost);
151 return sqrt(twist.linear.x*twist.linear.x + twist.linear.y*twist.linear.y);
156 return fabs(twist.angular.z);
166 const double acc_scaling =
max(linear_acc_scaling, angular_acc_scaling);
169 const double vel_scaling =
max(linear_vel_scaling, angular_vel_scaling);
179 pose.x = p.pose.position.x;
180 pose.y = p.pose.position.y;
double linear_acceleration_limit_
void runBehavior()
Run the behavior.
#define ROS_INFO_NAMED(name,...)
#define ROS_DEBUG_STREAM_NAMED(name, args)
geometry_msgs::Twist scaleGivenAccelerationLimits(const geometry_msgs::Twist &twist, const double time_remaining) const
#define ROS_INFO_STREAM_NAMED(name, args)
gm::Pose2D forwardSimulate(const gm::Pose2D &p, const gm::Twist &twist, const double t=1.0)
base_local_planner::CostmapModel * world_model_
geometry_msgs::TransformStamped t
double controller_frequency_
geometry_msgs::Twist base_frame_twist_
costmap_2d::Costmap2DROS * global_costmap_
void publish(const boost::shared_ptr< M > &message) const
double angularSpeed(const gm::Twist &twist)
double linearSpeed(const gm::Twist &twist)
#define ROS_FATAL_STREAM(args)
double angular_acceleration_limit_
TwistRecovery()
Doesn't do anything: initialize is where the actual work happens.
gm::Twist scaleTwist(const gm::Twist &twist, const double scale)
bool getRobotPose(geometry_msgs::PoseStamped &global_pose) const
double normalizedPoseCost(const geometry_msgs::Pose2D &pose) const
Return the cost of a pose, modified so that -1 does not equal infinity; instead 1e9 does...
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
INLINE Rall1d< T, V, S > sqrt(const Rall1d< T, V, S > &arg)
double nonincreasingCostInterval(const geometry_msgs::Pose2D ¤t, const geometry_msgs::Twist &twist) const
double getYaw(const A &a)
double linear_speed_limit_
costmap_2d::Costmap2DROS * local_costmap_
virtual double footprintCost(const geometry_msgs::Point &position, const std::vector< geometry_msgs::Point > &footprint, double inscribed_radius, double circumscribed_radius)
double angular_speed_limit_
ROSCPP_DECL void shutdown()
std::vector< geometry_msgs::Point > getRobotFootprint()
double max(double a, double b)
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
void initialize(std::string n, tf2_ros::Buffer *tf, costmap_2d::Costmap2DROS *global_costmap, costmap_2d::Costmap2DROS *local_costmap)
Initialize the parameters of the behavior.
geometry_msgs::Pose2D getCurrentLocalPose() const