You could probably bypass the whole socket/command-line thing and have it periodically check the robot's local storage for a text file with a certain name.
Something like
Code:
while(true)
{
// not shown: feeding watchdog or disabling it
ifstream in;
in.open("commands.txt");
while(!in.fail() && !in.eof) // if we managed to open the file, and it has contents...
{
int motorChannel;
float motorPower;
in>>motorChannel; // loads the channel we want to output on
in>>motorPower; // loads how fast we want to run the output
PWM pwm(motorChannel); // declares an interface to the channel
pwm.Set(motorPower); // outputs the desired amount
Wait(5.0); // lets it run for awhile
pwm.Set(0.0); // turns the motor off
}
Wait(5.0); // don't constantly check the storage device.
}
You could then just FTP the commands.txt file to your robot whenever you wanted to run something.
The commands.txt file would just look like <motor channel> <motor power>. i.e.
Code:
4 0.5
4 -0.5
3 1.0
3 0.5
3 0.25
3 0.0