Esempio n. 1
0
    def get_account_info(cls, name):
        """
        读取账号
        :return: dict
        """

        account = read_data("账号.json")  # 去读所有账号
        if name is account.keys():
            return account(name)
Esempio n. 2
0
class TestLogin(unittest.TestCase):
    # 初始化
    def setUp(self):
        # 获取apilogin对象
        self.login = ApiLogin()

    # 登录测试接口方法
    @parameterized.expand(read_data("login.json"))
    def test_login(self, mobile, password):
        # 调用登录接口
        result = self.login.api_login(mobile, password)
        print(result.json())
        # 断言
        assert_common(self, result)
        # 提取token值
        token = result.json().get("data")
        # 追加到api公共变量
        api.headers["Authorization"] = "Bearer " + token
        print(api.headers)
Esempio n. 3
0
def build_data(key):
    data1 = []
    data1.append(tuple(read_data("address.yaml").get(key).values()))
    return data1
Esempio n. 4
0
import numpy as np

from tools.plot_state import plot_state
from tools.read_data import read_data
from tools.read_world import read_world
from prediction_step import prediction_step
from correction_step import correction_step

if __name__ == "__main__":

    # Read world data, i.e. landmarks
    landmarks = read_world('./data/world.dat')
    # Read sensor readings, i.e. odometry and range-bearing sensor
    data = read_data('./data/sensor_data.dat')

    n_landmarks = len(landmarks)
    # observed_landmarks is a vector that keeps track of which landmarks have been observed so far.
    # observed_landmarks[i] will be true if the landmark with id = i has been observed at some point by the robot
    observed_landmarks = [False] * n_landmarks

    # Initialize belief:
    # mu: 2N+3x1 vector representing the mean of the normal distribution
    # The first 3 components of mu correspond to the pose of the robot,
    # and the landmark poses (xi, yi) are stacked in ascending id order.
    # sigma: (2N+3)x(2N+3) covariance matrix of the normal distribution
    mu = np.zeros(2 * n_landmarks + 3)
    rob_sigma = np.zeros((3, 3))
    rob_map_sigma = np.zeros((3, 2 * n_landmarks))
    map_sigma = 1e10 * np.eye(2 * n_landmarks)

    # Construct a (3+3*n_landmarks, 3+3*n_landmarks) matrix
Esempio n. 5
0
 def read_data(cls):
     return read_data("data.yaml")