Ejemplo n.º 1
0
 def __init__(self):
     redisHandler.__init__(self)
     self.url = 'http://117.184.129.18:8000/planning/query/?key='
     self.sub_topics = ['rtk_out', 'tracking_in']
     self.pub_topics = ['tracking_out']
     self.config = config('para_track.yaml')
     self.start_sub()
Ejemplo n.º 2
0
    def __init__(self):
        redisHandler.__init__(self)
        self.url = 'http://117.184.129.18:8000/planning/query/?key='
        
        self.sub_topics = ['rtk_out', 'tracking_in']
        self.pub_topics = ['ctrl_in']

        # 配置参数
        self.config = Config()
        self.config.robot_type = robot_type
        # 目标点误差
        self.delta_goal = 0.40

        # 任务目标kdtree
        self.goal_kdtree = None
        # 障碍物kdtree
        self.ob_kdtree = None

        # to movebase通信格式
        self.max_speed = 80
        self.data_speed = {
                'header':'speed',
                'data':{
                    'y': 1,
                    'angle': 0,
                    'speed': self.max_speed
                    }
                }

        self.start_sub()
Ejemplo n.º 3
0
    def __init__(self):
        redisHandler.__init__(self)
        
        self.sub_topics = ['tracking_in']
        self.pub_topics = ['ctrl_in']

        self.start_sub()
Ejemplo n.º 4
0
 def __init__(self):
     redisHandler.__init__(self)
     self.url = 'http://117.184.129.18:8000/planning/query/?key='
     self.sub_topics = ['rtk_out', 'tracking_in']
     self.pub_topics = ['ctrl_in']
     self.config = config('para_cmd.yaml') 
     # 上一次命令内容
     self.last_dict_cmd = []
     self.last_list_cmd = []
     # 任务目标kdtree
     self.kdtree = None
     # 任务列表
     self.cmd_list=[]
     # 目标点误差, list型
     self.delta = 0.3
     self.delta_goal_list = 1.4
     # dict类型数据目标点误差
     self.delta_goal = 0.4
     # 发布至ctrl cmd的格式
     self.data_cmd = {
             'header':'cmd',
             'data': ''
             }
     # 任务运行记录格式
     self.data_config = {
                 'key':'none',
                 'cmd':[]
                 }
     # 任务记录的字典key值
     self.para_mission_key = 'mission'
     if not self.para_mission_key in self.config.config:
         self.config.set_para(self.para_mission_key, self.data_config)
     self.start_sub()
Ejemplo n.º 5
0
 def __init__(self):
     motor.__init__(self)
     ray.__init__(self)
     self.tx = 0
     self.ty = 0
     redisHandler.__init__(self)
     self.pub_topics = ['radar_out']
     self.sub_topics = []
Ejemplo n.º 6
0
 def __init__(self):
     # 心跳时间
     self.timeout = 30
     self.conf = config()
     self.name = self.conf.robot['name']
     self.key = self.conf.robot['key']
     # 从主函数端接收消息的q
     self.recv_q = queue.Queue(5)
     self.address = ('117.184.129.18', 9000)
     self.robot_on()
     redisHandler.__init__(self)
Ejemplo n.º 7
0
 def __init__(self):
     redisHandler.__init__(self)
     self.url = 'http://117.184.129.18:8000/planning/query/?key='
     self.sub_topics = ['tracking_in']
     self.pub_topics = ['rtk_out']
     self.__position = {
         'p': [-51.005, 164.012],
         'angle': 4.8,
         'precision': 0.0,
         # 'angle_precision':0.0,
         'rtcm': '',
         'rtk_mod': 4
     }
     self.start_sub()
Ejemplo n.º 8
0
    def __init__(self):
        redisHandler.__init__(self)

        self.sub_topics = ['track_cmd_in']
        self.pub_topics = ['ctrl_in']

        # 电机工作角度
        self.mission_angle = 150385
        # 位移传感器工作长度mm
        self.mission_length = 125

        self.motor = Motor(1, '/dev/ttyS5')
        self.motor_init()

        self.sensor = sensorLinear(3, '/dev/ttyS5')

        self.start_sub()
Ejemplo n.º 9
0
 def __init__(self, port=None):
     # 超声波模块信息类
     if not port:
         self.port = '/dev/ttyS5'
     else:
         self.port = port
     # 数据读取频率
     self.hz = 0.8
     # 遇障碍物停止的最小距离
     self.min_dist = 500
     self.ser = serial.Serial(self.port,
                              9600,
                              timeout=0.5,
                              write_timeout=0.5)
     # 获取四个探头数据的命令
     self.send_cmd = [0x55, 0xAA, 0x01, 0x01, 0x01, 0x01]
     # 信息头
     self.head = [0x55, 0xAA, 0x01, 0x01]
     # 信息头之和
     self.sum_head = 0
     for i in self.head:
         self.sum_head += i
     # redis
     redisHandler.__init__(self)