source: remote_control/puzzlebox_brainstorms_configuration.py @ 34

Last change on this file since 34 was 31, checked in by sc, 12 years ago

GPL v2 header added to all files

File size: 4.4 KB
Line 
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3#
4# Puzzlebox - Brainstorms - Configuration
5#
6# Copyright Puzzlebox Productions, LLC (2010)
7#
8# This code is released under the GNU Pulic License (GPL) version 2
9# For more information please refer to http://www.gnu.org/copyleft/gpl.html
10#
11# Last Update: 2010.02.03
12#
13#####################################################################
14
15import os
16import pygame
17
18#####################################################################
19# General configuration
20#####################################################################
21
22DEBUG = 1
23
24#####################################################################
25# Logging
26#####################################################################
27
28LOG_LEVEL_DEBUG = 2
29LOG_LEVEL_INFO = 1
30LOG_LEVEL_ERROR = 0
31LOG_LEVEL_DISABLE = -1
32
33DEFAULT_LOG_LEVEL = LOG_LEVEL_DEBUG
34DEFAULT_LOGFILE = 'puzzlebox'
35
36LOGFILE_DIR = '/var/log/puzzlebox'
37LOGFILE_SUFFIX = '.log'
38LOGFILE_SUFFIX_DEBUG = '_debug.log'
39LOGFILE_SUFFIX_INFO = '_info.log'
40LOGFILE_SUFFIX_ERROR = '_error.log'
41
42SPLIT_LOGFILES = False
43
44#BRAINSTORMS_LOGFILE = 'brainstorms'
45
46
47#####################################################################
48# Network addresses
49#####################################################################
50
51SERVER_INTERFACE = '' # listen on all of server's network interfaces
52SERVER_HOST = '192.168.1.150'
53SERVER_PORT = 8194
54
55
56#####################################################################
57# Remote Control configuration
58#####################################################################
59
60BLUETOOTH_DEVICE = '/dev/rfcomm0'
61MOTORS_MOUNTED_BACKWARDS = True
62MOTOR_PORT_RIGHT = 'a'
63MOTOR_PORT_LEFT = 'b'
64DEFAULT_RC_COMMAND = 'test_drive'
65
66
67#####################################################################
68# Server configuration
69#####################################################################
70
71MAX_COMPONENTS = 16
72
73
74#####################################################################
75# Client configuration
76#####################################################################
77
78MAX_CONNECTION_ATTEMPTS = 5
79HEALTH_CHECK_CONNECTION_ATTEMPTS = 5
80NO_REPLY_WAIT = 10 # how many seconds before considering a component dead
81
82
83#####################################################################
84# Client Interface configuration
85#####################################################################
86
87DISPLAY_WINDOW_X_COORDINATE = 0
88DISPLAY_WINDOW_Y_COORDINATE = 0
89DISPLAY_WINDOW_X_DIMENSION = 254
90DISPLAY_WINDOW_Y_DIMENSION = 424
91
92#WINDOW_BACKGROUND_COLOR = (255,255,255) # white background
93#WINDOW_BACKGROUND_COLOR = (128,128,128) # grey background
94#WINDOW_BACKGROUND_COLOR = (64,64,64)    # dark grek background
95WINDOW_BACKGROUND_COLOR = (0,0,0)       # black background
96
97IMAGE_DIRECTORY = os.path.join(os.getcwd(), 'images')
98
99# Keyboard key reference at http://www.pygame.org/docs/ref/key.html#pygame.key
100BUTTON_LAYOUT = { \
101       
102        'left': { \
103                'command': 'turn_left', \
104                'active': False, \
105                'button_image': '1-upper_left-white.png', \
106                'activated_image': '1-upper_left-orange.png', \
107                'image_x': 0, \
108                'image_y': 0, \
109                'match_keys': [pygame.K_LEFT, pygame.K_a, pygame.K_q]
110                }, \
111       
112        'forward': { \
113                'command': 'drive_forward', \
114                'active': False, \
115                'button_image': '2-up-white.png', \
116                'activated_image': '2-up-orange.png', \
117                'image_x': 98, \
118                'image_y': 0, \
119                'match_keys': [pygame.K_UP, pygame.K_w]
120                }, \
121       
122        'right': { \
123                'command': 'turn_right', \
124                'active': False, \
125                'button_image': '3-upper_right-white.png', \
126                'activated_image': '3-upper_right-orange.png', \
127                'image_x': 157, \
128                'image_y': 0, \
129                'match_keys': [pygame.K_RIGHT, pygame.K_d, pygame.K_e]
130                }, \
131       
132        'reverse_left': { \
133                'command': 'turn_left_in_reverse', \
134                'active': False, \
135                'button_image': '7-lower_left-white.png', \
136                'activated_image': '7-lower_left-orange.png', \
137                'image_x': 0, \
138                'image_y': 220, \
139                'match_keys': [pygame.K_z]
140                }, \
141       
142        'reverse': { \
143                'command': 'drive_reverse', \
144                'active': False, \
145                'button_image': '8-down-white.png', \
146                'activated_image': '8-down-orange.png', \
147                'image_x': 98, \
148                'image_y': 220, \
149                'match_keys': [pygame.K_DOWN, pygame.K_s, pygame.K_x]
150                }, \
151       
152        'reverse_right': { \
153                'command': 'turn_right_in_reverse', \
154                'active': False, \
155                'button_image': '9-lower_right-white.png', \
156                'activated_image': '9-lower_right-orange.png', \
157                'image_x': 157, \
158                'image_y': 220, \
159                'match_keys': [pygame.K_PAGEDOWN, pygame.K_c]
160                }, \
161       
162} # BUTTON_LAYOUT
163
Note: See TracBrowser for help on using the repository browser.