“ROS机器人操作系统”的版本间的差异

来自人工智能助力教育知识百科
跳转至: 导航搜索
参考资料
基本操作
第31行: 第31行:
  
 
*可以用export | grep ROS命令检查当前的ROS配置。
 
*可以用export | grep ROS命令检查当前的ROS配置。
 +
 +
*在同一台电脑上运行同一个节点,需要重命名,方法一:#rosrun 包名 节点名 /节点名:="新的节点名";方法二:#rosrun 包名 节点名 __name:="新的节点名"
  
 
==问题处理==
 
==问题处理==

2022年11月26日 (六) 13:55的版本

网站首页 | 百科首页 | 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配置。
  • 在同一台电脑上运行同一个节点,需要重命名,方法一:#rosrun 包名 节点名 /节点名:="新的节点名";方法二:#rosrun 包名 节点名 __name:="新的节点名"

问题处理

ROS安装:Ubuntu 18.04+ROS Melodic ROS安装

运行乌龟案例

  • 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的问题
  1. 在使用vi编辑/etc/profile文件时,编辑状态下按上下左右键变成ABCD。此时,先按Esc退出编辑状态,然后输入:q!退出文件编辑。
  2. 会出现该问题的原因是原有的vim-common组件有问题,可以通过卸载原有的vim-common组件,安装新的vim来解决这个问题。
  3. 在退出文件编辑后使用命令:“sudo apt-get remove vim-common”,卸载原先的vim-common组件。
  4. 卸载完成后使用命令,“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

参考资料

重要网站

学习资料