Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/347.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
TypeError:对象数组可能是自引用python_Python_Math_Matrix - Fatal编程技术网

TypeError:对象数组可能是自引用python

TypeError:对象数组可能是自引用python,python,math,matrix,Python,Math,Matrix,所以,我遇到了这个错误: temp7: 1.68219771725e-06 temp6: [[array([-60800056.33037408], dtype=object)]] Exception in thread Thread-4: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner self.run() Fi

所以,我遇到了这个错误:

temp7: 
1.68219771725e-06
temp6: 
[[array([-60800056.33037408], dtype=object)]]
Exception in thread Thread-4:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rospy/timer.py", line 223, in run
    self._callback(TimerEvent(last_expected, last_real, current_expected, current_real, last_duration))
  File "/home/husky/catkin_ws/src/huskybot_ekf_v2/src/meas_update.py", line 194, in meas_update_step
    thisJ = temp7 * math.exp(temp6)
似乎在最后一行,我不能取temp6的指数。有人知道原因吗

for i in range(0,len(line_features)-1):
    for k in range(0, len(m)):
        mkx = m[k][0]
        mky = m[k][1]
        posex = predicted_pose.x
        posey = predicted_pose.y
        poseth = predicted_pose.theta

        distx = math.pow((mkx - posex), 2);
        disty = math.pow((mky - posey), 2);

        q = distx + disty
        angle = math.atan2(mky-posey, mkx-posex) - poseth

        expected_meas = numpy.array([[math.sqrt(q)],
                                    [angle],
                                    [0]
                                    ])

        H = numpy.array([[-(mkx-posex)/math.sqrt(q), -(mky-posey)/math.sqrt(q) , 0],
                        [(mky-posey)/q, -(mkx-posex)/q, -1],
                        [0 , 0, 0]])
        Qt = 0.5
        innovation_cov = H*predicted_cov*numpy.transpose(H)+Qt
        innovation = ave_meas_dist - expected_meas

        dd = [[2]]
        #dd = array[0]

        #print 0.5*numpy.array(dd)
        temp5 = -1/2 * numpy.dot(numpy.transpose(innovation), numpy.linalg.inv(innovation_cov))
        temp6 = numpy.dot(temp5, innovation)
        print math.sqrt(numpy.linalg.det(2*math.pi*innovation_cov)) * numpy.array(dd)
        temp7 = math.sqrt(numpy.linalg.det(2*math.pi*innovation_cov))
        thisJ =temp7* math.exp(temp6)

我试图重现这个错误。我得到的错误是:

TypeError: must be real number, not list
如果错误相同,则通过执行以下操作解决:

thisJ = temp7 * math.exp(temp6[0][0])
因为temp6类型是
list
包含
list
包含
array
对象。如果我错了,请纠正我。

请提供一份报告,以便我们进行测试。