ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

erivera1802's profile - activity

2018-10-16 02:36:10 -0500 received badge  Famous Question (source)
2018-06-20 09:55:48 -0500 received badge  Famous Question (source)
2018-05-31 12:55:32 -0500 received badge  Notable Question (source)
2018-05-28 12:53:51 -0500 received badge  Famous Question (source)
2018-05-17 08:27:08 -0500 commented answer Real time Image topic subscription

Then what should I modify? Because yes, my queue size is already 1

2018-05-17 08:27:02 -0500 commented answer Real time Image topic subscription

Than what should I modify? Because yes, my queue size is already 1

2018-05-17 08:26:34 -0500 commented answer Real time Image topic subscription

The problem is that I have already stopped using the rosbag, and began using a real environment, and I still get the del

2018-05-17 08:08:56 -0500 received badge  Notable Question (source)
2018-05-17 07:23:00 -0500 received badge  Popular Question (source)
2018-05-16 12:17:28 -0500 asked a question Real time Image topic subscription

Real time Image topic subscription Hi everyone, im trying to work on an object detector in ROS, using the deep learning

2018-05-10 22:49:19 -0500 received badge  Popular Question (source)
2018-05-10 11:00:01 -0500 asked a question Use Tensorflow detection API in ROS

Use Tensorflow detection API in ROS Hi everyone, I would like to know if the Tensorflow Object detection API can already

2018-05-10 09:42:29 -0500 answered a question Create a subscriber to an Image topic

I have not only used the accepted solution, but change the susbscriber type: subscriber_=it.subscribeCamera("/sensors/c

2018-05-10 09:41:15 -0500 commented answer Create a subscriber to an Image topic

It was really funny, because a tried this solution at first, and it didnt work, but when I write the new node to show yo

2018-05-10 09:39:58 -0500 marked best answer Create a subscriber to an Image topic

Hi, Im trying to wrtie a node that subscribes to a image topic, however, after almost copying the ros tutorial, I keep getting an error. The relevant parts of my code are:

ros::NodeHandle nh;
image_transport::ImageTransport it(nh);
image_transport::Subscriber sub;
sub=it.subscribe("/sensors/camera/top/image_raw",1, Imtest::callbackSubscriber);

And my callback is:

void Imtest::callbackSubscriber(const sensor_msgs::ImageConstPtr& msg)

The error I get is:

/home/kal3-5/workspaces/my_first_ws/src/imtest_ros_tool/src/imtest/imtest.cpp:41:83: error: invalid use of non-static member function
     sub=it.subscribe("/sensors/camera/top/image_raw",1, Imtest::callbackSubscriber);

My version of ROS is Kinetic, Ubuntu 16.04

2018-05-09 19:01:36 -0500 received badge  Notable Question (source)
2018-05-09 13:58:31 -0500 received badge  Popular Question (source)
2018-05-09 10:00:20 -0500 asked a question Create a subscriber to an Image topic

Create a subscriber to an Image topic Hi, Im trying to wrtie a node that subscribes to a image topic, however, after alm

2018-05-09 05:43:16 -0500 received badge  Notable Question (source)
2018-05-09 05:43:16 -0500 received badge  Famous Question (source)
2018-01-11 20:36:09 -0500 marked best answer Kalman filter of opencv doesnt work in ROS

Hi, im trying to adapt a Kalman filter cpp code to a node cpp in ROS, but in the very beginning, the initialization goes wrong, more precisly, when i try to set the matrices, this is the relevant part of the code.

int stateSize = 4;
int measSize = 2;
int contrSize = 0;
unsigned int type = CV_32F;
cv::KalmanFilter kf(stateSize, measSize, contrSize, type);
cv::Mat state(stateSize, 1, type);  // [x,y,v_x,v_y,w,h]
cv::Mat meas(measSize, 1, type);
setIdentity(kf.measurementMatrix);

The compiler shows me the next error:

error: expected constructor, destructor, or type conversion before ‘(’ token
setIdentity(kf.measurementMatrix);

I really have no idea what is happening, because those lines show no problem in the "pure" cpp code. Hope someone can help me, thanks.

EDIT 1:

#include <ros/ros.h>
#include <image_transport/image_transport.h>
#include <sensor_msgs/image_encodings.h>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <cv_bridge/cv_bridge.h>
#include <geometry_msgs/Twist.h>
#include <std_msgs/Empty.h>
#include <std_msgs/String.h>
#include <sstream>
#include <image_transport/image_transport.h>
#include <cv_bridge/cv_bridge.h>
#include <stdio.h>
#include <iostream>
#include <cmath>
#include "opencv2/core/core.hpp"
#include "opencv2/features2d/features2d.hpp"
#include "opencv2/nonfree/features2d.hpp"
#include "opencv2/nonfree/nonfree.hpp"
#include <ros/package.h>
#include "opencv2/calib3d/calib3d.hpp"
#include <geometry_msgs/Point.h>
#include <fstream>
#include <opencv2/video/video.hpp>
#include "opencv2/video/tracking.hpp"
2017-10-26 03:05:44 -0500 commented answer How to read the actual date in ROS

Thanks! That was exactly what i needed.

2017-10-26 03:05:24 -0500 marked best answer How to read the actual date in ROS

Hey!, I would like to name some archives, which I create in a ROS node, with a string related to the actual date on which the node is called. I already have used Ros time, but I dont know what does this "absolute" time means. My code is:

ros::Time begin = ros::Time::now();
ROS_INFO("%d\n", begin.sec);

And the output is:

[ INFO] [1508853591.867555047, 1508853591.867143646]: 1508853591

My questions are, what does this "1508853591" means? And how could I get something like 24-10-2017-16:13 or like it?

Thanks!

2017-10-24 23:03:34 -0500 received badge  Popular Question (source)
2017-10-24 09:17:46 -0500 asked a question How to read the actual date in ROS

How to read the actual date in ROS Hey!, I would like to name some archives, which I create in a ROS node, with a string

2017-08-02 09:28:54 -0500 received badge  Notable Question (source)
2017-07-21 09:22:19 -0500 received badge  Popular Question (source)
2017-07-21 03:28:00 -0500 marked best answer How do I use SURF in ROS

Hi there, I was trying to migrate a code that uses SURF from cpp to a kind of ROS cpp. But when i think that the compiler almost done it, it shows me an error after linking the executable. Here is my code:

#include <ros/ros.h>
#include <image_transport/image_transport.h>
#include <cv_bridge/cv_bridge.h>
#include <sensor_msgs/image_encodings.h>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <stdio.h>
#include <iostream>
#include "opencv2/core/core.hpp"
#include "opencv2/features2d/features2d.hpp"
#include "opencv2/nonfree/features2d.hpp"
#include "opencv2/nonfree/nonfree.hpp"

using namespace cv;
using namespace std;
static const std::string OPENCV_WINDOW = "Image window";
class ImageConverter
{
  ros::NodeHandle nh_;
  image_transport::ImageTransport it_;
  image_transport::Subscriber image_sub_;
  image_transport::Publisher image_pub_;

public:
  ImageConverter()
    : it_(nh_)
  {
    // Subscribe to input video feed and publish output video feed
    image_sub_ = it_.subscribe("/ardrone/front/image_raw", 1, 
      &ImageConverter::imageCb, this);
    image_pub_ = it_.advertise("/image_converter/output_video", 1);

    namedWindow(OPENCV_WINDOW);
  }

  ~ImageConverter()
  {
    destroyWindow(OPENCV_WINDOW);
  }

  void imageCb(const sensor_msgs::ImageConstPtr& msg)
  {
    cv_bridge::CvImagePtr cv_ptr;
    try
    {
      cv_ptr = cv_bridge::toCvCopy(msg, sensor_msgs::image_encodings::BGR8);
    }
    catch (cv_bridge::Exception& e)
    {
      ROS_ERROR("cv_bridge exception: %s", e.what());
      return;
    }

    // Draw an example circle on the video stream

    Mat img_hsv;
    cvtColor(cv_ptr->image,img_hsv,CV_BGR2GRAY);
    // Update GUI Window
    cv::imshow(OPENCV_WINDOW, img_hsv);
    int minHessian = 400;
    SurfFeatureDetector detector( minHessian );
        waitKey(3);

    // Output modified video stream
    image_pub_.publish(cv_ptr->toImageMsg());
  }
};

int main(int argc, char** argv)
{
  ros::init(argc, argv, "image_converter");
  ImageConverter ic;
  ros::spin();
  return 0;
}

This is the problematic line:

SurfFeatureDetector detector( minHessian );

The error that I got is:

Linking CXX executable /home/edrone/catkin_ws/devel/lib/stream/stream_node
CMakeFiles/stream_node.dir/src/stream_node.cpp.o: In function `ImageConverter::imageCb(boost::shared_ptr<sensor_msgs::Image_<std::allocator<void> > const> const&)':
stream_node.cpp:(.text._ZN14ImageConverter7imageCbERKN5boost10shared_ptrIKN11sensor_msgs6Image_ISaIvEEEEE[_ZN14ImageConverter7imageCbERKN5boost10shared_ptrIKN11sensor_msgs6Image_ISaIvEEEEE]+0x134): undefined reference to `cv::SURF::SURF(double, int, int, bool, bool)'
CMakeFiles/stream_node.dir/src/stream_node.cpp.o: In function `cv::SURF::~SURF()':
stream_node.cpp:(.text._ZN2cv4SURFD1Ev[_ZN2cv4SURFD1Ev]+0xe): undefined reference to `vtable for cv::SURF'
stream_node.cpp:(.text._ZN2cv4SURFD1Ev[_ZN2cv4SURFD1Ev]+0x26): undefined reference to `vtable for cv::SURF'
stream_node.cpp:(.text._ZN2cv4SURFD1Ev[_ZN2cv4SURFD1Ev]+0x2e): undefined reference to `vtable for cv::SURF'
stream_node.cpp:(.text._ZN2cv4SURFD1Ev[_ZN2cv4SURFD1Ev]+0x3b): undefined reference to `VTT for cv::SURF'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/edrone/catkin_ws/devel/lib/stream/stream_node] Error 1
make[1]: *** [stream/CMakeFiles/stream_node.dir/all] Error 2
make: *** [all] Error 2
Invoking "make -j8 -l8" failed

I haven't seen that kind of error ever, And I know what ist the line that is causing me trouble, but I dont know what to do.

I appreciate your help.

2017-07-21 03:24:11 -0500 asked a question Why I have to run a node twice to make it work?

Why I have to run a node twice to make it work? Hi, I have just written a node that subscribes to a topic, however, the

2016-11-23 12:52:23 -0500 received badge  Famous Question (source)
2016-06-28 16:11:50 -0500 received badge  Famous Question (source)
2016-06-28 16:11:50 -0500 received badge  Notable Question (source)
2016-05-08 14:42:25 -0500 marked best answer How do i reset the odometry topic on ardrone_autonomy

Hi, Im trying to read the /ardrone/odometry topic, but it is showing me very large values of x and y position Just When it starts. Im am wondering if there is a way to reset the odometry topic so it shows me 0 for the positions on the beginning. Also, the time that it shows is very large, so it has been counting long ago.

Thanks

2016-03-04 09:56:41 -0500 received badge  Famous Question (source)
2016-02-29 11:29:41 -0500 received badge  Famous Question (source)
2016-02-26 05:03:43 -0500 received badge  Famous Question (source)
2016-01-16 07:13:59 -0500 received badge  Famous Question (source)
2016-01-11 05:15:18 -0500 marked best answer How do I use nonfree opencv Libraries in ROS

Hello, I need to use a SURF feature detector in ros. I succeded when I used it outside ROS, but when i try to make a code for a node in ROS, the compiler shows me this:

CMakeFiles/stream_node.dir/src/stream_node.cpp.o: In function    `ImageConverter::imageCb(boost::shared_ptr<sensor_msgs::Image_<std::allocator<void> > const> const&)':stream_node.cpp:  (.text._ZN14ImageConverter7imageCbERKN5boost10shared_ptrIKN11sensor_msgs6Image_ISaIvEEEEE[_ZN14ImageConverter7imageCbERKN5boost10shared_ptrIKN11sensor_msgs6Image_ISaIvEEEEE]+0x134): undefined reference to `cv::SURF::SURF(double, int, int, bool, bool)'
 CMakeFiles/stream_node.dir/src/stream_node.cpp.o: In function `cv::SURF::~SURF()':
 stream_node.cpp:(.text._ZN2cv4SURFD1Ev[_ZN2cv4SURFD1Ev]+0xe): undefined reference to `vtable for cv::SURF'
 stream_node.cpp:(.text._ZN2cv4SURFD1Ev[_ZN2cv4SURFD1Ev]+0x26): undefined reference to `vtable for cv::SURF'
 stream_node.cpp:(.text._ZN2cv4SURFD1Ev[_ZN2cv4SURFD1Ev]+0x2e): undefined reference to `vtable for cv::SURF'
 stream_node.cpp:(.text._ZN2cv4SURFD1Ev[_ZN2cv4SURFD1Ev]+0x3b): undefined reference to `VTT for cv::SURF'
 collect2: error: ld returned 1 exit status

I understand it is because SURF is ubicated in a nonfree library of opencv, then, my includes are:

#include <ros/ros.h>
#include <image_transport/image_transport.h>
#include <cv_bridge/cv_bridge.h>
#include <sensor_msgs/image_encodings.h>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <stdio.h>
#include <iostream>
#include "opencv2/core/core.hpp"
#include "opencv2/features2d/features2d.hpp"
#include "opencv2/nonfree/features2d.hpp"
#include "opencv2/nonfree/nonfree.hpp"

However, It still doesnt work. Somebody knows what I have to do? Maybe editing the CMakeList.txt?

Thanks!

2015-11-16 04:55:38 -0500 received badge  Famous Question (source)
2015-11-03 20:29:08 -0500 received badge  Famous Question (source)
2015-10-26 04:47:49 -0500 received badge  Notable Question (source)
2015-10-26 02:33:06 -0500 received badge  Popular Question (source)
2015-10-24 09:44:22 -0500 asked a question Subscribe to two different type-not synchronized topics

Hi there, I want to check two topics at the same time, but as the title says, they are different type and arent synchronized, so I think I cant use the message filter example in the ROS Wiki. Here is the relevant part of the code, where I subscribe only to the camera topic:

Inside the main:

image_transport::ImageTransport it(nh);
image_transport::Subscriber sub = it.subscribe("/ardrone/image_raw", 1, imageCallback);

Callback:

void imageCallback(const sensor_msgs::ImageConstPtr& msg)
{

I want to subscribe to /ardrone/image_raw and /ardrone/navdata topics. Image raw is type image transport and navdata is a custom type. Also, an acceptable option would be that the callback only response to the Navdata topic, but inside i could read the actual image in the image_raw topic, cause the navdata topic is faster as the camera topic

Thanks!

2015-10-24 09:37:20 -0500 marked best answer Has anyone used the KalmanFilter Opencv libraries inside ROS?

Hi, I was wondering if someone has used the Kalman filter of Opencv inside ROS. The "normal" Opencv program works perfectly, but when i use it inside ros (The same code), it throws me the following error:

‘KF’ does not name a type
 KF.transitionMatrix = *(Mat_<float>(4, 4) << 1,0,1,0,   0,1,0,1,  0,0,1,0,  0,0,0,1);

The relevant include is:

#include <opencv2/video/tracking.hpp>
#include <opencv2/video/video.hpp>

That is the same that I use in the normal Opencv code, but in ROS it doesnt work.

Thanks