gauge_script.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 # Launch rviz and other plugins in an rqt GUI framework
4 
5 import subprocess
6 import rospkg
7 import time
8 
9 # Clear the terminal
10 subprocess.call("reset")
11 
12 # The main GUI window
13 process = subprocess.Popen(['rqt', '--clear-config'])
14 time.sleep(1) # Give the main window time to open
15 
16 ## A container to hold the gauges
17 ## so they can be moved together
18 #process = subprocess.Popen(['rqt', '--command-start-plugin', 'container'])
19 #process.wait()
20 
21 # The first gauge
22 process = subprocess.Popen(['rqt', '--command-start-plugin', 'rqt_gauges'])
23 process.wait()
24 
25 # Parameters for the first gauge
26 process = subprocess.Popen(['rosparam', 'set', '/rqt_gauges/topic1', '/pitch'])
27 process = subprocess.Popen(['rosparam', 'set', '/rqt_gauges/gauge_name1', 'Pitch'])
28 
29 # Publish data for the first gauge
30 process = subprocess.Popen(['rostopic', 'pub', '-r', '1', '/pitch', 'std_msgs/Float64', '13'])
31 
32 # The 2nd gauge
33 process = subprocess.Popen(['rqt', '--command-start-plugin', 'rqt_gauges'])
34 process.wait()
35 
36 # Parameters for the 2nd gauge
37 process = subprocess.Popen(['rosparam', 'set', '/rqt_gauges/topic2', '/yaw'])
38 process = subprocess.Popen(['rosparam', 'set', '/rqt_gauges/gauge_name2', 'Yaw'])
39 
40 # Publish data for the second gauge
41 process = subprocess.Popen(['rostopic', 'pub', '-r', '1', '/yaw', 'std_msgs/Float64', '57'])


gauges
Author(s):
autogenerated on Sat Apr 11 2020 03:54:59