“ROS机器人操作系统”的版本间的差异
(→问题处理) |
(→参考资料) |
||
| 第106行: | 第106行: | ||
===重要网站=== | ===重要网站=== | ||
| + | *[http://wiki.ros.org/ ROS WIKI] | ||
*[http://wiki.ros.org/Distributions ROS版本情况列表] | *[http://wiki.ros.org/Distributions ROS版本情况列表] | ||
*[http://repositories.ros.org/status_page 各个版本迁移工作进展] | *[http://repositories.ros.org/status_page 各个版本迁移工作进展] | ||
2022年11月22日 (二) 12:32的版本
百科首页 | 3D虚拟世界 | 音乐与人工智能 | 人工智能机器人 | 关于我们 | 网站首页
ROS系统安装 | 基本操作
基本操作
catkin build--编译包 catkin clean--清空编译空间 catkin config--配置编译工作空间 catkin create--创建包 catkin env--环境变量工具 catkin init--初始化编译空间 catkin list--查看包信息 catkin locate--定位编译目录 catkin profile--指定编译配置 catkin test--测试包
- ROS环境变量配置
# Set ROS melodic
source /opt/ros/melodic/setup.bash
source ~/catkin_ws/devel/setup.bash
# Set ROS Network
export ROS_HOSTNAME=xxx.xxx.xxx.xxx
export ROS_MASTER_URI=http://${ROS_HOSTNAME}:11311
# Set ROS alias command
alias cw='cd ~/catkin_ws'
alias cs='cd ~/catkin_ws/src'
alias cm='cd ~/catkin_ws && catkin_make'
- 可以用export | grep ROS命令检查当前的ROS配置。
问题处理
ROS安装:Ubuntu 18.04+ROS Melodic ROS安装
- E: 无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系。
- appstreamcli:8672: GLib-ERROR **: 15:31:38.631: g_variant_new_parsed: 11-13:invalid GVariant forma,执行“sudo apt-get install --reinstall libappstream4”可修复
- 安装过程中如果出现下载文件不了的情况中断,可以执行一遍“sudo apt-get update”,重新执行“sudo apt install ros-melodic-desktop-full”
- rosdep update执行时出现无法下载的问题,可以参考这篇文中第3部分采用GIT方式,GIT包我已经下载好。ERROR: unable to process source [https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-…… ROS安装教程 解决raw.github无法访问的问题
运行乌龟案例
- Skipped loading plugin with error: XML Document '/opt/ros/melodic/share/rqt_virtual_joy/plugin.xml' has no Root Element
新建“/opt/ros/melodic/share/rqt_virtual_joy/plugin.xml”文件,然后输入以下内容,重启节点绘制程序
<library path="src">
<class name="My Plugin" type="rqt_virtual_joy.virtual_joy_module.MyPlugin" base_class_type="rqt_gui_py::Plugin">
<description>
An example Python GUI plugin to create a great user interface.
</description>
<qtgui>
<group>
<label>Robot Tools</label>
</group>
<!-- <group>
<label>Subgroup</label>
</group> -->
<label>Virtual Joystick</label>
<icon type="file">resource/input-gaming.png</icon>
<statustip>Great user interface to provide real value.</statustip>
</qtgui>
</class>
</library>
Ubuntu的问题处理
- Ubuntu怎么解决vi编辑器按上下左右变成ABCD的问题
- 在使用vi编辑/etc/profile文件时,编辑状态下按上下左右键变成ABCD。此时,先按Esc退出编辑状态,然后输入:q!退出文件编辑。
- 会出现该问题的原因是原有的vim-common组件有问题,可以通过卸载原有的vim-common组件,安装新的vim来解决这个问题。
- 在退出文件编辑后使用命令:“sudo apt-get remove vim-common”,卸载原先的vim-common组件。
- 卸载完成后使用命令,“sudo apt-get install vim”,安装vim。可以解决
- 安装图形化远程桌面(确保之前已经安装了gnome图形化桌面)
1、安装XRDP服务
sudo apt install -y xrdp #安装xrdp
sudo sed -i 's/port=3389/port=3390/g' /etc/xrdp/xrdp.ini #修改默认端口,默认端口是3389,和win端是相通的,避免出问题,改到3390
sudo ufw allow 3390 #配置防火墙
sudo service xrdp restart #每次重启Ubuntu后都要重启xrdp服务
2、输入密码后闪退
在用户目录新建“.xsession”文件。输入:gnome-session
3、远程后老让输入密码:Authentication is required to create a color managed device
新建文件“/etc/polkit-1/localauthority.conf.d/02-allow-colord.conf”输入下面内容:
polkit.addRule(function(action, subject) {
if ((action.id == "org.freedesktop.color-manager.create-device" ||
action.id == "org.freedesktop.color-manager.create-profile" ||
action.id == "org.freedesktop.color-manager.delete-device" ||
action.id == "org.freedesktop.color-manager.delete-profile" ||
action.id == "org.freedesktop.color-manager.modify-device" ||
action.id == "org.freedesktop.color-manager.modify-profile") &&
subject.isInGroup("{group}")) {
return polkit.Result.YES;
}
});
4、获取原生态桌面
vim ~/.xsessionrc
添加:
export GNOME_SHELL_SESSION_MODE=ubuntu
export XDG_CURRENT_DESKTOP=ubuntu:GNOME
export XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg