Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can just insert this snippet into your node:

//print pid
#include <sys/types.h>
#include <unistd.h>  
std::cout << "pid= " << getpid() << std::endl;

//print tid
#include <thread>
std::cout << "tid=" << std::this_thread::get_id() << std::endl;

You can just insert this snippet into your node:node, it's not ros specific:

//print pid
#include <sys/types.h>
#include <unistd.h>  
std::cout << "pid= " << getpid() << std::endl;

//print tid
#include <thread>
std::cout << "tid=" << std::this_thread::get_id() << std::endl;