Skip to content

Instantly share code, notes, and snippets.

@PierrickKoch
Created July 8, 2011 09:05
Show Gist options
  • Save PierrickKoch/1071402 to your computer and use it in GitHub Desktop.
Save PierrickKoch/1071402 to your computer and use it in GitHub Desktop.
new Morse creator demo
from morse.builder.sensors import *
from morse.builder.actuators import *
from morse.builder.middlewares import *
from morse.builder.morsebuilder import *
# Append ATRV robot to the scene
atrv = Robot('atrv')
# Append an actuator
motion = MotionController()
motion.translate(z=0.3)
atrv.append(motion)
# Append an odometry sensor
odometry = Odometry()
odometry.translate(x=-0.1, z=0.83)
atrv.append(odometry)
# Append a proximity sensor
proximity = Proximity()
proximity.translate(x=-0.2, z=0.83)
atrv.append(proximity)
# Append a Pose sensor (GPS + Gyroscope)
pose = Pose()
pose.translate(x=0.2,z=0.83)
atrv.append(pose)
# Append a sick laser
sick = Sensor('morse_sick_180')
sick.translate(x=0.18,z=0.94)
atrv.append(sick)
sick.properties(resolution = 1)
# Append a camera
camera = Sensor('morse_camera')
#camera = Camera() # XXX not yet
camera.translate(x=0.3,z=1.1)
atrv.append(camera)
camera.properties(cam_width = 128, cam_height = 128)
# light
light = Light()
light.translate(x=0.4,z=0.9)
atrv.append(light)
# infrared
infrared = Sensor('morse_infrared')
infrared.translate(x=0.6,z=0.2)
atrv.append(infrared)
# battery
battery = Battery()
atrv.append(battery)
# Insert the middleware object
ros = ROS()
# Configure the middlewares
ros.configure(motion)
ros.configure(odometry)
ros.configure(proximity)
ros.configure(pose)
ros.configure(sick)
ros.configure(camera)
ros.configure(light)
ros.configure(infrared)
ros.configure(battery)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment