I have a script (baxter.sh) that I use to connect to a Baxter robot (then I am able to use ros command on the robot)

Some demo of the robot need 3 to 4 command to be launched.

When I try to make a bash script it doesn't work as intended, it get stuck at the ./baxter.sh part, only processing the next command after the baxter.sh script is stopped (the baxter.sh open a new shell that allow command to be sent to the robot I think)

How can I do it so it would directly launch the other command in the shell that appeared with the use of ./baxter.sh ?

rosrun baxter_behaviour_arms baxter_astro_control_with_sound.py

This is how it look like when I do it by hand

  • Are the other commands actually bash shell commands, or are they commands that must be input to some kind of command processor on the robot? If the latter, then you probably need something like an expect script – steeldriver Jan 26 '18 at 13:55
  • Sorry for the late answer. The script seem to open a RSDK shell (this link give more information on the script) which allow communication with the robot. The command I'm launching are normal command (ROS command that come from the differents ros package you can find on ubuntu repository). – Eric Godard Feb 7 '18 at 10:04

If you login to a remote machine without password (using ssh keys) you can do the following trick ssh user@remoteMachine 'bash -s' < local_script.sh

Additional possible variants can be found in this topic

  • Thanks for your help but I don't think this would work. The script open a new shell (RSDK shell) that allow me to send ROS command (coming from ROS package on ubuntu repository) to the robot. I am not opening SSH connection like that (the script isn't either). Though I'm gonna keep your solution for when I want to execute script on a remote machine. Thanks. – Eric Godard Feb 7 '18 at 10:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.