I am working on a project in which I am writing code in c++ that is used to open a new terminal window and run a second program in that window. So far I have:
void MoveFoward()
{
using namespace std;
system( "gnome-terminal --window" );
}
this opens a second terminal window, but how do I get the program to point to that second window to send commands in the format:
the program I want to run in the second terminal is designed to walk a robot using keyboard commands entered through the terminal.
I am writing a program to automate this using vision. So I want the first program to open a new terminal, run the walker program in the new terminal, and send keyboard commands based on the robot's vision to walk the robot with no user input. The vision part and opening the terminal I have figured out, I just dont know how to print keyboard commands to a different terminal.
for example, to tell the robot to walk forward, the user enters "i"
So in program 1, there would be a line:
system( "i" );
but this attempts the print char "i" in the terminal that the first program is running