4 from nav_msgs.msg
import Odometry
13 global lin_min, lin_max, ang_min, ang_max
14 if lin_min > msg.twist.twist.linear.x:
15 lin_min = msg.twist.twist.linear.x
16 if lin_max < msg.twist.twist.linear.x:
17 lin_max = msg.twist.twist.linear.x
18 if ang_min > msg.twist.twist.angular.z:
19 ang_min = msg.twist.twist.angular.z
20 if ang_max < msg.twist.twist.angular.z:
21 ang_max = msg.twist.twist.angular.z
23 rospy.loginfo(
'linear: [%f, %f] angular: [%f, %f]', lin_min, lin_max,
28 rospy.init_node(
'min_max_finder', anonymous=
True)
29 rospy.Subscriber(
'odom_comb', Odometry, odom_cb)
30 rospy.loginfo(
'min_max_finde node ready and listening. now use teleop to move your robot to the limits!')
34 if __name__ ==
'__main__':