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

EpicZa's profile - activity

2018-09-14 12:24:45 -0500 received badge  Famous Question (source)
2018-04-05 15:12:50 -0500 edited question Subscriber Resubscription Problem

Subscriber Resubscription Problem Hello, I have yet to find a solution to this problem, additionally I have yet to repli

2018-04-05 15:12:50 -0500 received badge  Editor (source)
2018-04-02 11:39:34 -0500 commented question Subscriber Resubscription Problem

Unfortunately I cannot give a MWE. I have figured out though that when the nodes aren't connected, the node which I have

2018-03-28 01:12:16 -0500 received badge  Notable Question (source)
2018-03-27 10:13:13 -0500 commented question Subscriber Resubscription Problem

I finally produced the error and roswtf can detect it with: the following nodes should be connected but aren't...

2018-03-27 10:13:05 -0500 edited question Subscriber Resubscription Problem

Subscriber Resubscription Problem Hello, I have yet to find a solution to this problem, additionally I have yet to repli

2018-03-27 10:12:04 -0500 received badge  Enthusiast
2018-03-26 11:38:52 -0500 received badge  Supporter (source)
2018-03-24 13:32:55 -0500 commented question Subscriber Resubscription Problem

That may help, I'll look into it, thank you.

2018-03-23 18:28:02 -0500 received badge  Popular Question (source)
2018-03-23 16:14:23 -0500 commented question Subscriber Resubscription Problem

I know, I'm interested to see if anyone has come across the issue and can point me in any direction. So far my research

2018-03-23 14:57:13 -0500 asked a question Subscriber Resubscription Problem

Subscriber Resubscription Problem Hello, I have yet to find a solution to this problem, additionally I have yet to repli

2018-03-21 12:54:08 -0500 commented question How to handle disconnection/reconnection to the ROS master

Ever find a solution to this?

2017-02-21 13:24:25 -0500 received badge  Famous Question (source)
2017-02-21 13:24:25 -0500 received badge  Popular Question (source)
2017-02-21 13:24:25 -0500 received badge  Notable Question (source)
2016-02-05 11:54:37 -0500 asked a question How to measure how long a callback takes.

I'm publishing a custom message at 200Hz from a node, which is rather large, when I subscribe to the publisher (at 1000Hz) and attempt to print/write to file info from the publisher, I am dropping messages, I believe this is due to how long the call back takes. I am dealing in real time so the buffer on both the publisher and subscriber is 1.

Is this a correct way to message how long the callback is taking?

class data_functions{
public:
    nodal_system_baxter::leap_msgs current_leap_msg;
    void leap_call_back(const  nodal_system_baxter::leap_msgs& msg);
    ros::Time call_lat_start;
};
void data_functions::leap_call_back(const  nodal_system_baxter::leap_msgs& msg){
call_lat_start = ros::Time::now();
current_leap_msg = msg;
}

int main(int argc, char **argv) {
    ros::init(argc, argv, "data_collection");
    ros::NodeHandle node;
    ros::Rate loop_rate(1000);
    data_functions data_functions;
    ros::Subscriber leap_sub;
    leap_sub = node.subscribe("left_leap_data", 1, &data_functions::leap_call_back, &data_functions);
    while(ros::ok()){
        ros::spinOnce();
        loop_rate.sleep();
        ros::Time call_lat_end = ros::Time::now();
        double call_time =  call_lat_end.toSec() - data_functions.call_lat_start.toSec();
        std::cout  << std::setprecision(20) << call_time << std::endl;
    }
    ros::shutdown();
    return 0;
}

It currently states that the callback is taking 40ms, I am missing 8 messages published every 5ms, so it adds up.