# Duckietown Shell
*Duckietown Shell* is a pure Python, easily distributable (no dependencies) utility for Duckietown.
The idea is that most of the functionality is implemented as Docker containers, and `dt-shell` provides a nice interface for that, so that user should not type a very long `docker run` command line.
## Prerequisites
You must be using `pip` with Python 2.x to use Duckietown Shell:
$ pip --version # Should return something like: pip 18.0 from ...python2.7/site-packages/pip (python 2.7)
If not, first install `virtualenv`:
$ pip install virtualenv
Then create a new virtual environment, `dts`:
$ virtualenv -p <PATH_TO_PYTHON2_BINARY> dts
Then activate the `dts` environment:
$ source dts/bin/activate
(dts) $
Now, you now should be ready to install duckietown-shell. To deactivate `dts` later, run `deactivate`.
## Installation
These installation steps make sure that you have a minimal "sane" environment, which includes:
1. Git and Git LFS;
2. Docker;
3. The Duckietown Shell.
### Installation on Ubuntu 18.xx
Installs pip, git, git-lfs, docker, duckietown-shell:
$ sudo apt install -y python-pip git git-lfs
$ sudo apt install -y docker.io
$ sudo adduser `whoami` docker
$ sudo pip install --no-cache-dir -U duckietown-shell
Note: you need to *log in and out* to have the group change take effect.
### Installation on Ubuntu 16.xx
Installs pip, git, git-lfs, docker, duckietown-shell:
$ sudo apt-get install software-properties-common curl
$ sudo add-apt-repository ppa:git-core/ppa
$ curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
$ sudo apt-get install -y python-pip git git-lfs
$ curl -fsSL https://get.docker.com | sudo bash
$ sudo usermod -aG docker `whoami`
$ sudo pip install --no-cache-dir -U duckietown-shell
Note: you need to *log in and out* to have the group change take effect.
### Installation in other operating systems
You will need to find the instructions for git, git-lfs, docker.
To install the shell, use:
$ sudo pip install --no-cache-dir -U duckietown-shell
The shell itself does not require any other dependency beside standard cross-platform Python libraries.
-----------------------
## Commands for compiling the Duckumentation
To compile one of the books:
$ git clone https://github.com/duckietown/docs-duckumentation.git
$ cd docs-duckumentation
$ git submodule init
$ git submodule update
$ dts docs build
There is an incremental build system. To clean and run from scratch:
$ dts docs clean
$ dts docs build
TODO: link to docs
-----------------------
## Duckietown Authentication Token setup
Run the command `dts tok set` to set the Duckietown authentication token:
$ dts tok set
Instructions will guide you and you will be prompted for the token.
If you already know the token, then you can use:
$ dts tok set dt1-YOUR-TOKEN
### Verifying that a token is valid
To verify that a token is valid, you can use:
$ dts tok verify dt1-TOKEN-TO-VERIFY
This exits with 0 if the token is valid, and writes on standard output the following json:
{"uid": 3, "expiration": "2018-09-23"}
which means that the user is identified as uid 3 until the given expiration date.
-----------------------
## Commands for Duckiebot setup
### Command for flashing SD card
This command will install DuckieOS on the SD-card:
$ dts init_sd_card
-----------------------
### Command for starting ROS GUIs
This command will start the ROS GUI container:
$ dts start_gui_tools <DUCKIEBOT_NAME_GOES_HERE>
-----------------------
### Command for calibrating the Duckiebot
This command will run the Duckiebot calibration procedure:
$ dts calibrate_duckiebot <DUCKIEBOT_NAME_GOES_HERE>
-----------------------
## Commands for AI-DO 1
### (TODO) AI-DO templates download
*Not implemented yet*
The subcommand `get-template` downloads the submission templates.
Downloads the current template:
$ dts aido1 get-template TASK-LANG
checking out repository...
Without arguments, the program writes a list of available templates.
### (TODO) AI-DO submissions
*Not implemented yet*
The command `submit` submits the entry in the current directory:
$ dts aido1 submit
### (TODO )Submissions status
The command `status` displays the status of the submitted entries:
$ dts aido1 status
jobname task docker hash status
jobname task docker hash status
...
-----------------------
## (TODO) Commands for logs
Wrappers are provided for the [EasyLogs commands][easy_logs].
$ dts logs summary
$ dts logs download
$ dts logs copy
$ dts logs details
$ dts logs make-thumbnails
$ dts logs make-video
[easy_logs]: http://docs.duckietown.org/software_devel/out/easy_logs.html
### Summary, details
Queries the list of logs that satisfy a query:
$ dts logs summary "vehicle:yaf,length:>120s"
Show more details about one log:
$ dts logs details 20171124170042_yaf
### Download, copy
Downloads logs to the local computer:
$ dts logs download 20171124170042_yaf
Copies the logs to a specific directory:
$ dts logs copy -o ![output dir] 20171124170042_yaf
Creating ![output dir]/20171124170042_yaf.bag
### Creating thumbnails
$ dts logs make-thumbnails 20171124170042_yaf
### Creating videos:
Create a video of the camera data:
$ dts logs make-videos 20171124170042_yaf
### Advanced configuration
By default, Duckietown Shell uses the folder `~/dt-data` for storing log data and other cache data.
Alternatively, you can use the `--dt-data` argument to choose a different folder:
$ dts logs --dt-data ![dir] ![command]
Alternatively, the directory can be specified using the environment variable `DT_DATA`.
$ DT_DATA=/tmp/data dt logs summary
-----------------------
## Information for Duckietown Shell developers
### Docker
To launch the Duckietown Shell in Docker, run the following command:
$ docker run -it duckietown/duckietown-shell
Note: the Duckietown Shell is supposed to be run natively from the host.
### Local commands development
Use the env variable to work on your local copy of the commands:
export DTSHELL_COMMANDS=/path/to/my/duckietown-shell-commands
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
共29个文件
py:12个
txt:6个
cfg:2个
资源分类:Python库 所属语言:Python 资源全名:duckietown-shell-0.2.39.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源推荐
资源详情
资源评论
收起资源包目录
duckietown-shell-0.2.39.tar.gz (29个子文件)
duckietown-shell-0.2.39
PKG-INFO 300B
LICENSE.pdf 74KB
Dockerfile 324B
setup.cfg 38B
requirements.txt 135B
setup.py 2KB
.gitignore 34B
lib
duckietown_shell.egg-info
PKG-INFO 300B
requires.txt 166B
not-zip-safe 1B
SOURCES.txt 723B
entry_points.txt 66B
top_level.txt 9B
dependency_links.txt 1B
__init__.py 25B
dt_shell
constants.py 434B
cli.py 14KB
dt_command_placeholder.py 165B
tokens_cli.py 2KB
version_check.py 3KB
dt_command_abs.py 3KB
env_checks.py 3KB
__init__.py 1KB
remote.py 5KB
duckietown_tokens.py 4KB
.circleci
config.yml 964B
Makefile 171B
README.md 6KB
.bumpversion.cfg 98B
共 29 条
- 1
资源评论
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功