Communicate between Android and ROS threads
Hello,
I have a simple Java class that launch a thread containing a ROS node
public class ROSThread implements Runnable {
private Thread m_thread;
public ROSThread() {
this.m_thread = new Thread(this);
}
public void rosrun(){
m_thread.start();
}
@Override
public void run() {
// start your classic ROS node (spin()) in a dedicated thread
startROSNode();
}
//load C/C++ shared library
static
{
System.loadLibrary("ros_main");
}
private native void startROSNode();
}
Which is launched in the Activity class
ROSThread rosThread = new ROSThread();
rosThread.rosrun();
In this activity, I would like to indicate to my ROS nod that it needs to publish something. Any idea how to do that ?
Thanks in advance,