Changeset 343


Ignore:
Timestamp:
06/14/12 12:39:17 (9 years ago)
Author:
sc
Message:
  • Update for configuration-based COMMAND_ACTIVATE definition
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Puzzlebox/Brainstorms/Configuration.py

    r322 r343  
    44# Puzzlebox - Brainstorms - Configuration 
    55# 
    6 # Copyright Puzzlebox Productions, LLC (2010-2011) 
     6# Copyright Puzzlebox Productions, LLC (2010-2012) 
    77# 
    88# This code is released under the GNU Pulic License (GPL) version 2 
     
    1010 
    1111__changelog__ = """\ 
    12 Last Update: 2011.12.05 
     12Last Update: 2012.06.14 
    1313 
    1414""" 
     
    143143else: 
    144144        RC_CAR_DEVICE = DEFAULT_RC_CAR_DEVICE_LINUX 
     145 
     146 
     147##################################################################### 
     148# Helicopter configuration 
     149##################################################################### 
     150 
     151COMMAND_PACKET = { 
     152        'default_neutral':      '\x00\x00\x00\xaa\x05\xff\x09\xff\x0d\xff\x13\x54\x14\xaa',  # default neutral setting to use for all commands 
     153        'default_full_thrust':  '\x00\x00\x03\x54\x05\xff\x09\xff\x0d\xff\x13\x54\x14\xaa',  # new controll set to highest throttle (no changes to trim) 
     154        #'neutral':             '\x00\x00\x00\xfa\x05\xc5\x09\xde\x0e\x0b\x13\x54\x14\xaa',  # 0.4.5 neutral setting to use for all commands 
     155        'neutral':              '\x00\x00\x00\xae\x05\xff\x09\xff\x0d\xff\x13\x54\x14\xaa',  # default neutral setting to use for all commands 
     156        'no_thrust':            '\x00\x00\x00\x5a\x05\xc5\x09\xde\x0e\x0b\x13\x54\x14\xaa',  # lowest trim setting for throttle 
     157        'minimum_thrust':       '\x00\x00\x00\xca\x05\xc5\x09\xde\x0e\x0b\x13\x54\x14\xaa',  # lowest trim level at which throttle kicks in 
     158        'minimum_thrust_minus_one': '\x00\x00\x00\xc6\x05\xc5\x09\xde\x0e\x0b\x13\x54\x14\xaa',  # lowest trim level at which throttle kicks in 
     159        'maximum_thrust':       '\x00\x00\x03\x54\x05\xc5\x09\xde\x0e\x0b\x13\x54\x14\xaa',  # maximum possible throttle and trim 
     160        'fifty_percent_thrust': '\x00\x00\x01\x7d\x05\xc5\x09\xde\x0e\x0b\x13\x54\x14\xaa', # calculated 50% throttle 
     161        'test_packet':          '\x00\x00\x03\x54\x06\x15\x09\xca\x0e\x2f\x13\x54\x14\xaa', # test packet from saleae logic screenshot 
     162        'maximum_forward':      '\x00\x00\x00\x5a\x05\xc5\x0b\x54\x0e\x0b\x13\x54\x14\xaa', # maximum possible elevator and trim 
     163            #'fly_forward':      '\x00\x00\x01\x7d\x05\xc5\x0a\xde\x0e\x0b\x13\x54\x14\xaa', # 0.4.5 fly_forward settings  
     164            'fly_forward':      '\x00\x00\x01\x7d\x05\xc5\x0a\xde\x0e\x0b\x13\x54\x14\xaa',  
     165} 
     166 
     167COMMAND_ACTIVATE = 'fifty_percent_thrust' 
     168# COMMAND_ACTIVATE = 'maximum_thrust' 
     169# COMMAND_ACTIVATE = 'minimum_thrust' 
     170# COMMAND_ACTIVATE = 'fly_forward' 
    145171 
    146172 
  • trunk/Puzzlebox/Brainstorms/Helicopter_Control.py

    r326 r343  
    99# For more information please refer to http://www.gnu.org/copyleft/gpl.html 
    1010 
    11 __changelog__ = """ 
    12 Last Update: 2012.03.21 
     11__changelog__ = """2012.06.14 
    1312""" 
    1413 
     
    5352 
    5453DEFAULT_COMMAND = 'dump_packets' 
     54 
     55COMMAND_ACTIVATE = configuration.COMMAND_ACTIVATE 
    5556 
    5657SERIAL_DEVICE = '/dev/ttyUSB0' 
     
    296297                #self.sync_to_helicopter() 
    297298                 
    298                 self.protocol.command_packet = COMMAND_PACKET['fifty_percent_thrust'] 
    299                 #self.protocol.command_packet = COMMAND_PACKET['maximum_thrust'] 
     299                #self.protocol.command_packet = COMMAND_PACKET['fifty_percent_thrust'] 
     300                ##self.protocol.command_packet = COMMAND_PACKET['maximum_thrust'] 
     301                 
     302                self.protocol.command_packet = COMMAND_PACKET[COMMAND_ACTIVATE] 
    300303                 
    301304                if duration != None: 
  • trunk/puzzlebox_brainstorms_configuration.ini

    r326 r343  
    8282 
    8383##################################################################### 
     84# Helicopter configuration 
     85##################################################################### 
     86 
     87COMMAND_ACTIVATE = 'fifty_percent_thrust' 
     88# COMMAND_ACTIVATE = 'maximum_thrust' 
     89# COMMAND_ACTIVATE = 'minimum_thrust' 
     90# COMMAND_ACTIVATE = 'fly_forward' 
     91 
     92 
     93##################################################################### 
    8494# ThinkGear Connect configuration 
    8595##################################################################### 
Note: See TracChangeset for help on using the changeset viewer.