在Ceres的双重arrray的一部分上进行AngleAxisToRotationMatirx?

问题描述 投票:0回答:1

现在我和Ceres和Eigen合作。我有一个6x3 = 18-d双数组,我们称它为xs,定义为:

double xs[6*3];

基本上,xs包含以角轴格式表示的6个旋转。我需要将所有6的每个旋转转换为旋转矩阵格式,然后进行矩阵乘法。

struct F1 {
    template <typename T> bool operator()(const T* const xs,
                                    T* residual) const {
    Eigen::Map<const Eigen::Matrix<T,3,1> > m0(xs, 3);

    T m[9], res[3];
    ceres::AngleAxisToRotationMatrix(m0, m);


    residual[0] = res[0];
    residual[1] = res[1];
    residual[2] = res[2];
}

在示例代码中,我通过Eigen :: Map提取xs的前3个元素,然后在其上应用AngleAxisToRotationMatrix。但我一直收到这样的错误:

error: no matching function for call to ‘AngleAxisToRotationMatrix(Eigen::Map<const Eigen::Matrix<ceres::Jet<double, 18>, 3, 1, 0, 3, 1>, 0, Eigen::Stride<0, 0> >&, ceres::Jet<double, 1> [9])’

有人可以帮我一把吗?我对Ceres和Eigen很新,它真的让我几乎疯了。

谢谢!

eigen3 ceres-solver
1个回答
0
投票

ceres::AngleAxisToRotationMatrix期待原始指针:

AngleAxisToRotationMatrix(xs, m);
© www.soinside.com 2019 - 2024. All rights reserved.