|
@@ -4,7 +4,7 @@
|
|
'''
|
|
'''
|
|
Author: adam_zhuo
|
|
Author: adam_zhuo
|
|
Date: 2020-09-14 13:56:07
|
|
Date: 2020-09-14 13:56:07
|
|
-LastEditTime: 2020-09-18 15:56:16
|
|
|
|
|
|
+LastEditTime: 2020-09-18 18:01:10
|
|
LastEditors: Please set LastEditors
|
|
LastEditors: Please set LastEditors
|
|
Description: laser_follow
|
|
Description: laser_follow
|
|
FilePath: /blackTornadoRobot/src/robot_follower/scripts/follower.py
|
|
FilePath: /blackTornadoRobot/src/robot_follower/scripts/follower.py
|
|
@@ -60,6 +60,10 @@ class Follower:
|
|
distance = position.distance
|
|
distance = position.distance
|
|
|
|
|
|
rospy.logwarn('Angle: {}, Distance: {}, '.format(angleX, distance))
|
|
rospy.logwarn('Angle: {}, Distance: {}, '.format(angleX, distance))
|
|
|
|
+
|
|
|
|
+ if distance >= 2:
|
|
|
|
+ self.stopMoving()
|
|
|
|
+ return
|
|
|
|
|
|
# call the PID controller to update it and get new speeds
|
|
# call the PID controller to update it and get new speeds
|
|
[uncliped_ang_speed, uncliped_lin_speed] = self.PID_controller.update([angleX, distance])
|
|
[uncliped_ang_speed, uncliped_lin_speed] = self.PID_controller.update([angleX, distance])
|