File: default.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 (46 lines) | stat: -rw-r--r-- 1,123 bytes parent folder | download | duplicates (3)
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
36
37
38
39
40
41
42
43
44
45
46
#! /usr/bin/env morseexec

""" MORSE Builder script for the 'ROS navigation tutorial'.

You can access the tutorial online, here:
http://www.openrobots.org/morse/doc/latest/user/advanced_tutorials/ros_nav_tutorial.html

"""
from morse.builder import *

# A 'naked' PR2 robot to the scene
james = BasePR2()
james.add_interface('ros')
james.translate(x=2.5, y=3.2, z=0.0)

# An odometry sensor to get odometry information
odometry = Odometry()
james.append(odometry)
odometry.add_interface('ros', topic="/odom")

# Keyboard control
keyboard = Keyboard()
james.append(keyboard)

scan = Hokuyo()
scan.translate(x=0.275, z=0.252)
james.append(scan)
scan.properties(Visible_arc = False)
scan.properties(laser_range = 30.0)
scan.properties(resolution = 1.0)
scan.properties(scan_window = 180.0)
scan.create_laser_arc()

scan.add_interface('ros', topic='/base_scan')

motion = MotionXYW()
motion.properties(ControlType = 'Position')
james.append(motion)
motion.add_interface('ros', topic='/cmd_vel')


# Set the environment
env = Environment('tum_kitchen/tum_kitchen', fastmode=True)
env.set_camera_rotation([1.0470, 0, 0.7854])