File: dala_simple.py

package info (click to toggle)
morse-simulator 1.4-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 187,116 kB
  • sloc: ansic: 108,311; python: 25,694; cpp: 786; makefile: 126; xml: 34; sh: 7
file content (35 lines) | stat: -rw-r--r-- 786 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from morse.builder import *

def equipped_robot(mw='yarp'):
    # Append ATRV robot to the scene
    atrv = ATRV()

    # Append an actuator
    motion = MotionVW()
    atrv.append(motion)

    # Append a Pose sensor (GPS + Gyroscope)
    pose = Pose()
    pose.translate(x=0.2,z=0.83)
    atrv.append(pose)

    # Append a sick laser
    sick = Sick()
    sick.translate(x=0.18,z=0.94)
    atrv.append(sick)
    sick.properties(resolution = 1)
    sick.properties(laser_range = 5.0)

    # Append a camera
    cam = VideoCamera()
    cam.translate(x=0.3,z=1.1)
    atrv.append(cam)
    cam.properties(cam_width = 128, cam_height = 128)

    # Configure the middlewares
    motion.add_stream(mw)
    pose.add_stream(mw)
    sick.add_stream(mw)
    cam.add_stream(mw)

    return (atrv)