print_dwb_scores.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 import rospy
3 
4 from dwb_msgs.msg import LocalPlanEvaluation
5 
6 def eval_cb(msg):
7  print '\n\n=====================================================\n\n'
8  for i in [msg.best_index, msg.worst_index]:
9  print 'Name | Raw | Scale | Scaled Score'
10  print '---------------------|--------|--------|-------------'
11  for s in msg.twists[i].scores:
12  print '{:20} | {:6.2f} | {:6.2f} | {:12.2f}'.format(s.name, s.raw_score, s.scale, s.raw_score * s.scale)
13  print '--------------------------------------- total: {:6.2f}'.format(msg.twists[i].total)
14  print
15 
16 
17 def main():
18  rospy.init_node('print_dwb_scores', anonymous=True)
19  rospy.Subscriber('move_base_node/DWBLocalPlanner/evaluation', LocalPlanEvaluation, eval_cb)
20  rospy.loginfo('print_dwb_scores ready.')
21  rospy.spin()
22 
23 
24 if __name__ == '__main__':
25  main()


mir_dwb_critics
Author(s): Martin Günther
autogenerated on Wed May 8 2019 02:38:50