2 The push command pushes the local workspace to the 3 remote workspace, making it identical to the current workspace. 5 Copyright 2015 Fetch Robotics Inc. 13 from ..util
import ssh, add_user, add_robot, add_workspace
16 help_text =
"Push the workspace to the robot" 20 print "Pushing %s/src to %s@%s:%s/src" % (
21 args.workspace, args.user, args.robot, args.remote_workspace
25 proc = subprocess.Popen(
29 "--rsync-path",
"mkdir -p " + args.remote_workspace +
" && rsync",
32 args.workspace +
"/src",
33 args.user +
"@" + args.robot +
":" + args.remote_workspace +
"/"]
36 if proc.returncode != 0:
37 print "ERROR: Syncing failed" 42 ssh(args.user, args.robot,
43 "cd "+args.remote_workspace+
" && " 44 "source devel/setup.bash && " 46 "rosdep install --from-paths src --ignore-src -y")
49 if args.build
is not None:
50 for build
in args.build:
51 build = build
if build
is not None else "" 52 if args.build_type !=
"default":
53 build +=
" -DCMAKE_BUILD_TYPE="+args.build_type
54 command =
"source /opt/ros/" + os.getenv(
"ROS_DISTRO") + \
55 "/setup.bash && cd " + args.remote_workspace + \
56 " && catkin_make " + build
57 if ssh(args.user, args.robot, command) != 0:
58 print "ERROR: Build failed" 66 parser.add_argument(
"--install-deps", action=
"store_true",
67 help=
"Install dependencies using rosdep")
68 parser.add_argument(
"--build", nargs=
"?", action=
"append",
69 help=
"Build after syncing")
70 parser.add_argument(
"--build-type", action=
"store", default=
"default",
71 choices=[
"Debug",
"Release",
"RelWithDebInfo",
"MinSizeRel",
"default"],
72 help=
"Type of build to use `default`, `Debug`, `Release`, and `RelWithDebInfo`")