Skip to content

Commit

Permalink
Merge pull request SharedAutonomyToolkit#1 from furushchev/allow-back
Browse files Browse the repository at this point in the history
add param to plan safe trajectory on backwards
  • Loading branch information
furushchev authored Nov 26, 2019
2 parents 03afa1f + 5a196ff commit 10f60fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ typedef tf::TransformListener TFListener;

boost::recursive_mutex odom_lock_;
double max_vel_th_, min_vel_th_;
bool safe_backwards_;
};

}
Expand Down
4 changes: 3 additions & 1 deletion safe_teleop_base/src/safe_trajectory_planner_ros.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ namespace safe_teleop {
private_nh.param("world_model", world_model_type, string("costmap"));
private_nh.param("holonomic_robot", holonomic_robot, true);
private_nh.param("dwa", dwa, true);
private_nh.param("safe_backwards", safe_backwards_, false);

//parameters for using the freespace controller
double min_pt_separation, max_obstacle_height, grid_resolution;
Expand Down Expand Up @@ -159,7 +160,8 @@ namespace safe_teleop {
}

void SafeTrajectoryPlannerROS::cmdCallback(const geometry_msgs::Twist::ConstPtr& vel) {
if ((vel->linear.x > 0) || (fabs(vel->linear.y) > 0)) {
if ((safe_backwards_ && ((fabs(vel->linear.x) > 0) || (fabs(vel->linear.y) > 0))) ||
(!safe_backwards_ && ((vel->linear.x > 0) || (fabs(vel->linear.y) > 0))))
geometry_msgs::Twist safe_vel;
if (computeVelocityCommands(vel, safe_vel)) {
cmd_pub_.publish(safe_vel);
Expand Down

0 comments on commit 10f60fa

Please sign in to comment.