Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'build_ros.sh' is waiting for updating #479

Open
Yi-Zhou97 opened this issue Jan 21, 2022 · 10 comments
Open

'build_ros.sh' is waiting for updating #479

Yi-Zhou97 opened this issue Jan 21, 2022 · 10 comments

Comments

@Yi-Zhou97
Copy link

Yi-Zhou97 commented Jan 21, 2022

When building the ROS version, there are some problems, such as the confusion between the file 'Examples_old' and 'Examples'.

Also, the process of 'make -j' will bring some problems as following:

/catkin_ws/src/ORB_SLAM3/Examples_old/ROS/ORB_SLAM3/src/AR/ViewerAR.cc:405:53:
error: no matching function for call to ‘std::vectorcv::Mat::push_back(Eigen::Vector3f)’
405 | vPoints.push_back(pMP->GetWorldPos());

/catkin_ws/src/ORB_SLAM3/Examples_old/ROS/ORB_SLAM3/src/AR/ViewerAR.cc:405:53:
error: conversion from ‘Eigen::Vector3f’ {aka ‘Eigen::Matrix<float, 3, 1>’} to non-scalar type ‘cv::Mat’ requested
530 | cv::Mat Xw = pMP->GetWorldPos();

/catkin_ws/src/ORB_SLAM3/Examples_old/ROS/ORB_SLAM3/src/AR/ros_mono_ar.cc:151:41:
error: conversion from ‘Sophus::SE3f’ {aka ‘Sophus::SE3’} to non-scalar type ‘cv::Mat’ requested
151 | cv::Mat Tcw = mpSLAM->TrackMonocular(cv_ptr->image,cv_ptr->header.stamp.toSec());

@JACKLiuDay
Copy link

#442
Hi, you can try this.
Or, if you don't need the AR function, just delete it in the Cmakelists.

@Qiu1117
Copy link

Qiu1117 commented Jan 27, 2022

#442 Hi, you can try this. Or, if you don't need the AR function, just delete it in the Cmakelists.

After I used the modification of point 4 in this link to replace the error of the original code, I got some new errors.

/home/qiuf/catkin_ws/src/ORB_SLAM3/Examples_old/ROS/ORB_SLAM3/src/AR/ViewerAR.cc:406:36: error: invalid initialization of reference of type ‘cv::InputArray’ {aka ‘const cv::_InputArray&’} from expression of type ‘Eigen::Vector3f’ {aka ‘Eigen::Matrix<float, 3, 1>’}
406 | cv::eigen(pMP->GetWorldPos(), WorldPos);
| ~~~~~~~~~~~~~~~~^~

/home/qiuf/catkin_ws/src/ORB_SLAM3/Examples_old/ROS/ORB_SLAM3/src/AR/ViewerAR.cc:533:33: error: invalid initialization of reference of type ‘cv::InputArray’ {aka ‘const cv::_InputArray&’} from expression of type ‘Eigen::Vector3f’ {aka ‘Eigen::Matrix<float, 3, 1>’}
533 | cv::eigen(pMP->GetWorldPos(), Xw);
| ~~~~~~~~~~~~~~~~^~

/home/qiuf/catkin_ws/src/ORB_SLAM3/Examples_old/ROS/ORB_SLAM3/src/AR/ros_mono_ar.cc:154:15: error: invalid initialization of reference of type ‘cv::InputArray’ {aka ‘const cv::_InputArray&’} from expression of type ‘Eigen::Matrix4f’ {aka ‘Eigen::Matrix<float, 4, 4>’}
154 | cv::eigen(Tcw_Matrix, Tcw);
| ^~~~~~~~~~

@JACKLiuDay
Copy link

@Qiu1117 Hi, I just see your reply. The errors seem to locate at the AR function. I just delete the related add_executable in the CMakeLists as I don't use the AR function. Maybe you can try this.

@Qiu1117
Copy link

Qiu1117 commented Jan 28, 2022

@Qiu1117 Hi, I just see your reply. The errors seem to locate at the AR function. I just delete the related add_executable in the CMakeLists as I don't use the AR function. Maybe you can try this.

It works!Thank you. : )

@anchao1997
Copy link

in AR of Examples_old

#include "../../../include/Converter.h"

error: conversion from ‘Sophus::SE3f’ {aka ‘Sophus::SE3’} to non-scalar type ‘cv::Mat’ requested
151 | cv::Mat Tcw = mpSLAM->TrackMonocular(cv_ptr->image,cv_ptr->header.stamp.toSec());

cv::Mat Tcw=ORB_SLAM3::Converter::toCvMat(mpSLAM->TrackMonocular(cv_ptr->image,cv_ptr->header.stamp.toSec()).matrix());
//in line 151 of ros_mono_ar.cc

error: no matching function for call to ‘std::vectorcv::Mat::push_back(Eigen::Vector3f)’
405 | vPoints.push_back(pMP->GetWorldPos());

vPoints.push_back(ORB_SLAM3::Converter::toCvMat(pMP->GetWorldPos()));
//in line 405 of ViewerAR.cc

error: conversion from ‘Eigen::Vector3f’ {aka ‘Eigen::Matrix<float, 3, 1>’} to non-scalar type ‘cv::Mat’ requested
530 | cv::Mat Xw = pMP->GetWorldPos();

cv::Mat Xw = ORB_SLAM3::Converter::toCvMat(pMP->GetWorldPos());
//in line 530 of ViewerAR.cc

all above .cc file should include Converter.h file

@thanhnguyencanh
Copy link

in AR of Examples_old

#include "../../../include/Converter.h"

error: conversion from ‘Sophus::SE3f’ {aka ‘Sophus::SE3’} to non-scalar type ‘cv::Mat’ requested 151 | cv::Mat Tcw = mpSLAM->TrackMonocular(cv_ptr->image,cv_ptr->header.stamp.toSec());

cv::Mat Tcw=ORB_SLAM3::Converter::toCvMat(mpSLAM->TrackMonocular(cv_ptr->image,cv_ptr->header.stamp.toSec()).matrix());
//in line 151 of ros_mono_ar.cc

error: no matching function for call to ‘std::vectorcv::Mat::push_back(Eigen::Vector3f)’ 405 | vPoints.push_back(pMP->GetWorldPos());

vPoints.push_back(ORB_SLAM3::Converter::toCvMat(pMP->GetWorldPos()));
//in line 405 of ViewerAR.cc

error: conversion from ‘Eigen::Vector3f’ {aka ‘Eigen::Matrix<float, 3, 1>’} to non-scalar type ‘cv::Mat’ requested 530 | cv::Mat Xw = pMP->GetWorldPos();

cv::Mat Xw = ORB_SLAM3::Converter::toCvMat(pMP->GetWorldPos());
//in line 530 of ViewerAR.cc

all above .cc file should include Converter.h file

Tkanks bro ^^

@thehuongrbe
Copy link

in AR of Examples_old

#include "../../../include/Converter.h"

error: conversion from ‘Sophus::SE3f’ {aka ‘Sophus::SE3’} to non-scalar type ‘cv::Mat’ requested 151 | cv::Mat Tcw = mpSLAM->TrackMonocular(cv_ptr->image,cv_ptr->header.stamp.toSec());

cv::Mat Tcw=ORB_SLAM3::Converter::toCvMat(mpSLAM->TrackMonocular(cv_ptr->image,cv_ptr->header.stamp.toSec()).matrix());
//in line 151 of ros_mono_ar.cc

error: no matching function for call to ‘std::vectorcv::Mat::push_back(Eigen::Vector3f)’ 405 | vPoints.push_back(pMP->GetWorldPos());

vPoints.push_back(ORB_SLAM3::Converter::toCvMat(pMP->GetWorldPos()));
//in line 405 of ViewerAR.cc

error: conversion from ‘Eigen::Vector3f’ {aka ‘Eigen::Matrix<float, 3, 1>’} to non-scalar type ‘cv::Mat’ requested 530 | cv::Mat Xw = pMP->GetWorldPos();

cv::Mat Xw = ORB_SLAM3::Converter::toCvMat(pMP->GetWorldPos());
//in line 530 of ViewerAR.cc

all above .cc file should include Converter.h file

Tkanks bro ^^

Hi bro. i had the same error when try build it on ros2. How can fix it? Hope to see you soon! <3
My log error:
error: conversion from ‘Sophus::SE3f’ {aka ‘Sophus::SE3’} to non-scalar type ‘cv::Mat’ requested
52 | cv::Mat Tcw = m_SLAM->TrackRGBD(cv_ptrRGB->image, cv_ptrD->image, msgRGB->header.stamp.sec);

@anchao1997
Copy link

in AR of Examples_old

#include "../../../include/Converter.h"

error: conversion from ‘Sophus::SE3f’ {aka ‘Sophus::SE3’} to non-scalar type ‘cv::Mat’ requested 151 | cv::Mat Tcw = mpSLAM->TrackMonocular(cv_ptr->image,cv_ptr->header.stamp.toSec());

cv::Mat Tcw=ORB_SLAM3::Converter::toCvMat(mpSLAM->TrackMonocular(cv_ptr->image,cv_ptr->header.stamp.toSec()).matrix());
//in line 151 of ros_mono_ar.cc

error: no matching function for call to ‘std::vectorcv::Mat::push_back(Eigen::Vector3f)’ 405 | vPoints.push_back(pMP->GetWorldPos());

vPoints.push_back(ORB_SLAM3::Converter::toCvMat(pMP->GetWorldPos()));
//in line 405 of ViewerAR.cc

error: conversion from ‘Eigen::Vector3f’ {aka ‘Eigen::Matrix<float, 3, 1>’} to non-scalar type ‘cv::Mat’ requested 530 | cv::Mat Xw = pMP->GetWorldPos();

cv::Mat Xw = ORB_SLAM3::Converter::toCvMat(pMP->GetWorldPos());
//in line 530 of ViewerAR.cc

all above .cc file should include Converter.h file

Tkanks bro ^^

Hi bro. i had the same error when try build it on ros2. How can fix it? Hope to see you soon! <3 My log error: error: conversion from ‘Sophus::SE3f’ {aka ‘Sophus::SE3’} to non-scalar type ‘cv::Mat’ requested 52 | cv::Mat Tcw = m_SLAM->TrackRGBD(cv_ptrRGB->image, cv_ptrD->image, msgRGB->header.stamp.sec);

I think you use ORB_SLAM3::Converter::toCvMat function to do so.

@cwg968
Copy link

cwg968 commented Jun 21, 2023

error: conversion from ‘Sophus::SE3f’ {aka ‘Sophus::SE3’} to non-scalar type ‘cv::Mat’ requested 151 | cv::Mat Tcw = mpSLAM->TrackMonocular(cv_ptr->image,cv_ptr->header.stamp.toSec());

cv::Mat Tcw;
Sophus::SE3f Tcw_SE3f = mpSLAM->TrackMonocular(cv_ptr->image,cv_ptr->header.stamp.toSec());
Eigen::Matrix4f Tcw_Matrix = Tcw_SE3f.matrix();
cv::eigen2cv(Tcw_Matrix, Tcw);
// in line 151 of ros_mono_ar.cc

error: no matching function for call to ‘std::vectorcv::Mat::push_back(Eigen::Vector3f)’ 405 | vPoints.push_back(pMP->GetWorldPos());

cv::Mat WorldPos;
cv::eigen2cv(pMP->GetWorldPos(), WorldPos);
vPoints.push_back(WorldPos);
//in line 405 of ViewerAR.cc

error: conversion from ‘Eigen::Vector3f’ {aka ‘Eigen::Matrix<float, 3, 1>’} to non-scalar type ‘cv::Mat’ requested 530 | cv::Mat Xw = pMP->GetWorldPos();

cv::Mat Xw;
cv::eigen2cv(pMP->GetWorldPos(), Xw);
//in line 530 of ViewerAR.cc

and you should correct the code before add

#include <Eigen/Dense>
#include<opencv2/core/eigen.hpp>

all above .cc file should include add this!

@joooohnson
Copy link

in AR of Examples_old

#include "../../../include/Converter.h"

error: conversion from ‘Sophus::SE3f’ {aka ‘Sophus::SE3’} to non-scalar type ‘cv::Mat’ requested 151 | cv::Mat Tcw = mpSLAM->TrackMonocular(cv_ptr->image,cv_ptr->header.stamp.toSec());

cv::Mat Tcw=ORB_SLAM3::Converter::toCvMat(mpSLAM->TrackMonocular(cv_ptr->image,cv_ptr->header.stamp.toSec()).matrix());
//in line 151 of ros_mono_ar.cc

error: no matching function for call to ‘std::vectorcv::Mat::push_back(Eigen::Vector3f)’ 405 | vPoints.push_back(pMP->GetWorldPos());

vPoints.push_back(ORB_SLAM3::Converter::toCvMat(pMP->GetWorldPos()));
//in line 405 of ViewerAR.cc

error: conversion from ‘Eigen::Vector3f’ {aka ‘Eigen::Matrix<float, 3, 1>’} to non-scalar type ‘cv::Mat’ requested 530 | cv::Mat Xw = pMP->GetWorldPos();

cv::Mat Xw = ORB_SLAM3::Converter::toCvMat(pMP->GetWorldPos());
//in line 530 of ViewerAR.cc

all above .cc file should include Converter.h file

Thank u <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants