Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions nav2_behaviors/include/nav2_behaviors/plugins/spin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class Spin : public TimedBehavior<SpinAction>
double prev_yaw_;
double relative_yaw_;
double simulate_ahead_time_;
bool cmd_disable_collision_checks_;
rclcpp::Duration command_time_allowance_{0, 0};
rclcpp::Time end_time_;
};
Expand Down
6 changes: 5 additions & 1 deletion nav2_behaviors/plugins/spin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ Spin::Spin()
cmd_yaw_(0.0),
prev_yaw_(0.0),
relative_yaw_(0.0),
simulate_ahead_time_(0.0)
simulate_ahead_time_(0.0),
cmd_disable_collision_checks_(false)
{
}

Expand Down Expand Up @@ -82,6 +83,8 @@ Status Spin::onRun(const std::shared_ptr<const SpinAction::Goal> command)
return Status::FAILED;
}

cmd_disable_collision_checks_ = command->disable_collision_checks;

prev_yaw_ = tf2::getYaw(current_pose.pose.orientation);
relative_yaw_ = 0.0;

Expand Down Expand Up @@ -163,6 +166,7 @@ bool Spin::isCollisionFree(
geometry_msgs::msg::Pose2D & pose2d)
{
// Simulate ahead by simulate_ahead_time_ in cycle_frequency_ increments
if (cmd_disable_collision_checks_) return true;
int cycle_count = 0;
double sim_position_change;
const int max_cycle_count = static_cast<int>(cycle_frequency_ * simulate_ahead_time_);
Expand Down
1 change: 1 addition & 0 deletions nav2_msgs/action/Spin.action
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#goal definition
float32 target_yaw
builtin_interfaces/Duration time_allowance
bool disable_collision_checks
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cannot be backported. We cannot change message definitions unfortunately in released distributions. That breaks any and all existing users and MD5 hashes

---
#result definition
builtin_interfaces/Duration total_elapsed_time
Expand Down