morse-simulator / morse

The Modular OpenRobots Simulation Engine
http://morse-simulator.github.io/
Other
350 stars 155 forks source link

Add support for loading URDF models in MORSE #788

Open severin-lemaignan opened 6 years ago

severin-lemaignan commented 6 years ago

This PR implements URDF support in MORSE. Mostly the work of @jbaudisch, with the help of myself. This closes #547.

A few samples with the Pepper and Meka robots:

meka

pepper

The basics seem to work. Probably still many bugs, but at this stage, broader testing by more people would be useful.

To import your model, simply create a builder script, passing a .urdf file to the constructor of your robot (instead of a .blend file). For instance:

from morse.builder import *

# Add robot from its URDF description
robot = Robot("path/to/my/robot.urdf", name="MyRobot")

# then, standard BUilder script. For instance:

# Append an actuator to the robot
motion = MotionVW()
robot.append(motion)

# Append a sensor to the robot
pose = Pose()
pose.translate(z = 0.75)
robot.append(pose)

# Configure the robot on the 'socket' interface
robot.add_default_interface('socket')

env = Environment('indoors-1/indoor-1')

morse/testing/urdf contains 3 examples (R2D2, Pepper and Meka).