Skip to main content

A browser-based robotic simulator

Project description

UAIBot

Introduction

UAIBot Logo

UAIBot is a web-based Python robotic simulator developed by Vinicius Mariano Gonçalves (Electrical Engineering Department, Federal University of Minas Gerais, Brazil) and his students.

While teaching robotics, I used many different desktop-based simulators with my students (such as CoppeliaSim and Matlab Toolboxes). However, I realized that students nowadays are much more used to web-based applications. This is why I, together with my students, came up with the idea of creating a simulator with the following goals:

  • It can be used in a web browser if the student desires.
  • Programming should be done in a language that most students already know or have some interest in learning, i.e., they should not be forced to learn a very specific language to use this simulator. Nowadays, the language that better fits these requirements is Python.
  • It should be easy to set up and simple to use.
  • For didactic purposes, it should be a low-level simulator. This means that is up to the user to simulate everything, with the help of the functions/interfaces from the simulator. Since everything is under the user's control, if something goes awry it is easier to pinpoint what is wrong.

Guided by these goals, me and my student Johnata Brayan came, in January 2022, with the idea of creating UAIBot. It is focused, so far, on open-chain serial robotic manipulators, although there is some limited support already for other kind of robots.

How it works

A Python library is used to code everything. First, it is used to set up the scenario (robots and other objects). Then, it is up to the user to explicitly compute each object's movement using the provided interfaces, creating animation frames for each one of them. Then the user creates the interactive animation as a HTML file, that can be shared and even embedded in a Web Page for didactic purposes.

So, in UAIBot, all the simulation is first created (the computations take place) and the animation is displayed!

Examples of HTML simulations made using UAIBot can be seen here , here and here.

The animations are displayed using Three.js, in JavaScript. So the Python code automatically generates the JavaScript code to set up the animation that was coded using Python. In fact, UAIBot wraps in Python many of Three.js' functions, allowing us to use many of Three.js' features to visually customize the simulation.

Getting started

Open In Colab

It is easier to start using UAIBot in a web browser. We will use GoogleColab since it allows us to run Python code in a web browser.

Open a new notebook. Now, we need to install UAIBot in the GoogleColab servers. This can be done by simply running the following commands:

!pip install uaibot

After it is done, we test if it is working by running the following command

import uaibot as ub

sim = ub.Demo.control_demo_1()

This will generate a simulation that was already pre-coded into UAIbot. It will return the simulation variable (sim) and automatically run the animation for you!

If you want to run the simulation again, you don't need to compute it again. Just run sim.run().

Note that you will need to reinstall UAIBot every time you open GoogleColab since the virtual machine created for you will be deleted.

Using in desktop-based IDE's

You can install the UAIBot package in a desktop-based IDE such as Pycharm. Install using the terminal

>>pip install uaibot

The sim.run() may not work in some IDEs. In that case, you need to save the simulation as a HTML file:

import uaibot as ub

sim = ub.Demo.control_demo_1()
sim.save('C:\\','test_uaibot')

This will save the file test_uaibot.html in your C: directory. You can then just open and visualize it. You can share just this file with your friends as well, it usually will be a small file. Since much of the information (as 3D models) is stored in a web server, in order to visualize the file an internet connection is required.

How to use the simulator

Please see the UAIBot documentation.

If you know Portuguese, you can also see my Robotic Manipulator course, which uses UAIBot.

Why "UAIBot"?

"Uai" is an interjection commonly used by mineiros, that is, people who were born in the state of Minas Gerais, Brazil. It is one of the regional symbols of Minas Gerais. It is pronounced like the English "why" and has roughly the same meaning, used when mineiros are confused or in doubt. Indeed, some linguistic researchers think that the origin of this interjection is exactly the English word "why".

What is exactly the logo of "UAIBot"???

It is supposed to be a robotic manipulator in front of a mountain. Mountains, along with the aforementioned "Uai", are one of the symbols of the state of Minas Gerais, Brazil.

Collaborators

Johnata Brayan (Electrical Engineering student, UFMG)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uaibot-0.0.2.tar.gz (87.0 kB view hashes)

Uploaded Source

Built Distribution

uaibot-0.0.2-py3-none-any.whl (132.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page