Error: r13 not allowed here -- sub.w sp,r1,#48

Error: r13 not allowed here -- `sub.w sp,r1,#48'

GitHub - fateshelled/bytetrack_ros: ByteTrack + ROS2 (foxy)

arm ByteTrack linux编译时出现:

/tmp/kalmanFilter-8c7928.s: Assembler messages:
/tmp/kalmanFilter-8c7928.s:6895: Error: r13 not allowed here -- `sub.w sp,r1,#48'
clang++: error: assembler command failed with exit code 1 (use -v to see invocation)

定位到代码:

		void KalmanFilter::predict(KAL_MEAN &mean, KAL_COVA &covariance){
			//revise the data;
			DETECTBOX std_pos;
			std_pos << _std_weight_position * mean(3),_std_weight_position * mean(3),1e-2,_std_weight_position * mean(3);
			DETECTBOX std_vel;
			std_vel << _std_weight_velocity * mean(3),_std_weight_velocity * mean(3),1e-5,_std_weight_velocity * mean(3);
			KAL_MEAN tmp;
			tmp.block<1, 4>(0, 0) = std_pos;
			tmp.block<1, 4>(0, 4) = std_vel;
			tmp = tmp.array().square();
			KAL_COVA motion_cov = tmp.asDiagonal();
			KAL_MEAN mean1 = this->_motion_mat * mean.transpose();
			// KAL_COVA covariance1 = this->_motion_mat * covariance *(_motion_mat.transpose());
			//covariance1 += motion_cov;

			// mean = mean1;
			//covariance = covariance1;
			covariance = motion_cov;
		}

报错代码:

KAL_MEAN mean1 = this->_motion_mat * mean.transpose();

8x8 *8x1不支持。

Eigen::Matrix<float, 8, 8, Eigen::RowMajor> _motion_mat1;
Eigen::Matrix<float, 1, 8, Eigen::RowMajor> meana;
Eigen::Matrix<float, 1, 8, Eigen::RowMajor> mean2=_motion_mat1*meana.transpose();

 其中,

_motion_mat定义:

            Eigen::Matrix<float, 8, 8, Eigen::RowMajor> _motion_mat;
            Eigen::Matrix<float, 4, 8, Eigen::RowMajor> _update_mat;

KAL_MEAN定义: 

   typedef Eigen::Matrix<float, 1, 8, Eigen::RowMajor> KAL_MEAN;

数据定义:

    typedef Eigen::Matrix<float, 1, 8, Eigen::RowMajor> KAL_MEAN;
    typedef Eigen::Matrix<float, 8, 8, Eigen::RowMajor> KAL_COVA;
    typedef Eigen::Matrix<float, 1, 4, Eigen::RowMajor> KAL_HMEAN;
    typedef Eigen::Matrix<float, 4, 4, Eigen::RowMajor> KAL_HCOVA;

这个就OK:

			Eigen::Matrix<float, 4, 8, Eigen::RowMajor> up1;
			
			Eigen::Matrix<float, 1, 8, Eigen::RowMajor> h1;
			Eigen::Matrix<float, 1, 4, Eigen::RowMajor> h2= up1 * h1.transpose();

4x8 * 8x1 ,结果应该是4x1,不知道为什么这里是ok的。

如果把Eigen::Matrix<float, 1, 4, Eigen::RowMajor> h2 改为:

Eigen::Matrix<float, 4, 1, Eigen::RowMajor>,则会报错:

/mnt/d/project/changcheng/car20210326_track/mask_android/../eigen-3.3.9/Eigen/src/Core/AssignEvaluator.h:833:3: error: static_assert failed
      "YOU_MIXED_MATRICES_OF_DIFFERENT_SIZES"
  EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(ActualDstTypeCleaned,Src)

或者这个错误:

/mnt/d/project/changcheng/car20210326_track/mask_android/../eigen-3.3.9/Eigen/src/Core/CwiseBinaryOp.h:109:7: error: static_assert failed
      "YOU_MIXED_MATRICES_OF_DIFFERENT_SIZES"
      EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Lhs, Rhs)

一般代表运算过程维度错误。

我的解决方法:换了ndk版本,原来用的ndk 15rc,换成r21e版本,就解决了。

#export ANDROID_NDK=/mnt/d/android-ndk-r15c-linux-x86_64/android-ndk-r15c
export ANDROID_NDK=/mnt/d/android-ndk-r21e-linux-x86_64/android-ndk-r21e

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

AI算法网奇

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值