Emio API is a simple and easy-to-use API for controling the Emio robot from Compliance Robotics.
The emioapi package is published on PyPI.
To install the Emio API, you can use pip:
python -m pip install emioapior to get the latest version that is unstable
python -m pip install git+https://github.com/SofaComplianceRobotics/Emio.API.git@release-mainThe Emio API provides the EmioAPI class, which can be used to control the Emio robot. The API provides methods for controlling the robot's motors and camera.
You can look at the motors_example.py file for a simple example of how to use the API to control the motors of the Emio robot.
To control the camera, look at the camera_example.py file or multiprocess_camera_example.py.
Simple example thaht sets the angles of the motors to 0 radians, waits for 1 second, and then prints the status of the robot:
from emioapi import emio
# Open a port to the Emio robot and configure it
emio.connectToEmioDevice()
emio.motors.angles = [0] * 4 # Set the angles of the motors to 0 radians
time.sleep(1) # Wait for 1 second
emio.printStatus() # Print the status of the robot
emio.disconnect() # Close the connection to the robotTo use the UDP bridge, you can directly call the tool:
python -m emioapi startUDPThis will start a UDP bridge that will listen and send data according to the parameters in file emioapi/udp_bridge/udp_bridge_params.py
You also have options that you can set at the call. List them using:
python -m emioapi startUDP -hThe documentation is generated using pydoc-markdown. To generate the documentation, you need to install pydoc-markdown:
pipx install pydoc-markdownThen, you can generate the documentation in a emioapi.md file, by using the following command at the root of the project:
pydoc-markdown