gauge_script.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 
00003 # Launch rviz and other plugins in an rqt GUI framework
00004 
00005 import subprocess
00006 import rospkg
00007 import time
00008 
00009 # Clear the terminal
00010 subprocess.call("reset")
00011 
00012 # The main GUI window
00013 process = subprocess.Popen(['rqt', '--clear-config'])
00014 time.sleep(1) # Give the main window time to open
00015 
00016 ## A container to hold the gauges
00017 ## so they can be moved together
00018 #process = subprocess.Popen(['rqt', '--command-start-plugin', 'container'])
00019 #process.wait()
00020 
00021 # The first gauge
00022 process = subprocess.Popen(['rqt', '--command-start-plugin', 'rqt_gauges'])
00023 process.wait()
00024 
00025 # Parameters for the first gauge
00026 process = subprocess.Popen(['rosparam', 'set', '/rqt_gauges/topic1', '/pitch'])
00027 process = subprocess.Popen(['rosparam', 'set', '/rqt_gauges/gauge_name1', 'Pitch'])
00028 
00029 # Publish data for the first gauge
00030 process = subprocess.Popen(['rostopic', 'pub', '-r', '1', '/pitch', 'std_msgs/Float64', '13'])
00031 
00032 # The 2nd gauge
00033 process = subprocess.Popen(['rqt', '--command-start-plugin', 'rqt_gauges'])
00034 process.wait()
00035 
00036 # Parameters for the 2nd gauge
00037 process = subprocess.Popen(['rosparam', 'set', '/rqt_gauges/topic2', '/yaw'])
00038 process = subprocess.Popen(['rosparam', 'set', '/rqt_gauges/gauge_name2', 'Yaw'])
00039 
00040 # Publish data for the second gauge
00041 process = subprocess.Popen(['rostopic', 'pub', '-r', '1', '/yaw', 'std_msgs/Float64', '57'])


gauges
Author(s):
autogenerated on Thu Dec 8 2016 03:30:53