run.py
Go to the documentation of this file.
1 """
2 The run command runs a command remotely on a robot.
3 
4 Copyright 2015 Fetch Robotics Inc.
5 Author: Alex Henning
6 """
7 
8 import sys
9 
10 from ..util import ssh, add_user, add_robot, add_workspace
11 
12 name = "run"
13 help_text = "Run a command on the robot"
14 
15 
16 def main(args):
17  print "%s@%s$ %s" % (args.user, args.robot, args.command)
18  if ssh(args.user, args.robot,
19  "source "+args.remote_workspace+"/devel/setup.bash && "+args.command) != 0:
20  print "ERROR: Command crashed"
21  sys.exit(-1)
22 
23 
24 def add_arguments(parser):
25  add_user(parser)
26  add_robot(parser)
27  add_workspace(parser)
28  parser.add_argument("command", action="store", default="bash",
29  help="Command and args to run remotely")
def add_workspace(parser)
Definition: util.py:64
def ssh(user, host, command, password=None, fname=None)
Definition: util.py:12
def add_robot(parser)
Definition: util.py:59
def main(args)
Definition: run.py:16
def add_user(parser)
Definition: util.py:53
def add_arguments(parser)
Definition: run.py:24


fetch_tools
Author(s): Alex Henning
autogenerated on Mon Feb 28 2022 22:19:10