diff --git a/src/roboticstoolbox/mobile/drivers.py b/src/roboticstoolbox/mobile/drivers.py index c4251d61..2f2e321f 100644 --- a/src/roboticstoolbox/mobile/drivers.py +++ b/src/roboticstoolbox/mobile/drivers.py @@ -147,10 +147,11 @@ def driveto(self, goal): goal_heading = atan2(goal[1] - self._veh._x[1], goal[0] - self._veh._x[0]) delta_heading = base.angdiff(goal_heading, self._veh._x[2]) - print( - f"t={self._veh._t:.1f}, pos=({self._veh._x[0]:.1f}, {self._veh._x[1]:.1f}), ", - f"goal_heading={goal_heading * 180 / pi:.1f}, delta_heading={delta_heading * 180 / pi:.1f}", - ) + if self._veh.verbose or self._verbose: + print( + f"t={self._veh._t:.1f}, pos=({self._veh._x[0]:.1f}, {self._veh._x[1]:.1f}), ", + f"goal_heading={goal_heading * 180 / pi:.1f}, delta_heading={delta_heading * 180 / pi:.1f}", + ) return np.r_[self._speed, self._headinggain * delta_heading]