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

Nagarjun's profile - activity

2023-08-02 15:09:47 -0500 answered a question No Module Named catkin.builder

The above happens when you unset a path . Ex: unset PYTHONPATH You need to add a path according to your version: This

2023-04-24 03:34:10 -0500 received badge  Famous Question (source)
2022-12-09 03:51:53 -0500 received badge  Famous Question (source)
2022-11-22 08:52:26 -0500 received badge  Notable Question (source)
2022-11-22 08:52:26 -0500 received badge  Popular Question (source)
2022-11-03 21:28:40 -0500 received badge  Self-Learner (source)
2022-11-03 21:28:40 -0500 received badge  Teacher (source)
2022-11-03 13:26:23 -0500 answered a question How to print ros::params defined in bash and roslaunch in c++ script?

I got it. That's because you can't get rosparams from launch file until rosnode initilaization and node Nodehandler bein

2022-11-03 13:26:23 -0500 received badge  Rapid Responder (source)
2022-11-03 12:47:45 -0500 edited question How to print ros::params defined in bash and roslaunch in c++ script?

How to print ros::params defined in bash and roslaunch in c++ script? I have a bash script as follows: bash foldername=

2022-11-03 12:47:19 -0500 asked a question How to print ros::params defined in bash and roslaunch in c++ script?

How to print ros::params defined in bash and roslaunch in c++ script? I have a bash script as follows: bash foldername=

2022-10-20 15:41:42 -0500 commented question ImportError: dynamic module does not define module export function (PyInit_cv_bridge_boost)

Anyone has a solution for this?

2022-10-20 15:41:42 -0500 received badge  Commentator
2022-10-14 09:56:14 -0500 marked best answer How declare ROS subscriber inside a class?

I am publishing images to another node and while publishing I am also subscribing a string. When that string is true I will save the image of the published data at that moment. I am having some trouble because of the following error: no match operator '=' for the subscriber which I don't understand why.

/home/rrcam/catkin_ws/src/image_pub/src/im_pub_sub.cpp: In constructor ‘Node::Node()’:
/home/rrcam/catkin_ws/src/image_pub/src/im_pub_sub.cpp:47:73: error: no match for ‘operator=’ (operand types are ‘image_transport::Subscriber’ and ‘ros::Subscriber’)
             sub = nh_.subscribe("/chatter",1, &Node::imageCallback, this);
                                                                         ^
In file included from /opt/ros/melodic/include/image_transport/image_transport.h:39:0,
                 from /home/rrcam/catkin_ws/src/image_pub/src/im_pub_sub.cpp:2:
/opt/ros/melodic/include/image_transport/subscriber.h:61:7: note: candidate: image_transport::Subscriber& image_transport::Subscriber::operator=(const image_transport::Subscriber&)
 class Subscriber
       ^~~~~~~~~~
/opt/ros/melodic/include/image_transport/subscriber.h:61:7: note:   no known conversion for argument 1 from ‘ros::Subscriber’ to ‘const image_transport::Subscriber&’
/opt/ros/melodic/include/image_transport/subscriber.h:61:7: note: candidate: image_transport::Subscriber& image_transport::Subscriber::operator=(image_transport::Subscriber&&)
/opt/ros/melodic/include/image_transport/subscriber.h:61:7: note:   no known conversion for argument 1 from ‘ros::Subscriber’ to ‘image_transport::Subscriber&&’
image_pub/CMakeFiles/i_pub_sub.dir/build.make:62: recipe for target 'image_pub/CMakeFiles/i_pub_sub.dir/src/im_pub_sub.cpp.o' failed
make[2]: *** [image_pub/CMakeFiles/i_pub_sub.dir/src/im_pub_sub.cpp.o] Error 1
CMakeFiles/Makefile2:1521: recipe for target 'image_pub/CMakeFiles/i_pub_sub.dir/all' failed
make[1]: *** [image_pub/CMakeFiles/i_pub_sub.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j4 -l4" failed

The Script is as follows: I don't get it what's wrong. I have also tried using boost::bind for binding this pointer and msg in subscriber callback function:

#include <cv_bridge/cv_bridge.h>
#include <image_transport/image_transport.h>
#include <opencv2/highgui/highgui.hpp>
#include <ros/ros.h>
#include <sensor_msgs/image_encodings.h>
#include <exception>
#include <iostream>
#include <opencv2/imgcodecs.hpp>
#include "std_msgs/String.h"

class Node{

    public:
        cv::Mat frame1;
        std::string GSpipeline1 = "nvarguscamerasrc sensor-id=0 ee-mode=0 ! video/x-raw(memory:NVMM), format=(string)NV12 ! nvvidconv ! video/x-raw, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! appsink";
        int count =0;
        ros::NodeHandle nh_;
        ros::Rate loop_rate =10;
        cv::VideoCapture cap1;
        sensor_msgs::ImagePtr msg1;
        image_transport::ImageTransport it;
        image_transport::Publisher pub_frame1;
        image_transport::Subscriber sub;

    public:
        Node():it(nh_),cap1(GSpipeline1, cv::CAP_GSTREAMER){
            if (!cap1.isOpened())
            {
                std::cout << "Failed to open camera1." << std::endl;
                return;
            }
            pub_frame1 = it.advertise("/cam1",1);

            // sub = it.subscribe("/chatter",1, boost::bind(&Node::imageCallback, this));
            sub = nh_.subscribe("/chatter",1, &Node::imageCallback, this);
        }

        ~Node(){

        }

        void imageCallback(const std_msgs::String::ConstPtr& msg)
        {
            std::cout<<"I am here"<<std::endl;
            if(msg->data.getData() == 'true'){
                this->count++;
                cv::imwrite("/home/rrcam/sensor0/img_"+ std::to_string(this->count)+".png",this->frame1);
            }

        }

        void start(){

            while (this->nh_.ok()) {
                this->cap1 >> this->frame1;
                // this->cap1.read(this->frame1);
                if (this->frame1.empty()) {
                    ROS_ERROR_STREAM("Failed to capture1 image!");
                    ros::shutdown();
                    break;
                }
                int k = cv::waitKey(20) & 0xff ...
(more)
2022-10-14 09:56:14 -0500 received badge  Scholar (source)
2022-10-13 11:03:05 -0500 received badge  Notable Question (source)
2022-10-13 10:01:19 -0500 edited answer How declare ROS subscriber inside a class?

Thank you for pointing out my mistakes @ravijoshi. 1) Yes I have changed the image_transport::Subscriber sub to ros::Su

2022-10-13 10:00:52 -0500 commented answer How declare ROS subscriber inside a class?

Thank you for pointing out my mistakes @ravijoshi. 1) Yes I have changed the image_transport::Subscriber sub to ros::Su

2022-10-11 13:18:47 -0500 edited answer How declare ROS subscriber inside a class?

Thank you for pointing out my mistakes @ravijoshi. 1) Yes I have changed the image_transport::Subscriber sub to ros::Su

2022-10-11 13:18:47 -0500 received badge  Editor (source)
2022-10-11 13:14:29 -0500 answered a question How declare ROS subscriber inside a class?

Thank you for pointing out my mistakes @ravijoshi. 1) Yes I have changed the image_transport::Subscriber sub to ros::Su

2022-10-11 12:00:55 -0500 received badge  Popular Question (source)
2022-10-07 14:18:17 -0500 asked a question How declare ROS subscriber inside a class?

How declare ROS subscriber inside a class? Hi Everyone, I am publishing images to another node and while publishing I a

2022-09-21 10:53:18 -0500 asked a question [ERROR] bad callback: <bound method Subscriber.callback of <message_filters.Subscriber object>> ; RuntimeError: dictionary changed size during iteration

[ERROR] bad callback: <bound method="" subscriber.callback="" of="" <message_filters.subscriber="" object="">&g

2022-05-22 12:55:35 -0500 received badge  Famous Question (source)
2021-03-19 11:46:13 -0500 received badge  Notable Question (source)
2021-03-19 11:46:13 -0500 received badge  Popular Question (source)
2021-03-19 09:17:42 -0500 commented question Not able to calculate orientation properly (odom)

Hi @parzival I am having same trouble. Could you please let me know how did you solve this problem.

2021-03-17 18:55:00 -0500 commented question How to calculate orientation of turtlebot given desired Vx and Vy velocities, goal and start position?

Thanks @Solrac, but the problem with this formula is, even if Vx <1 (i.e. 0.1 to 0.9) there is a significant change i

2021-03-16 16:13:56 -0500 edited question How to compute turtlebot orientation based on given desired V_x, V_y, goal and start position?

How to compute turtlebot orientation based on given desired V_x, V_y, goal and start position? Hi Guys, I am new to ros.

2021-03-16 16:13:06 -0500 asked a question How to compute turtlebot orientation based on given desired V_x, V_y, goal and start position?

How to compute turtlebot orientation based on given desired V_x, V_y, goal and start position? Hi Guys, I am new to ros.

2021-03-16 16:10:17 -0500 asked a question How to calculate orientation of turtlebot given desired Vx and Vy velocities, goal and start position?

How to calculate orientation of turtlebot given desired Vx and Vy velocities, goal and start position? Hi Guys, I am new

2021-01-18 11:38:39 -0500 received badge  Famous Question (source)
2021-01-06 03:11:29 -0500 received badge  Notable Question (source)
2020-12-16 01:48:33 -0500 received badge  Popular Question (source)
2020-11-17 15:56:35 -0500 commented question For frame [hokuyo_link]: Frame [hokuyo_link] does not exist

Is there any solution for this problem?

2020-11-15 20:43:41 -0500 asked a question [nodelet_manager-5] process has died

[nodelet_manager-5] process has died Hi guys, I have installed a package called obstacle detection and everything is w

2020-11-15 17:22:19 -0500 commented answer Problem connect turtlebot and workstation

I didn't understand your solution, Can you please detail it?

2020-10-28 22:21:38 -0500 commented question unable to find the correct transform between odom and base_link for a mobile robot

Hello, I am having some trouble, when I used the package above mentioned in the question and I am using a robot_state_pu

2020-10-19 18:08:47 -0500 received badge  Taxonomist
2020-10-15 23:25:12 -0500 received badge  Notable Question (source)
2020-10-15 17:30:46 -0500 commented answer dynamic obstacle tracking and detection in 2D env in RViz ROS

Thank you @JackB for your answer, but I think its not teb package is not useful. The teb package creates a trajectory fo

2020-10-15 17:30:16 -0500 commented answer dynamic obstacle tracking and detection in 2D env in RViz ROS

Thank you @JackB for your answer, but I think its not teb package is not useful. The teb package creates a trajectory fo

2020-10-15 17:30:01 -0500 commented answer dynamic obstacle tracking and detection in 2D env in RViz ROS

Thank you @JackB for your answer, but I think its not teb package is not useful. The teb package creates a trajectory fo

2020-10-15 17:29:00 -0500 commented answer dynamic obstacle tracking and detection in 2D env in RViz ROS

Thank you @JackB for your answer, but I think its not teb package is not useful. The teb package creates a trajectory fo

2020-10-15 17:21:13 -0500 commented answer dynamic obstacle tracking and detection in 2D env in RViz ROS

Thank you for your answer, but I think its not teb package is not useful. The teb package creates a trajectory for the o

2020-10-15 17:10:02 -0500 commented question detect dynamic obstacles

Hi guys, even I require to detect dynamic obstacles in the gazebo? is there any package available? I need to detect the

2020-10-15 17:01:40 -0500 received badge  Enthusiast
2020-10-14 17:16:58 -0500 commented answer What does the Fixed Frame mean in rviz?

What happens If I keep my fixed_frame as /map instead of /odom and /base_link frame?

2020-10-09 23:46:35 -0500 answered a question rosrun map_server map_server couldn't find executable

Hi guys, I had the same problem, I solved by: 1) First I uninstall my navigation package 2) I tried installing it using