44 void PreferForwardCritic::onInit()
46 critic_nh_.param(
"penalty", penalty_, 1.0);
47 critic_nh_.param(
"strafe_x", strafe_x_, 0.1);
48 critic_nh_.param(
"strafe_theta", strafe_theta_, 0.2);
49 critic_nh_.param(
"theta_scale", theta_scale_, 10.0);
52 double PreferForwardCritic::scoreTrajectory(
const dwb_msgs::Trajectory2D& traj)
55 if (traj.velocity.x < 0.0)
60 if (traj.velocity.x < strafe_x_ && fabs(traj.velocity.theta) < strafe_theta_)
66 return fabs(traj.velocity.theta) * theta_scale_;
Penalize trajectories with move backwards and/or turn too much.
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)