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 heading, i in zip(['best trajectory', 'worst trajectory'], [msg.best_index, msg.worst_index]):
9  print '### {}\n'.format(heading)
10  print 'Name | Raw | Scale | Scaled Score'
11  print '---------------------|-----------|---------|-------------'
12  for s in msg.twists[i].scores:
13  print '{:20} | {:9.4f} | {:7.4f} | {:12.4f}'.format(s.name, s.raw_score, s.scale, s.raw_score * s.scale)
14  print '---------------------------------------- total: {:9.4f}'.format(msg.twists[i].total)
15  print
16 
17 
18 def main():
19  rospy.init_node('print_dwb_scores', anonymous=True)
20  rospy.Subscriber('move_base_node/DWBLocalPlanner/evaluation', LocalPlanEvaluation, eval_cb)
21  rospy.loginfo('print_dwb_scores ready.')
22  rospy.spin()
23 
24 
25 if __name__ == '__main__':
26  main()


mir_dwb_critics
Author(s): Martin Günther
autogenerated on Sun Feb 14 2021 03:40:12