2 import roslib; roslib.load_manifest(
'acc_finder')
5 from geometry_msgs.msg
import Twist
6 from nav_msgs.msg
import Odometry
14 global lin_min, lin_max, ang_min, ang_max
15 if lin_min > msg.twist.twist.linear.x:
16 lin_min = msg.twist.twist.linear.x
17 if lin_max < msg.twist.twist.linear.x:
18 lin_max = msg.twist.twist.linear.x
19 if ang_min > msg.twist.twist.angular.z:
20 ang_min = msg.twist.twist.angular.z
21 if ang_max < msg.twist.twist.angular.z:
22 ang_max = msg.twist.twist.angular.z
24 rospy.loginfo(
'linear: [%f, %f] angular: [%f, %f]', lin_min, lin_max,
28 rospy.init_node(
'acc_finder', anonymous=
True)
29 rospy.Subscriber(
'odom', Odometry, odom_cb)
30 rospy.loginfo(
'min_max_finde node ready and listening. now use teleop to move your robot to the limits!')
33 if __name__ ==
'__main__':