oem7_bist.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 
25 
26 
27 import unittest
28 import rospy
29 import os, sys
30 
31 import oem7_message_test
32 
33 PKG = 'novatel_oem7_driver'
34 NAME = 'oem7_bist'
35 
36 class Oem7BIST(unittest.TestCase):
37  """
38  Built-in Self-Test. Runs in parallel with a 'live' driver, supports correct recording of topics;
39  and analyzes message rates.
40  """
41  def __init__(self, *args):
42  super(self.__class__, self).__init__(*args)
43  rospy.init_node(NAME)
44 
45 
46  def test_1_recording(self):
47  """
48  Removes stale test .bag; delays execution of analysis until current recording is complete.
49  """
50  if os.path.exists(self.bist_bag):
51  os.remove(self.bist_bag)
52 
53  delay_sec = float(rospy.get_param('~duration', 60.))
54  print("Sleeping for {0} sec to allow topics to be recorded...".format(delay_sec))
55  rospy.sleep(delay_sec)
56  print("..done")
57 
58  def test_2_analysis(self):
59  """
60  Analyzes message rates.
61  """
62  oem7_message_test.analyze_hz(self.bist_bag, output_csv = False)
63  # Set output_csv = True to dump topic statistics to .csv file.
64 
65 
66 if __name__ == '__main__':
67 
68  Oem7BIST.bist_bag = sys.argv[1]
69 
70  import rostest
71  rostest.run(PKG, NAME, Oem7BIST, sys.argv)
72 
oem7_bist.Oem7BIST.test_1_recording
def test_1_recording(self)
Definition: oem7_bist.py:46
oem7_bist.Oem7BIST.test_2_analysis
def test_2_analysis(self)
Definition: oem7_bist.py:58
oem7_bist.Oem7BIST.__init__
def __init__(self, *args)
Definition: oem7_bist.py:41
oem7_bist.Oem7BIST
Definition: oem7_bist.py:36
oem7_message_test.analyze_hz
def analyze_hz(bag_name, output_csv)
Definition: oem7_message_test.py:137


novatel_oem7_driver
Author(s):
autogenerated on Sat Feb 3 2024 03:51:34