Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brianlesko/c-space-2r
The Configuration space of a robot lays the groundwork for localization and planning
https://github.com/brianlesko/c-space-2r
Last synced: about 20 hours ago
JSON representation
The Configuration space of a robot lays the groundwork for localization and planning
- Host: GitHub
- URL: https://github.com/brianlesko/c-space-2r
- Owner: BrianLesko
- License: mit
- Created: 2024-01-16T03:14:49.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-01-17T23:15:08.000Z (10 months ago)
- Last Synced: 2024-01-18T06:06:33.230Z (10 months ago)
- Language: Python
- Size: 7.64 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# 2RC-Space
This code implements the control of a virtual double joint robot using Sony's Dualsense (PS5) controller. The robot is soley visualized in its configuration space - a torus - here the torus is flattened into a 2D plot of the joint values. This project is written in [Pure Python](https://github.com/BrianLesko/R2-Dualsense2/blob/main/app.py) in 69 lines of code. Created by Brian Lesko for Learning Purposes.
## Dependencies
This code uses the following libraries:
- `streamlit`: for building the user interface.
- `numpy`: for creating arrays.
- `matplotlib`: for saving image data
- `io`: for saving image data
- `hidapi`: for accessing usb connections on the host device
## Usage
Run the following commands:
```
pip install --upgrade streamlit libusb hidapi matplotlib modern_robotics
streamlit run REPLACE with link to code
```This will start the local Streamlit server, and you can access the chatbot by opening a web browser and navigating to `http://localhost:8501`.
## How it Works
The app as follows:
1. The hidapi library is used to initiate a connection to the PS5 controller
2. The dualsense class is used to decode the received bytes
3. The robot class is used to plot the robot figure
4. Streamlit is used to display the robot
## Repository Structure
```
repository/
├── app.py # the code and UI integrated together live here
├── customize_gui # class for adding gui elements
├── dualsense.py # The class used to decode received bytes from the wired controller
├── requirements.txt # the python packages needed to run locally
├── .gitignore # includes the local virtual environment named my_env
├── .streamlit/
│ └── config.toml # theme info for the UI
└── docs/
└── preview.png # preview photo for Github
```
## Topics
```
Python | Streamlit | Git | Low Code UI
External device | HIDapi | decode bytes | PS5 | Sony | Dualsense | communication | Remote control
custom classes
Self taught coding | Mechanical engineer | Robotics engineer
```
╭━━╮╭━━━┳━━┳━━━┳━╮╱╭╮ ╭╮╱╱╭━━━┳━━━┳╮╭━┳━━━╮
┃╭╮┃┃╭━╮┣┫┣┫╭━╮┃┃╰╮┃┃ ┃┃╱╱┃╭━━┫╭━╮┃┃┃╭┫╭━╮┃
┃╰╯╰┫╰━╯┃┃┃┃┃╱┃┃╭╮╰╯┃ ┃┃╱╱┃╰━━┫╰━━┫╰╯╯┃┃╱┃┃
┃╭━╮┃╭╮╭╯┃┃┃╰━╯┃┃╰╮┃┃ ┃┃╱╭┫╭━━┻━━╮┃╭╮┃┃┃╱┃┃
┃╰━╯┃┃┃╰┳┫┣┫╭━╮┃┃╱┃┃┃ ┃╰━╯┃╰━━┫╰━╯┃┃┃╰┫╰━╯┃
╰━━━┻╯╰━┻━━┻╯╱╰┻╯╱╰━╯ ╰━━━┻━━━┻━━━┻╯╰━┻━━━╯
follow all of these or i will kick you