Skip to content

Instantly share code, notes, and snippets.

@PierrickKoch
Created January 6, 2012 05:09
Show Gist options
  • Save PierrickKoch/1569107 to your computer and use it in GitHub Desktop.
Save PierrickKoch/1569107 to your computer and use it in GitHub Desktop.
MORSE test
"""
blender --background /usr/local/share/morse/data/morse_default.blend --python test.py
echo $?
"""
try:
import morse
except ImportError:
import os
import sys
if not 'MORSE_ROOT' in os.environ:
os.environ['MORSE_ROOT'] = "/usr/local"
sys.path.append("/usr/local/lib/python3/dist-packages")
import bpy
from morse.builder import *
atrv = Robot('atrv')
motion = Actuator('v_omega')
motion.name = 'Motion'
motion.translate(z = 0.3)
atrv.append(motion)
pose = Sensor('pose')
pose.name = 'Odometry'
pose.translate(x = -0.25, z = 0.83)
atrv.append(pose)
motion.configure_mw('ros')
pose.configure_mw('ros')
env = Environment('indoors-1/indoor-1')
env.aim_camera([1.0470, 0, 0.7854])
env.set_debug()
# save the scene
bpy.ops.wm.save_mainfile(filepath = "saved.blend")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment