Created
July 8, 2011 09:05
-
-
Save PierrickKoch/1071402 to your computer and use it in GitHub Desktop.
new Morse creator demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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