Skip to content

Instantly share code, notes, and snippets.

@PierrickKoch
Created February 23, 2012 05:53
Show Gist options
  • Select an option

  • Save PierrickKoch/1890777 to your computer and use it in GitHub Desktop.

Select an option

Save PierrickKoch/1890777 to your computer and use it in GitHub Desktop.
wifibot morse builder script
from morse.builder import *
# Append robot to the scene
robot = Robot('Wifibot.blend')
robot.name = 'wifibot'
# Append an actuator
motion = Actuator('v_omega')
motion.name = 'motion'
motion.translate(z = 0.3)
robot.append(motion)
# Append a Pose sensor (GPS + Gyroscope)
pose = Sensor('pose')
pose.name = 'odom'
pose.translate(x = -0.25, z = 1.1)
robot.append(pose)
# Append a sick laser
sick = Sensor('sick')
sick.name = 'scan'
sick.translate(x = 0.4, z = 2.58)
robot.append(sick)
# Append a camera
camera = Sensor('video_camera')
camera.name = 'cam'
camera.translate(x = 1.45, z = 1.72)
robot.append(camera)
camera.properties(cam_width = 256, cam_height = 256, Vertical_Flip = True)
# Append infrared sensors (left and right)
infrared_r = Sensor('infrared')
infrared_r.name = 'ir_r'
infrared_r.translate(x = 1, y = -0.15,z = 1)
robot.append(infrared_r)
infrared_l = Sensor('infrared')
infrared_l.name = 'ir_l'
infrared_l.translate(x = 1, y = 0.15,z = 1)
robot.append(infrared_l)
# Configure the middlewares
motion.configure_mw('ros')
pose.configure_mw('ros')
sick.configure_mw('ros')
camera.configure_mw('ros')
infrared_r.configure_mw('ros')
infrared_l.configure_mw('ros')
# Select the environement
env = Environment("indoors-1/indoor-1")
env.aim_camera([1.0470, 0, 0.7854])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment