Exemplo n.º 1
0
def cmd_generate_ros_files(config, path, nobuild=False, rosdep_yes=False, catkin=False, catkinpp=None, no_ros_allowed=False):
    """
    Generates ROS specific setup files
    """

    # Catkin must be enabled if catkinpp is set
    if catkinpp is not None:
        catkin = True

    ## bootstrap the build if installing ros
    if catkin:
        setupfiles.generate_catkin_cmake(path, catkinpp)

    else:  # DRY install case
        ## Generate setup.sh and save
        print("(Over-)Writing setup.sh, setup.bash, and setup.zsh in %s" % config.get_base_path())
        setupfiles.generate_setup(config, no_ros_allowed)

        if _ros_requires_boostrap(config) and not nobuild:
            print("Bootstrapping ROS build")
            rosdep_yes_insert = ""
            if rosdep_yes:
                rosdep_yes_insert = " --rosdep-yes"
            ros_comm_insert = ""
            if 'ros_comm' in [os.path.basename(tree.get_path()) for tree in config.get_config_elements()]:
                print("Detected ros_comm bootstrapping it too.")
                ros_comm_insert = " ros_comm"
            subprocess.check_call("source %s && rosmake ros%s --rosdep-install%s" % (os.path.join(path, 'setup.sh'), ros_comm_insert, rosdep_yes_insert), shell=True, executable='/bin/bash')
Exemplo n.º 2
0
def cmd_maybe_refresh_ros_files(config):
    """
    Regenerates setup.* files if they exist already
    """
    if (os.path.isfile(os.path.join(config.get_base_path(), 'setup.sh'))):
        print("Overwriting setup.sh, setup.bash, and setup.zsh in %s" % config.get_base_path())
        setupfiles.generate_setup(config, no_ros_allowed=True)
def cmd_generate_ros_files(config,
                           path,
                           nobuild=False,
                           rosdep_yes=False,
                           catkin=False,
                           catkinpp=None,
                           no_ros_allowed=False):
    """
    Generates ROS specific setup files

    :param nobuild: Unless True, invokes rosmake to build all packages if core ROS stack is detected
    :param rosdep_yes: If True, adds --rosdep-yes to rosmake command
    :param catkin: if true, generates catkin(fuerte) CMakeLists.txt instead of invoking rosmake
    :param catkinpp: Prefix path for catkin if generating for catkin
    :param no_ros_allowed: if true, does not look for a core ros stack
    """

    # Catkin must be enabled if catkinpp is set
    if catkinpp is not None:
        catkin = True

    ## bootstrap the build if installing ros
    if catkin:
        setupfiles.generate_catkin_cmake(path, catkinpp)

    else:  # DRY install case
        ## Generate setup.sh and save
        print("(Over-)Writing setup.sh, setup.bash, and setup.zsh in %s" %
              config.get_base_path())
        setupfiles.generate_setup(config, no_ros_allowed)

        if _ros_requires_boostrap(config) and not nobuild:
            print("Bootstrapping ROS build")
            rosdep_yes_insert = ""
            if rosdep_yes:
                rosdep_yes_insert = " --rosdep-yes"
            ros_comm_insert = ""
            if 'ros_comm' in [
                    os.path.basename(tree.get_path())
                    for tree in config.get_config_elements()
            ]:
                print("Detected ros_comm bootstrapping it too.")
                ros_comm_insert = " ros_comm"
            cmd = ("source %s && rosmake ros%s --rosdep-install%s" %
                   (os.path.join(
                       path, 'setup.sh'), ros_comm_insert, rosdep_yes_insert))
            subprocess.check_call(cmd, shell=True, executable='/bin/bash')
Exemplo n.º 4
0
def cmd_generate_ros_files(config, path, nobuild=False, rosdep_yes=False, catkin=False, catkinpp=None, no_ros_allowed=False):
    """
    Generates ROS specific setup files

    :param nobuild: Unless True, invokes rosmake to build all packages if core ROS stack is detected
    :param rosdep_yes: If True, adds --rosdep-yes to rosmake command
    :param catkin: if true, generates catkin(fuerte) CMakeLists.txt instead of invoking rosmake
    :param catkinpp: Prefix path for catkin if generating for catkin
    :param no_ros_allowed: if true, does not look for a core ros stack
    """

    # Catkin must be enabled if catkinpp is set
    if catkinpp is not None:
        catkin = True

    ## bootstrap the build if installing ros
    if catkin:
        setupfiles.generate_catkin_cmake(path, catkinpp)

    else:  # DRY install case
        ## Generate setup.sh and save
        print("(Over-)Writing setup.sh, setup.bash, and setup.zsh in %s" %
              config.get_base_path())
        setupfiles.generate_setup(config, no_ros_allowed)

        if _ros_requires_boostrap(config) and not nobuild:
            print("Bootstrapping ROS build")
            rosdep_yes_insert = ""
            if rosdep_yes:
                rosdep_yes_insert = " --rosdep-yes"
            ros_comm_insert = ""
            if 'ros_comm' in [os.path.basename(tree.get_path()) for tree in config.get_config_elements()]:
                print("Detected ros_comm bootstrapping it too.")
                ros_comm_insert = " ros_comm"
            cmd = ("source %s && rosmake ros%s --rosdep-install%s" %
                   (os.path.join(path, 'setup.sh'),
                    ros_comm_insert,
                    rosdep_yes_insert))
            subprocess.check_call(cmd, shell=True, executable='/bin/bash')