This project is a server-side Python application designed to collect and display measurements made by a QSpan measurement system on a UR robot. Socket messages sent by the robot are collected, plotted, and saved in 'measurements.csv'. Plotting is done on a multi-axis matplotlib plot, and data is logged in the following format f"{name},{value}". Socket messages are expected to follow a f"{name},{value}" format as in Q-Span's measure block in PolyScope.
-
Clone the repository:
git clone https://github.com/Vishwesh9000/URQSpanServer.git
-
Navigate to the project directory:
cd URQSpanServer -
Install the necessary dependencies:
pip install -r requirements.txt
The UR robot must be set up with your computer's IPv4 from the Ethernet connection with the robot (Can be found using ipconfig in cmd) and a port number (default is 55400).
Then, set the same IP address and port in the sock.bind() function inside listenForMeasurements().
Run the server script with the following command:
python server.pyA blank matplotlib window should show up
Play either the PolyScope or URScript program on the robot.
The measurements should show up in the matplotlib graph
Run python testScript.py in a separate terminal after starting up the server
Random point (1-100) on random measurements (1-10) should show up on the server's graph
- Data visualization: Client script plots measurement data with
matplotlib, including mean, median, and standard deviation, written and graphed. - Logging: Logs the data received into 'measurements.csv' (f"{name},{value}") for exporting into other software.
- Automatic IP selection: The server script automatically searches for isolated Ethernet connections (Prioritizes 169.254.x.x networks) and selects the first available connection if none are found. Can be disabled by removing the findIP() call in listenForMeasurements() and replacing it with a hardcoded IP. (NOTE: Port selection is still manual)
If you want to contribute to this project, follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch). - Make your changes.
- Commit your changes (
git commit -m 'Add new feature'). - Push to your branch (
git push origin feature-branch). - Open a pull request.
Please follow the existing coding style and write clear commit messages.
This project is licensed under the MIT License.
See the LICENSE file for details.
Here’s a screenshot of the server plotting data:
