You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Has anyone successfully called ROS to run the camera in real time? I modified a ros_rgbd file to run astra camera in real time, it turned out that the semantic segementation is working but the camera pose cannot be estimated and visualized, and it has been fixed in the same place. Does anyone know why? Here are my codes:
Has anyone successfully called ROS to run the camera in real time? I modified a ros_rgbd file to run astra camera in real time, it turned out that the semantic segementation is working but the camera pose cannot be estimated and visualized, and it has been fixed in the same place. Does anyone know why? Here are my codes:
#include "Semantic.h"
#include "System.h"
#include "Converter.h"
#include
#include
#include
#include
#include <opencv2/core/core.hpp>
#include <ros/ros.h>
#include <cv_bridge/cv_bridge.h>
#include <message_filters/subscriber.h>
#include <message_filters/time_synchronizer.h>
#include <message_filters/sync_policies/approximate_time.h>
#include <nav_msgs/Odometry.h>
#include <nav_msgs/Path.h>
#include <sensor_msgs/CameraInfo.h>
#include <sensor_msgs/Image.h>
#include <sensor_msgs/PointCloud2.h>
#include <geometry_msgs/PoseStamped.h>
#include <geometry_msgs/TransformStamped.h>
#include <tf/transform_broadcaster.h>
#include <tf2/LinearMath/Quaternion.h>
#include <tf2_ros/transform_broadcaster.h>
using namespace std;
using namespace ORB_SLAM3;
class ImageGrabber
{
public:
ImageGrabber(ORB_SLAM3::System* pSLAM):mpSLAM(pSLAM){lastStamp = ros::Time::now(); frameCounter = 0;}
private:
ros::Time lastStamp;
int frameCounter;
};
int main(int argc, char **argv)
{
ros::init(argc, argv, "RGBD");
ros::start();
}
void ImageGrabber::GrabRGBD(const sensor_msgs::ImageConstPtr& msgRGB,const sensor_msgs::ImageConstPtr& msgD)
{
// Copy the ros image message to cv::Mat.
cv_bridge::CvImageConstPtr cv_ptrRGB;
try
{
cv_ptrRGB = cv_bridge::toCvShare(msgRGB);
}
catch (cv_bridge::Exception& e)
{
ROS_ERROR("cv_bridge exception: %s", e.what());
return;
}
}
The text was updated successfully, but these errors were encountered: