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

Revision history [back]

Well, I know that my answer may be later, but I hope to help more people. One solution is using ssh. You can use the JCraft to do the ssh connection. JCraft can help you to make the command typed on your phone works well on the server(here is the computer on the robot). To do that, you can refer to the official example: Shell.java in http://www.jcraft.com/jsch/examples/Shell.java.html . If you run the Shell.java program, you can type command via System.in. If you just want to make one command(for instance, roscore) work, you can change the official program like this:

InputStream stream = new ByteArrayInputStream("roscore\n".getBytes(StandardCharsets.UTF_8));
channel.setInputStream(stream);

Then, you will find that roscore works once you start the program.