2 The pull command pulls the remote workspace to the local workspace, 3 making it identical to the workspace on the robot.. 5 Copyright 2015 Fetch Robotics Inc. 14 from ..util
import run, add_user, add_robot, add_workspace
17 help_text =
"Pull the robots workspace onto the current workspace, losing any differences" 21 print "Pulling %s@%s:%s/src to %s/src " % (
22 args.user, args.robot, args.remote_workspace, args.workspace,
25 if not args.no_safety
and raw_input(
"Risk losing local workspace (y/n): ")
not in [
"y",
"yes"]:
26 print "Giving up, better luck next time." 30 proc = subprocess.Popen(
34 "--rsync-path",
"mkdir -p " + args.remote_workspace +
" && rsync",
37 args.user +
"@" + args.robot +
":" + args.remote_workspace +
"/src",
41 if proc.returncode != 0:
42 print "ERROR: Syncing failed" 47 run(
"cd "+args.workspace+
" && " 48 "source devel/setup.bash && " 50 "rosdep install --from-paths src --ignore-src -y")
53 if args.build
is not None:
54 for build
in args.build:
55 build = build
if build
is not None else "" 56 if args.build_type !=
"default":
57 build +=
" -DCMAKE_BUILD_TYPE="+args.build_type
58 command =
"source /opt/ros/" + os.getenv(
"ROS_DISTRO") + \
59 "/setup.bash && cd " + args.workspace + \
60 " && catkin_make " + build
62 print "ERROR: Build failed" 70 parser.add_argument(
"--install-deps", action=
"store_true",
71 help=
"Install dependencies using rosdep")
72 parser.add_argument(
"--build", nargs=
"?", action=
"append",
73 help=
"Build after syncing")
74 parser.add_argument(
"--build-type", action=
"store", default=
"default",
75 choices=[
"Debug",
"Release",
"RelWithDebInfo",
"MinSizeRel",
"default"],
76 help=
"Type of build to use `default`, `Debug`, `Release`, and `RelWithDebInfo`")
77 parser.add_argument(
"--no-safety", action=
"store_true",
78 help=
"Don't prompt about overwriting the local workspace")