Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear acceleration on e-stop #149

Merged
merged 1 commit into from
Jul 24, 2023
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
2 changes: 2 additions & 0 deletions panther_driver/src/driver_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,8 @@ def _safety_timer_cb(self, *args) -> None:

def _e_stop_cb(self, data: Bool) -> None:
with self._lock:
if data.data:
self._velocity_smoother.reset()
self._e_stop_cliented = data.data

def _cmd_vel_cb(self, data: Twist) -> None:
Expand Down
5 changes: 5 additions & 0 deletions panther_driver/src/velocity_smoother.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ def get_smooth_velocity(
self._robot_vel_theta = output_vel.angular.z

return output_vel

def reset(self) -> None:
self._robot_vel_x = 0.0
self._robot_vel_y = 0.0
self._robot_vel_theta = 0.0

def _accel_limiter(
self, cmd_vel: float, robot_vel: float, acc_factor: float, decel_factor
Expand Down
Loading