Control the airplane throttle and steering servos over the internet.
This code uses the following libraries:
streamlit
: for building the user interface.numpy
: for creating arrays.matplotlib
: for plotting the stepper motor visualizationhidapi
: for accessing usb connections on the host device
- A base station computer
- A second computer for the robot
- A PWM capable arduino + cable + servo motors and BLDC Motor controller
- A PS5 remote + cable
- clone this repository
git clone ...
- The base station and robot computers must be on the same network. Set up each device with a static IP
- Change the robot IP in 'app.py' and 'car.py' you can also change the port which is '12345'
- Change the PS5 remote vendorID and productID in 'app.py'
- Plug the arduino into the robot
- Run the arduino sketch.ino file on your arduino
- Run the car.py file on your robot
python car.py
- plug the PS5 remote into the base station
- run the streamlit app with the following command in your base station terminal
streamlit run app.py
This will start the local Streamlit server, and you can access the interface by opening a web browser and navigating to http://localhost:8501
.
repository/
├── app.py # The base station UI to send the Internet commands to the robot
├── customize_gui # class for adding gui elements
├── dualsense.py # The class used to decode received bytes from the wired controller
├── ethernet.py # a helper class for sending Internet IP communciation
├── car.py # Recieves the internet commands and relays them to the arduino
├── sketch.ino # the arduino code to control the motors
├── requirements.txt # the python packages needed to run locally
├── .gitignore # includes the local virtual environment named my_env
└── docs/
└── preview.png # preview photo for Github
Python | Low Code UI | Mobile robot | Internet IP
HIDapi | decode bytes | PS5 | Sony | Dualsense | external device | communication
Mechanical and Robotics engineer
╭━━╮╭━━━┳━━┳━━━┳━╮╱╭╮ ╭╮╱╱╭━━━┳━━━┳╮╭━┳━━━╮ ┃╭╮┃┃╭━╮┣┫┣┫╭━╮┃┃╰╮┃┃ ┃┃╱╱┃╭━━┫╭━╮┃┃┃╭┫╭━╮┃ ┃╰╯╰┫╰━╯┃┃┃┃┃╱┃┃╭╮╰╯┃ ┃┃╱╱┃╰━━┫╰━━┫╰╯╯┃┃╱┃┃ ┃╭━╮┃╭╮╭╯┃┃┃╰━╯┃┃╰╮┃┃ ┃┃╱╭┫╭━━┻━━╮┃╭╮┃┃┃╱┃┃ ┃╰━╯┃┃┃╰┳┫┣┫╭━╮┃┃╱┃┃┃ ┃╰━╯┃╰━━┫╰━╯┃┃┃╰┫╰━╯┃ ╰━━━┻╯╰━┻━━┻╯╱╰┻╯╱╰━╯ ╰━━━┻━━━┻━━━┻╯╰━┻━━━╯
follow all of these for pizza :)