Skip to content

Commit

Permalink
Fix local build launch_gripper (#1375)
Browse files Browse the repository at this point in the history
Co-authored-by: robopen07 <>
  • Loading branch information
1heart authored Oct 5, 2022
1 parent 2afb324 commit 144f7a6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions polymetis/polymetis/python/polymetis/utils/data_dir.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

PKG_ROOT_DIR = polymetis.__path__[0]
DATA_DIR = os.path.join(PKG_ROOT_DIR, "data")
BUILD_DIR = os.path.abspath(os.path.join(PKG_ROOT_DIR, "..", "..", "build"))


def get_full_path_to_urdf(path: str):
Expand Down
8 changes: 7 additions & 1 deletion polymetis/polymetis/python/scripts/launch_gripper.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,23 @@
# LICENSE file in the root directory of this source tree.

import os
import signal
import time
import logging

import hydra

from polymetis.robot_servers import GripperServerLauncher
from polymetis.utils.grpc_utils import check_server_exists
from polymetis.utils.data_dir import BUILD_DIR

log = logging.getLogger(__name__)


@hydra.main(config_name="launch_gripper")
def main(cfg):
log.info(f"Adding {BUILD_DIR} to $PATH")
os.environ["PATH"] = BUILD_DIR + os.pathsep + os.environ["PATH"]

if cfg.gripper:
pid = os.fork()
else:
Expand Down
8 changes: 3 additions & 5 deletions polymetis/polymetis/python/scripts/launch_robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# LICENSE file in the root directory of this source tree.

import os
import socket
import logging
import subprocess
import atexit
Expand All @@ -17,17 +16,16 @@
import hydra

from polymetis.utils.grpc_utils import check_server_exists
from polymetis.utils.data_dir import PKG_ROOT_DIR, which
from polymetis.utils.data_dir import BUILD_DIR, which


log = logging.getLogger(__name__)


@hydra.main(config_name="launch_robot")
def main(cfg):
build_dir = os.path.abspath(os.path.join(PKG_ROOT_DIR, "..", "..", "build"))
log.info(f"Adding {build_dir} to $PATH")
os.environ["PATH"] = build_dir + os.pathsep + os.environ["PATH"]
log.info(f"Adding {BUILD_DIR} to $PATH")
os.environ["PATH"] = BUILD_DIR + os.pathsep + os.environ["PATH"]

# Check if another server is alive on address
assert not check_server_exists(
Expand Down

0 comments on commit 144f7a6

Please sign in to comment.