Flexbot visualizer

From Rsewiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "Back to Flexbot main page =Introduction= The Flexbot Visualizer have been created as a tool for everyone using and working on Flexbot. The GUI will allow users to connect...")
 
 
(2 intermediate revisions by one user not shown)
Line 2: Line 2:
  
 
=Introduction=
 
=Introduction=
The Flexbot Visualizer have been created as a tool for everyone using and working on Flexbot. The GUI will allow users to connect wirelessly to Flexbot with the ultimate purpose of receiving and sending messages  in real time. The GUI also features very basic element that allows the user excite all actuators (as a controller) in real time. This is meant for testing purposes only and not as a gamepad for driving Flexbot around. (although that sounds quite fun!)
+
The Flexbot Visualizer have been created as a tool for everyone using and working on Flexbot. The GUI will allow users to connect wirelessly to Flexbot with the ultimate purpose of receiving and sending messages  in real time. The GUI also features a very basic control interface that allows the user excite all actuators in real time. This is meant for testing purposes only and not as a gamepad for driving Flexbot around. (although that sounds quite fun!)
  
 
=Dependencies=
 
=Dependencies=
Line 19: Line 19:
 
which should be found under /code/GUI/flexbot_visualizer. This should open up the project including all project files.
 
which should be found under /code/GUI/flexbot_visualizer. This should open up the project including all project files.
  
Run the application by pushing the green "play"-button or by pressing '''Ctrl+r'''. This build and run should the application ultimately opening window as shown below
+
Run the application by pushing the green "play"-button or by pressing '''Ctrl+r'''. This builds and runs the application ultimately opening window as shown below
 
[[File:Gui1.PNG]]
 
[[File:Gui1.PNG]]
  
Line 28: Line 28:
 
  ssid: NUC
 
  ssid: NUC
 
  pw: grenen89
 
  pw: grenen89
If the Python script somehow isn't running automatically (it should), SSH into the NUC, go to ~/flexbot/code/MAVLink/Bridge and start the script by typing
+
 
  python FlexbotBridge.py
+
To start the Python bridge, ssh into the NUC by opening a terminal and type
 +
ssh local@10.42.0.1
 +
with password '''grenen'''. Change folder to
 +
~/flexbot/code/MAVLink/Bridge
 +
and start the script by typing
 +
  python FlexbotBridge.py --dev /dev/ttyACM0
 +
where ''/dev/ttyACM0'' corresponds to serial device. It tends to change, so if it fails to launch, try changing it to ''/dev/ttyACM1''. '''Make sure ethernet is disconnected at this point. Otherwise it will not work!!'''
 +
 
  
 
When the bridge is running, and the client laptop/PC is connected to the NUC-network, press the connect button on the GUI.
 
When the bridge is running, and the client laptop/PC is connected to the NUC-network, press the connect button on the GUI.
This will bind to the multicast IP and port that Flexbot broadcasts to as well as it will the ''flexbot.xml'' message definitions file and initialize all available signals. Not that the ''flexbot.xml'' file should be located in the same folder as the flexbot_visualizer but if it isn't found, the GUI will automatically warn the user about this and open a file browser that will let the user locate the file themself.
+
This will bind to the multicast IP and port that Flexbot broadcasts to as well as it will read the ''flexbot.xml'' message definitions file and initialize all available signals. Note that the ''flexbot.xml'' file should be located in the same folder as the flexbot_visualizer but if it isn't found, the GUI will automatically warn the user about this and open a file browser that will let the user locate the file themself.
  
 
To verify that connection is established, the heartbeat should pulse once a second or so.  
 
To verify that connection is established, the heartbeat should pulse once a second or so.  
Line 45: Line 52:
 
==Real-Time Data Visualization==
 
==Real-Time Data Visualization==
  
After a message have been subscribed to go back to the ''Plot'' tab. Here it is possible to generate up to four plots at once, each capable of plotting three messages at a time. An example of this is shown below
+
After a message have been subscribed to, go back to the ''Plot'' tab. Here it is possible to generate up to four plots at once, each capable of plotting three messages at a time. An example of this is shown below
 
[[File:Gui3.PNG]]
 
[[File:Gui3.PNG]]
  
Line 52: Line 59:
 
==Basic Control Interface==
 
==Basic Control Interface==
  
The third tab ''Controls'' serves as very simple control interface to Flexbot. At the time writing is looks something like shown below
+
The third tab, ''Controls'', serves as a very simple control interface to Flexbot. At the time of writing it looks something like shown below
 
[[File:Gui4.PNG]]
 
[[File:Gui4.PNG]]
  
From here each actuator of the currently build robot leg can be controlled and tested.  
+
From here, each actuator of the currently build robot leg can be controlled and tested.  
  
This could and should (at some point) be extended to include the possibility to set reference inputs to Flexbot to obtain step-response and permit online tuning of controllers. However, at this point it only serves as very basic interface to test and run each actuator.
+
This could and should (at some point) be extended to include the possibility to set reference inputs to Flexbot to obtain step-response and permit online tuning of controllers. However, at this point it serves only as very basic interface to test and run each actuator.
  
 
=Closing Remarks=
 
=Closing Remarks=
In the time of writing the application is still very new. Their may arise some issues along the way and the code might contain a few bugs.  
+
In the time of writing the application is still very new. There may arise some issues along the way and the code might contain a few bugs.  
  
 
For questions regarding the GUI or bug fix requests (that you are not able to fix yourself), please refer to Jesper H. Christensen: jesper@haahrchristensen.dk
 
For questions regarding the GUI or bug fix requests (that you are not able to fix yourself), please refer to Jesper H. Christensen: jesper@haahrchristensen.dk

Latest revision as of 22:34, 7 December 2017

Back to Flexbot main page

Contents

[edit] Introduction

The Flexbot Visualizer have been created as a tool for everyone using and working on Flexbot. The GUI will allow users to connect wirelessly to Flexbot with the ultimate purpose of receiving and sending messages in real time. The GUI also features a very basic control interface that allows the user excite all actuators in real time. This is meant for testing purposes only and not as a gamepad for driving Flexbot around. (although that sounds quite fun!)

[edit] Dependencies

The GUI is developed with Qt in C++ and should be run from the source/project files, i.e. there exists no executable format of this application. Qt supports all operating systems and is not depended on anything but its own libraries.

This means that Qt must be downloaded and installed. Qt can be downloaded from https://www1.qt.io/download/ - choose Desktop Applications and then the Open Source version. Note that Qt is a heavy gentlemen and will require approximately 5 GB of free space. The upside is that Qt comes with a very nice IDE that can be used for all projects (not only Qt applications).

Other than Qt, make sure to pull the newest version of the Flexbot git repository.

[edit] Instructions on how to use

This section will split down the "user manual" in small steps ensuring that all users should be able to navigate and utilize the GUI after reading this.

[edit] Running the Application

Start by firing up Qt Creator - on the welcome screen choose to open a project. From here locate and select

flexbot_visualizer.pro

which should be found under /code/GUI/flexbot_visualizer. This should open up the project including all project files.

Run the application by pushing the green "play"-button or by pressing Ctrl+r. This builds and runs the application ultimately opening window as shown below Gui1.PNG

[edit] Connecting to Flexbot

All communication to the Flexbot goes through the Intel NUC mounted on the Flexbot. The NUC will be running a very simple Python script that serves as a bridge for communication. Basically all it does is broadcast everything it receives over the USB serial interface to the network, and write everything it receives over the network to the Teensy via the USB serial interface.

Connect to Flexbot WiFi hotspot

ssid: NUC
pw: grenen89

To start the Python bridge, ssh into the NUC by opening a terminal and type

ssh local@10.42.0.1

with password grenen. Change folder to

~/flexbot/code/MAVLink/Bridge

and start the script by typing

python FlexbotBridge.py --dev /dev/ttyACM0

where /dev/ttyACM0 corresponds to serial device. It tends to change, so if it fails to launch, try changing it to /dev/ttyACM1. Make sure ethernet is disconnected at this point. Otherwise it will not work!!


When the bridge is running, and the client laptop/PC is connected to the NUC-network, press the connect button on the GUI. This will bind to the multicast IP and port that Flexbot broadcasts to as well as it will read the flexbot.xml message definitions file and initialize all available signals. Note that the flexbot.xml file should be located in the same folder as the flexbot_visualizer but if it isn't found, the GUI will automatically warn the user about this and open a file browser that will let the user locate the file themself.

To verify that connection is established, the heartbeat should pulse once a second or so.

[edit] Subscribing to Signals

After connecting to Flexbot, the Signals tab will be available. From here all signals to/from Flexbot are listed as shown below Gui2.PNG

In order to subscribe to a signal, i.e. receiving for real-time data visualizing, simply press the subcribe checkbox available for each message. When not listening in on specific messages, users should unsubscribe to them (and save bandwidth) by clicking the checkbox again.

[edit] Real-Time Data Visualization

After a message have been subscribed to, go back to the Plot tab. Here it is possible to generate up to four plots at once, each capable of plotting three messages at a time. An example of this is shown below Gui3.PNG

The time-slider sets the time-window visualised for each graph.

[edit] Basic Control Interface

The third tab, Controls, serves as a very simple control interface to Flexbot. At the time of writing it looks something like shown below Gui4.PNG

From here, each actuator of the currently build robot leg can be controlled and tested.

This could and should (at some point) be extended to include the possibility to set reference inputs to Flexbot to obtain step-response and permit online tuning of controllers. However, at this point it serves only as very basic interface to test and run each actuator.

[edit] Closing Remarks

In the time of writing the application is still very new. There may arise some issues along the way and the code might contain a few bugs.

For questions regarding the GUI or bug fix requests (that you are not able to fix yourself), please refer to Jesper H. Christensen: jesper@haahrchristensen.dk

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox