Exemple #1
0
    def sound(self):
        """
        Position the gripper (grasping the rod) parallel to ground and move down
        BE SURE TO HAVE LAUNCH roslaunch audio_capture capture.launch
        """
        iters = 3  # number of times to hit
        home_pose = tfx.pose([0.48, -0.67, 0.85],
                             tfx.tb_angles(0, 0, 0),
                             frame='base_link')
        home_joints = [-1.49, 0.276231, -1.8, -1.43, 1.33627, -0.254, -25.1481]
        delta_pos = [0, 0, -0.10]
        speed = 0.25
        file = '../data/sound_{0}.bag'.format(self.object_material)

        print('Recording to file: {0}'.format(file))
        sd = save_data.SaveData(file, save_data.PR2_TOPICS_AND_TYPES)

        print('Going to home joints')
        self.rarm.go_to_joints(home_joints)

        print('Starting recording and moving by {0} for {1} times'.format(
            delta_pos, iters))
        sd.start()
        for _ in xrange(iters):
            self.rarm.go_to_pose(home_pose + delta_pos,
                                 speed=speed,
                                 block=True)
            self.rarm.go_to_joints(home_joints)
        sd.stop()
Exemple #2
0
    def execute_experiment(self,
                           file,
                           home_joints,
                           home_pose,
                           delta_pos,
                           speed=0.02):
        self.larm.set_gripper(0.75 * self.larm.min_grasp +
                              0.25 * self.larm.max_grasp)
        print('Recording to file: {0}'.format(file))
        sd = save_data.SaveData(file, save_data.PR2_TOPICS_AND_TYPES)

        print('Going to home joints')
        self.larm.go_to_joints(home_joints)
        self.zero_pressure_sensors()

        print('Starting recording and moving by {0}'.format(delta_pos))
        sd.start()
        duration = self.larm.go_to_pose(home_pose + delta_pos,
                                        speed=speed,
                                        block=False)
        self.wait_action(duration)
        sd.stop()

        print('Stopping recording. Going to home joints')
        self.larm.go_to_joints(home_joints)
Exemple #3
0
def main():
    image_path = input('>> Caminho para a imagem com extensão: ')
    image = img_process.ImageProcess(image_path)
    huffman_obj = huffman.Huffman(image.img_array)
    save_data.SaveData('results/', image.img_array, huffman_obj.hist,
                       huffman_obj.codes)
    bench = benchmark.Benchmark(image, image.img_array, huffman_obj.codes)
    print('\nRESULTADOS PODEM SER VISUALIZADOS EM "/results"')
Exemple #4
0
 def __init__(self):
     self.download_html = download_html.DownloadHtml()
     self.paraser_html = paraser_html.HtmlParaser()
     self.save_data = save_data.SaveData()
     self.savedb = saveToDB.ConnMysql()
#!/usr/bin/python2.7
# coding=utf-8
import download_html
import paraser_html
import save_data
import saveToDB
import main

downloader = download_html.DownloadHtml()
paraser = paraser_html.HtmlParaser()
save = save_data.SaveData()
spider = main.videoSpider()
db = saveToDB.ConnMysql()
# movie_url1 = 'http://list.youku.com/show/id_z6f9e63deffb911e5a080.html?spm=a2h0j.8191423.sMain.5~5~A!2'
# movie_url = 'http://list.youku.com/show/id_zef0a07f820b211e6a080.html?spm=a2h0j.8191423.sMain.5~5~A!2'
# movie_html = downloader.download(movie_url,2)
# soup = BeautifulSoup(movie_html, 'lxml')
# movie_info = paraser.get_movie_info(soup)
# movie_info['url']=movie_url
# db.insertDB([movie_info])
# save.savefile2([movie_info])
base_url = 'http://list.youku.com/category/show'
pre_url = '/c_96'
spider.getVideoInfo(base_url, pre_url)
Exemple #6
0
 def __init__(self):
     self.downloader = html_downloader.Html_Downloader() #html下载器
     self.parser = html_parser.Html_Parser()
     self.save_data = save_data.SaveData()