示例#1
0
	def load_codes(self):
		print 'Loading...'
		for path in glob.glob(self.code_dir + '/*.pkl'):
			name = '_'.join(os.path.split(path)[-1].split('.')[:-1])
			self.codes[name] = loadIRCode(path)
			print '  ', name
示例#2
0
#     * Neither the name of the Oregon State University nor the
#       names of its contributors may be used to endorse or promote products
#       derived from this software without specific prior written permission.

# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL OREGON STATE UNIVERSITY BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# Author Dan Lazewatsky/[email protected]

import roslib; roslib.load_manifest('ir_comm')
import sys, time
from ir_comm.device import ROSIr
from ir_comm.utils import loadIRCode

if __name__ == '__main__':
	if len(sys.argv) != 2:
		print 'Usage: transmit_one.py [filename]'
		sys.exit(1)
	ir = ROSIr()
	code, info = loadIRCode(sys.argv[1])
	time.sleep(1)
	ir.ir.transmit(code, info)
	print 'Transmitted'