ROS编译过程依赖问题快速解决命令

rosdep命令官方介绍

Usage: rosdep [options]

Commands:

rosdep check …
check if the dependencies of package(s) have been met.

rosdep install …
download and install the dependencies of a given package or packages.

rosdep db
generate the dependency database and print it to the console.

rosdep init
initialize rosdep sources in /etc/ros/rosdep. May require sudo.

rosdep keys …
list the rosdep keys that the packages depend on.

rosdep resolve
resolve to system dependencies

rosdep update
update the local rosdep database based on the rosdep sources.

rosdep what-needs …
print a list of packages that declare a rosdep on (at least
one of)

rosdep where-defined …
print a list of yaml files that declare a rosdep on (at least
one of)

rosdep fix-permissions
Recursively change the permissions of the user’s ros home directory.
May require sudo. Can be useful to fix permissions after calling
“rosdep update” with sudo accidentally.

Options:
-h, --help show this help message and exit
–os=OS_NAME:OS_VERSION
Override OS name and version (colon-separated), e.g.
ubuntu:lucid
-c SOURCES_CACHE_DIR, --sources-cache-dir=SOURCES_CACHE_DIR
Override /home/sks/.ros/rosdep/sources.cache
-v, --verbose verbose display
–version print just the rosdep version, then exit
–all-versions print rosdep version and version of installers, then
exit
–reinstall (re)install all dependencies, even if already
installed
-y, --default-yes Tell the package manager to default to y or fail when
installing
-s, --simulate Simulate install
-r Continue installing despite errors.
-q Quiet. Suppress output except for errors.
-a, --all select all packages
-n Do not consider implicit/recursive dependencies. Only
valid with ‘keys’, ‘check’, and ‘install’ commands.
-i, --ignore-packages-from-source, --ignore-src
Affects the ‘check’, ‘install’, and ‘keys’ verbs. If
specified then rosdep will ignore keys that are found
to be catkin or ament packages anywhere in the
ROS_PACKAGE_PATH, AMENT_PREFIX_PATH or in any of the
directories given by the --from-paths option.
–skip-keys=SKIP_KEYS
Affects the ‘check’ and ‘install’ verbs. The specified
rosdep keys will be ignored, i.e. not resolved and not
installed. The option can be supplied multiple times.
A space separated list of rosdep keys can also be
passed as a string. A more permanent solution to
locally ignore a rosdep key is creating a local rosdep
rule with an empty list of packages (include it in
/etc/ros/rosdep/sources.list.d/ before the defaults).
–filter-for-installers=FILTER_FOR_INSTALLERS
Affects the ‘db’ verb. If supplied, the output of the
‘db’ command is filtered to only list packages whose
installer is in the provided list. The option can be
supplied multiple times. A space separated list of
installers can also be passed as a string. Example:
--filter-for-installers "apt pip"
–from-paths Affects the ‘check’, ‘keys’, and ‘install’ verbs. If
specified the arguments to those verbs will be
considered paths to be searched, acting on all catkin
packages found there in.
–rosdistro=ROS_DISTRO
Explicitly sets the ROS distro to use, overriding the
normal method of detecting the ROS distro using the
ROS_DISTRO environment variable. When used with the
‘update’ verb, only the specified distro will be
updated.
–as-root=INSTALLER_KEY:
Override whether sudo is used for a specific
installer, e.g. ‘–as-root pip:false’ or ‘–as-root
“pip:no homebrew:yes”’. Can be specified multiple
times.
–include-eol-distros
Affects the ‘update’ verb. If specified end-of-life
distros are being fetched too.
-t DEPENDENCY_TYPES, --dependency-types=DEPENDENCY_TYPES
Dependency types to install, can be given multiple
times. Choose from set([‘exec’, ‘doc’, ‘build_export’,
‘buildtool’, ‘test’, ‘build’, ‘buildtool_export’]).
Default: all except doc.

rosdep的安装

在Ubuntu电脑上:

sudo apt-get install python-rosdep
或者在非Ubuntu电脑上:

sudo pip install -U rosdep
安装完之后需要调用一次初始化:

sudo rosdep init
然后更新:(注意不要使用sudo rosdep update,否则后面会导致一些权限问题)

rosdep update

rosdep的使用

rosdep install AMAZING_PACKAGE
用于安装工作空间中所有包的依赖项
在你的ros工作空间中运行命令:

rosdep install --from-paths src -i -y
这样就可以自动将工作空间中所有包的依赖项都安装上。

现在才发现这个命令真的好用

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值