gazebo-tooling / gzdev

Gazebo developers tool is an Outreachy project designed to facilitate many of the usual tasks that Gazebo developers face daily
Other
14 stars 3 forks source link

gzdev CI Build Status

gzdev is a command line tool that facilitates the development of the open source robotics simulator Gazebo. The tool aims to streamline many of the usual tasks that Gazebo developers face on a daily basis.

Installation

Prerequisites

  1. Clone the repository:

    git clone https://github.com/gazebo-tooling/gzdev.git && cd gzdev
  2. Install the necessary python packages docker, docopt, and pytest (optional). Also install rocker and ign-rocker for the ign-docker-env command:

    pip3 install -r requirements.txt
  3. Create an alias pointing to the core python script and add it to your ~/.bashrc (be sure to update the path in the command below):

    alias gzdev=/ABSOLUTE/PATH/TO/gzdev.py

Usage

core

Streamline many of the usual tasks that Gazebo developers face on a daily basis.

Usage:
    gzdev [--version] [--help]
          <command> [<args>...]
    gzdev -h | --help
    gzdev --version

Options:
    -h --help      Show this screen.
    --version      Show gzdev's version.

Commands/Plugins:
    ign-docker-env Launch docker environments ready for Ignition development
        repository     Enable/Disable gazebo repositories.

ign-docker-env

(this command uses rocker and ign-rocker - take a look at these repositories for more information)

Launch docker environments ready for Ignition development

Usage:
    gzdev ign-docker-env IGN_RELEASE
                [--linux-distro <linux-distro>]
                [--rocker-args ROCKER_ARGS]
                [--vol $LOCAL_PATH:$CONTAINER_PATH[::$LOCAL_PATH:$CONTAINER_PATH ...]]
    gzdev ign-docker-env -h | --help
    gzdev ign-docker-env --version

Options:
    -h --help                           Show this screen
    --version                           Show gzdev's version
    --linux-distro linux-distro         Linux distibution to use in docker env
    --rocker-args ROCKER_ARGS           Extra rocker arguments, captured in single quotes and separated by white space
    --vol $LOCAL_PATH:$CONTAINER_PATH   Load volumes into docker container (separate multiple volumes with '::')

Basic examples

Using ign-docker-env to build Ignition repositories from source

  1. Install vcstool
  2. Create a colcon workspace:
    mkdir -p ~/colcon_ws/src/
    export COLCON_WS_PATH=~/colcon_ws/
  3. Determine the ignition version you'd like to work with (can be something like citadel or dome):
    export IGN_DISTRO=citadel
  4. Get all of the repositories needed to build IGN_DISTRO from source:
    cd ~/colcon_ws/src/
    wget 'https://raw.githubusercontent.com/gazebo-tooling/gazebodistro/master/collection-'$IGN_DISTRO'.yaml'
    vcs import < 'collection-'$IGN_DISTRO'.yaml'
  5. Modify the repositories as needed (check out branches, make commits, etc.), and delete any repositories that you don't need to build from source
  6. Start a container with your specified Ignition version, loading your colcon workspace into the container:
    gzdev ign-docker-env $IGN_DISTRO --vol $COLCON_WS_PATH:/ws
  7. Build the repositories in the workspace with colcon. Make sure you go to the root of the workspace first:
    cd /ws

    Run the following command if you want to build tests:

    colcon build --merge-install

    Run the following command if you don't want to build tests:

    colcon build --merge-install --cmake-args -DCMAKE_BUILD_TESTING=0
  8. Source the workspace:
    . /ws/install/setup.bash
  9. Use Ignition!

repository

System operations to manage extra repositories affecting Gazebo/Ignition/ROS

Usage:
    gzdev repository (ACTION) [<repo-name>] [<repo-type>] [--project=<project_name>]
        gzdev repository list
    gzdev repository (-h | --help)
    gzdev repository --version
Action:
        enable                  Enable repository in the system
        disable                 Disable repository (if present)
        list                    List repositories enabled
Options:
    -h --help               Show this screen
    --version               Show gzdev's version

Basic examples

gzdev repository enable osrf prerelease

Per project configuration

Some projects require prerelease or nigthly repositories in order to work in early stages.

gzdev repository enable --project=ignition-math6

The repository.yaml configuration file

The repository module uses a yaml configuration file to specify the following information used by the code.

repositories metadata

projects metadata

The --project argument allows gzdev to configure group of the repositories to use and/or add some extra requirements.

Note: project entries in the yaml are processed by order. The first one matching the project name and other requirements is the only one executed.

Support/Contribute

License

The project is licensed under the Apache License, Version 2.0.