Load Carrying Multirobot Simulation

Post Reply
Posts: 1
Joined: Wed Oct 12, 2022 2:14 am

Load Carrying Multirobot Simulation

Post by atom »

Hi, For our project, we are planning to do multirobot load carrying simulations
2 robots carrying a load
2 robots carrying a load
Screenshot from 2022-10-11 19-20-04.png (9.46 KiB) Viewed 150629 times
, I have found an excellent library that has a very simple holonomic point robot simulation https://github.com/maxspahn/gym_envs_urdf in which I have two robots loaded which have a urdf associated to them and are loaded into the environment.
multirobot example in pybullet
multirobot example in pybullet
Screenshot from 2022-10-11 19-22-24.png (64.13 KiB) Viewed 150629 times
To this simulation, I'm looking for ways in which I can add a load like the one shown in the figure.1 to this simulation, the load is attached to a fixed continuous joint which allows the robot to rotate in place with the load on the top.

To accomplish this would the urdf files have to modified or can this be done directly through the pybullet python API. Any help is deeply appreciated. Thank you.

code for the simulation, to run this, the library has to installed.

Code: Select all

import gym
import numpy as np
from urdfenvs.robots.tiago import TiagoRobot
from urdfenvs.robots.generic_urdf import GenericUrdfReacher
from urdfenvs.robots.prius import Prius
# import sys
# sys.path.append("/home/josyula/Programs/MAS_Project/gym_envs_urdf/")
import pybullet
def run_multi_robot(n_steps=1000, render=False, obstacles=False, goal=False):
    robots = [
        GenericUrdfReacher(urdf="pointRobot.urdf", mode="vel"),
        GenericUrdfReacher(urdf="pointRobot.urdf", mode="vel"),
        # GenericUrdfReacher(urdf="ur5.urdf", mode="acc"),
        # GenericUrdfReacher(urdf="ur5.urdf", mode="acc"),
        # TiagoRobot(mode="vel"),
        # Prius(mode="vel")

    env = gym.make(
        dt=0.01, robots=robots, render=render
    n = env.n()
    action = np.ones(n) * -0.2
    pos0 = np.zeros(n)
    pos0[1] = -0.0
    base_pos = np.array([
        [0.0, 1.0, 0.0],
        [0.0, -1.0, 0.0],
        [0.0, -2.0, 0.0]
    ob = env.reset(pos=pos0, base_pos=base_pos)
    print(f"Initial observation : {ob}")
    if goal:
        from examples.scene_objects.goal import dynamicGoal

    # if obstacles:
    #     from examples.scene_objects.obstacles import dynamicSphereObst2
    #     env.add_obstacle(dynamicSphereObst2)
    pybullet.createVisualShape(pybullet.GEOM_BOX, halfExtents=[0.5, 0.5, 0.5])
    print("Starting episode")
    history = []
    for _ in range(n_steps):
        ob, _, _, _ = env.step(action)
    return history

    #add load onto robots

if __name__ == "__main__":
    run_multi_robot(render=True, obstacles=True, goal=True)

Post Reply