Skip to content
Merged
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
6 changes: 6 additions & 0 deletions nav2_controller/src/controller_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,12 @@ void ControllerServer::publishZeroVelocity()
velocity.header.frame_id = costmap_ros_->getBaseFrameID();
velocity.header.stamp = now();
publishVelocity(velocity);

// Reset the state of the controllers after the task has ended
ControllerMap::iterator it;
for (it = controllers_.begin(); it != controllers_.end(); ++it) {
it->second->reset();
}
}

bool ControllerServer::isGoalReached()
Expand Down
5 changes: 5 additions & 0 deletions nav2_core/include/nav2_core/controller.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ class Controller
* or in absolute values in false case.
*/
virtual void setSpeedLimit(const double & speed_limit, const bool & percentage) = 0;

/**
* @brief Reset the state of the controller if necessary after task is exited
*/
virtual void reset() {}
};

} // namespace nav2_core
Expand Down