min_max_finder.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 import rospy
3 
4 from nav_msgs.msg import Odometry
5 
6 lin_min = 0.0
7 lin_max = 0.0
8 ang_min = 0.0
9 ang_max = 0.0
10 
11 
12 def odom_cb(msg):
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
22 
23  rospy.loginfo('linear: [%f, %f] angular: [%f, %f]', lin_min, lin_max,
24  ang_min, ang_max)
25 
26 
27 def main():
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!')
31  rospy.spin()
32 
33 
34 if __name__ == '__main__':
35  main()
def odom_cb(msg)


mir_navigation
Author(s): Martin Günther
autogenerated on Wed May 8 2019 02:39:00