Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
doc:marker_visualization:datavisclient [2014/02/21 10:47] – style stefes | doc:marker_visualization:datavisclient [2014/02/25 09:33] (current) – removed admin | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Data Visualization Client ===== | ||
- | The Data Visualization Client listens to a given ros topic for data_vis_msgs and displays them as a chart. Currently donut charts and bar charts are supported. | ||
- | |||
- | === Example === | ||
- | This simple web site subscribes to the topic ' | ||
- | <code html> | ||
- | < | ||
- | < | ||
- | <meta charset=" | ||
- | |||
- | <script type=" | ||
- | <script type=" | ||
- | <script type=" | ||
- | <script type=" | ||
- | <script type=" | ||
- | <script type=" | ||
- | <script src=" | ||
- | |||
- | <script type=" | ||
- | function init() { | ||
- | |||
- | var ros = new ROSLIB.Ros({ | ||
- | url : ' | ||
- | }); | ||
- | |||
- | var options = { | ||
- | ros: ros, | ||
- | containerId: | ||
- | topic: ' | ||
- | }; | ||
- | var dataVisClient = new DataVisClient(options); | ||
- | } | ||
- | </ | ||
- | </ | ||
- | < | ||
- | </ | ||
- | |||
- | <body onload=" | ||
- | |||
- | <div id=" | ||
- | < | ||
- | <div id=" | ||
- | |||
- | </ | ||
- | </ | ||
- | </ | ||
- | </ | ||
- | Make sure DonutChart.js, | ||
- | $ roslaunch knowrob_vis knowrob_vis.launch | ||
- | on your localhost. Messages can now be published to the same topic like this: | ||
- | $ rostopic pub / | ||
- | { | ||
- | id: " | ||
- | type: 0, | ||
- | title: "some title", | ||
- | xlabel: " | ||
- | ylabel: " | ||
- | values: [{ | ||
- | value1: [" | ||
- | value2: [" | ||
- | }] | ||
- | } | ||
- | ' | ||
- | Type 0 means donut chart, type 1 bar chart. To update data in an already existing diagram simply publish the message again with the same id and new data in value1 and value2. The chart will update immediately. | ||
- | |||
- | To remove a chart, publish a message with its id and an empty array for value2. | ||
- | |||
- | By now, only the first element of the ' | ||