+6
-1
lines changedFilter options
+6
-1
lines changed Original file line number Diff line number Diff line change
@@ -324,7 +324,12 @@ def forward_kinematics(self):
324
324
drive_angular_velocity = (self.curr_velocities['drive_left_middle'] + self.curr_velocities['drive_right_middle']) / 2.
325
325
self.curr_twist.twist.linear.x = drive_angular_velocity * self.wheel_radius
326
326
# now calculate angular velocity from its relation with linear velocity and turning radius
327
-
self.curr_twist.twist.angular.z = self.curr_twist.twist.linear.x / self.curr_turning_radius
327
+
try:
328
+
self.curr_twist.twist.angular.z = self.curr_twist.twist.linear.x / self.curr_turning_radius
329
+
except ZeroDivisionError:
330
+
rospy.logwarn_throttle(1, "Current turning radius was calculated as zero which"
331
+
"is an illegal value. Check your wheel calibration."
332
+
self.curr_twist.twist.angular.z = 0. # turning in place is currently unsupported
328
333
329
334
330
335
if __name__ == '__main__':
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4