Go to the documentation of this file.00001
00002 import rospy
00003
00004 from dwb_msgs.msg import LocalPlanEvaluation
00005
00006 def eval_cb(msg):
00007 print '\n\n=====================================================\n\n'
00008 for i in [msg.best_index, msg.worst_index]:
00009 print 'Name | Raw | Scale | Scaled Score'
00010 print '---------------------|--------|--------|-------------'
00011 for s in msg.twists[i].scores:
00012 print '{:20} | {:6.2f} | {:6.2f} | {:12.2f}'.format(s.name, s.raw_score, s.scale, s.raw_score * s.scale)
00013 print '--------------------------------------- total: {:6.2f}'.format(msg.twists[i].total)
00014 print
00015
00016
00017 def main():
00018 rospy.init_node('print_dwb_scores', anonymous=True)
00019 rospy.Subscriber('move_base_node/DWBLocalPlanner/evaluation', LocalPlanEvaluation, eval_cb)
00020 rospy.loginfo('print_dwb_scores ready.')
00021 rospy.spin()
00022
00023
00024 if __name__ == '__main__':
00025 main()