Skip to main content

A simulator of ADAM (Autonomous Domestic Ambidextrous Manipulator), a mobile robot manipulator consisting of a base with two Degrees of Freedom (DoF) and two Universal Robots UR3 of 6 DoF each.

Project description

ADAM simulator

ADAM (Autonomous Domestic Ambidextrous Manipulator) is a mobile robot manipulator consisting of a base with two Degrees of Freedom (DoF) and two Universal Robots UR3 of 6 DoF each.

The simulation was built using MuJoCo, a free and open source physics engine designed from the ground up for the purpose of model-based optimization, and in particular optimization through contacts.

Installation

Follow the next steps for installing the simulation on your device.

Requierements:

  • Ubuntu
  • Python 3.10.0 or higher

Install miniconda (highly-recommended)

It is highly recommended to install all the dependencies on a new virtual environment. For more information check the conda documentation for installation and environment management. For creating the environment use the following commands on the terminal.

conda create -n adam python==3.10.8
conda activate adam

Install from pip

The ADAM simulator is available as a pip package. For installing it just use:

pip install adam-sim

Install from source

Firstly, clone the repository in your system.

git clone https://github.com/vistormu/adam_simulator.git

Then, enter the directory and install the required dependencies

cd adam_simulator
pip install -r requirements.txt

API Reference

Visit TMP

Minimal Working Examples

Basic Usage

In this example, ADAM moves the left and right wrist_2 continuously.

from adam import Simulation
from adam.entities import Configuration, Data


def main():
    sim: Simulation = Simulation()
    initial_data: Data = sim.load_scene()

    left_configuration: Configuration = initial_data.configuration.left_manipulator
    right_configuration: Configuration = initial_data.configuration.right_manipulator

    for _ in range(100):
        left_configuration += Configuration(0.0, 0.0, 0.0, 0.0, 0.1, 0.0)
        right_configuration -= Configuration(0.0, 0.0, 0.0, 0.0, 0.1, 0.0)

        sim.render()
        data: Data = sim.step(left_configuration, right_configuration)

    sim.close()


if __name__ == '__main__':
    main()

ConfigurationsManager example

In this example, the test configurations are loaded to the left manipulator.

from adam import Simulation, ConfigurationsManager
from adam.entities import Configuration, Data


def main():
    sim: Simulation = Simulation()
    initial_data: Data = sim.load_scene()

    configuration_list: list[Configuration] = ConfigurationsManager.load('test')

    for configuration in configuration_list:
        sim.render()

        data: Data = sim.step(configuration, initial_data.configuration.right_manipulator)

    sim.close()


if __name__ == '__main__':
    main()

MapMaker example

In this example, various bodies are created and then added to the scene

from adam import Simulation, MapMaker
from adam.entities import Data, Cube, Box, Capsule, Cylinder, Sphere


def main():
    directory_path: str = 'tests/assets/'
    filename: str = 'obstacles.xml'

    map_maker: MapMaker = MapMaker(directory_path+filename)

    # Cube 1
    cube_1: Cube = Cube('cube_1')
    cube_1.set_geometry(size=0.5, position=(0.5, 0.0, 0.0))
    cube_1.set_dynamics(mass=1.0)
    cube_1.set_appearance('#2f2f2f')

    # Cube 2
    cube_2: Cube = Cube('cube_2')
    cube_2.set_geometry(size=0.5, position=(1.0, 0.0, 0.0))
    cube_2.set_dynamics(mass=1.0)
    cube_2.set_appearance(color='#b64545', alpha=0.5)

    # Cube 3
    cube_3: Cube = Cube('cube_3')
    cube_3.set_geometry(size=0.5, position=(1.0, 0.0, 0.5))
    cube_3.set_appearance('#c4c476')

    # Cube 4
    cube_4: Cube = Cube('cube_4')
    cube_4.set_geometry(size=0.5, position=(0.5, 0.0, 0.5))

    # Box
    box: Box = Box('box')
    box.set_geometry(size=(0.2, 0.2, 0.5), position=(1.0, 0.0, 1.0))
    box.set_appearance(color=(0.2, 0.2, 0.2), alpha=0.2)

    # Capsule
    capsule: Capsule = Capsule('capsule')
    capsule.set_geometry(size=(0.2, 0.5), position=(0.5, -0.5, 0.0))

    # Cylinder
    cylinder: Cylinder = Cylinder('cylinder')
    cylinder.set_geometry(size=(0.2, 0.5), position=(1.0, -0.5, 0.0))

    # Sphere
    sphere: Sphere = Sphere('sphere')
    sphere.set_geometry(size=0.25, position=(0.5, -1.0, 0.0))

    map_maker.add_bodies([cube_1, cube_2, cube_3, cube_4, box, capsule, cylinder, sphere])
    map_maker.make()

    Simulation.export_scene(directory_path)
    map_maker.add_to(directory_path + 'scene.xml')

    sim: Simulation = Simulation()
    initial_data: Data = sim.load_scene('tests/assets/scene.xml')

    sim.extend_collisions({77: 'table'})

    for _ in range(1000):
        sim.step(initial_data.configuration.left_manipulator, initial_data.configuration.right_manipulator)
        sim.render()


if __name__ == '__main__':
    main()

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

adam_sim-0.3.1.tar.gz (8.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

adam_sim-0.3.1-py3-none-any.whl (8.6 MB view details)

Uploaded Python 3

File details

Details for the file adam_sim-0.3.1.tar.gz.

File metadata

  • Download URL: adam_sim-0.3.1.tar.gz
  • Upload date:
  • Size: 8.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for adam_sim-0.3.1.tar.gz
Algorithm Hash digest
SHA256 105edcd3687ff10f65f89dcbc7c67c441c1fa823a19ce22505d65c5d28eb3cd8
MD5 2e5ecc30ed113e10c4d5bb424a724671
BLAKE2b-256 13562555fe2dcc7130486268b8f761e55c61067c9574188bc96cba138538a1ef

See more details on using hashes here.

File details

Details for the file adam_sim-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: adam_sim-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 8.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for adam_sim-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 af98d6981f55d56eb679b7a1797c9122a6bb710376822c5d1f549f04cd358a71
MD5 a515543263dc2e2bb5d83b6762e28155
BLAKE2b-256 a3b8c068065191ecee60da660f471c077dd04ff3fe96ba06da29a707a863c1a0

See more details on using hashes here.

Supported by

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