zoukankan      html  css  js  c++  java
  • ROS运行

    • 第一个吉祥物测试

    小乌龟

    第一个终端$roscore
    第二个终端$rosrun turtlesim turtlesim_node
    第三个终端$rosrun turtlesim turtle_teleop_key
    • 第二个ROS-Academy-for-Beginners教学包

    在src文件夹下

    git clone https://github.com/sychaichangkun/ROS-Academy-for-Beginners

    在ws工作空间下安装依赖项

    $cd tutorial_ws
    $rosdep install --from-paths src --ignore-src --rosdistro=melodic -y

    报错如下有几个软件包无法下载,要不运行 apt-get update 或者加上 --fix-missing 的选项再试试?

    解决参考https://blog.csdn.net/weixin_38102771/article/details/95679348

    其实就是重新sudo apt-get update 更新,因为报错时也提示了

    E: 有几个软件包无法下载,要不运行 apt-get update 或者加上 --fix-missing 的选项再试试?
    ERROR: the following rosdeps failed to install
    apt: command [sudo -H apt-get install -y ros-melodic-gmapping] failed

    所以重新开一个终端更新了一下,再运行一次就ok了

    然后在ws工作空间下编译catkin_make

    刷新工作空间!!!编译完成后,不刷新工作空间环境,就找不到工作空间

    法一
    $source ~/tutorial_ws/devel/setup.bash
    法二
    rospack profile

    或者为了打开终端就能够运行工作空间中编译好的ROS程序,习惯把法一追加到~/.bashrc中

    $echo "source ~/tutorial_ws/devel/setup.bash" >> ~/.bashrc

    运行仿真

    打开终端

    刷新环境
    $rospack profile

    再输入

    $roslaunch robot_sim_demo robot_spawn.launch

    打开终端输入

    $rosrun robot_sim_demo robot_keyboard_teleop.py

    则可以使用i,j,k等按键控制机器人移动。

    •  遇到的问题1

    [REST.cc:205] Error in REST request

    参考https://blog.csdn.net/qq_43802597/article/details/97996255

    参考https://answers.gazebosim.org//question/23303/err-clientconfigcc270-parser-error-4/

    解决办法是

    $ sudo gedit ~/.ignition/fuel/config.yaml

    然后将 url : https://api.ignitionfuel.org 用 # 注释掉
    添加 url: https://api.ignitionrobotics.org

    • 遇到的问题2

     但是,由于下载的是kinect版本的软件包https://github.com/DroidAITech/ROS-Academy-for-Beginners,只能显示地面,所以我找到了新的软件包

    https://github.com/DroidAITech/ROS-Academy-for-Beginners-Book-Melodic

    根据提示先升级gazebo到9.1

    升级完了发现gazebo -v不起作用了

    报错如下

    gazebo: symbol lookup error: /usr/lib/x86_64-linux-gnu/libgazebo_common.so.9: undefined symbol: _ZN8ignition10fuel_tools12ClientConfig12SetUserAgentERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE

    参考https://blog.csdn.net/qq_42703283/article/details/84484112

    做更新

    sudo apt upgrade libignition-math2

    成功!显示

    ~$ gazebo -v
    Gazebo multi-robot simulator, version 9.13.0
    Copyright (C) 2012 Open Source Robotics Foundation.
    Released under the Apache 2 License.
    http://gazebosim.org

    这下版本够高了吧!哈哈哈

  • 相关阅读:
    UVA11039
    UVA10970大块巧克力
    UVA10970大块巧克力
    UVA10340子序列
    UVA10340子序列
    UVA10382喷水装置
    UVA10382喷水装置
    UVA10020(最小区间覆盖)
    洛谷 P2141 珠心算测验
    UVa 11292 勇者斗恶龙(The Dragon of Loowater)
  • 原文地址:https://www.cnblogs.com/momeiwufeng/p/12631594.html
Copyright © 2011-2022 走看看