最新要闻

广告

手机

iphone11大小尺寸是多少?苹果iPhone11和iPhone13的区别是什么?

iphone11大小尺寸是多少?苹果iPhone11和iPhone13的区别是什么?

警方通报辅警执法直播中被撞飞:犯罪嫌疑人已投案

警方通报辅警执法直播中被撞飞:犯罪嫌疑人已投案

家电

全球微速讯:gazebo小车模型(附带仿真环境)

来源:博客园


(资料图片)

gazebo小车模型(附带仿真环境)

参考链接

1、(https://blog.csdn.net/qq_43406338/article/details/109600827?ops_request_misc={"request_id"%3A"168087043216800182749128"%2C"scm"%3A"20140713.130102334.pc_all."}&request_id=168087043216800182749128&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2allfirst_rank_ecpm_v1~rank_v31_ecpm-1-109600827-null-null.142v82insert_down1,201v4add_ask,239v2insert_chatgpt&utm_term=Resource not found%3A gazebo_ros ROS path [0]%3D%2Fopt%2Fros%2Fmelodic%2Fshare%2Fros ROS path [1]%3D%2Fhome%2Fyehuo%2Fmycar_ws%2Fsrc ROS path [2]%3D%2Fopt%2Fros%2Fmelodic%2Fshare The traceback for the exception was written to the log &spm=1018.2226.3001.4187)2、(https://blog.csdn.net/samsu0108/article/details/121686776?ops_request_misc=&request_id=&biz_id=102&utm_term=[Err] [REST.cc:205] Error in R&utm_medium=distribute.pc_search_result.none-task-blog-2allsobaiduweb~default-0-121686776.142v82insert_down1,201v4add_ask,239v2insert_chatgpt&spm=1018.2226.3001.4187)3、(https://blog.csdn.net/qq_39400324/article/details/125051463?ops_request_misc=&request_id=&biz_id=102&utm_term=Error [Converter.cc:151] Unabl&utm_medium=distribute.pc_search_result.none-task-blog-2allsobaiduweb~default-0-125051463.142v82insert_down1,201v4add_ask,239v2insert_chatgpt&spm=1018.2226.3001.4187)4、(http://www.autolabor.com.cn/book/ROSTutorials/di-6-zhang-ji-qi-ren-xi-tong-fang-zhen/66-urdfji-cheng-gazebo.html)5、(https://www.bilibili.com/video/BV1Ci4y1L7ZZ?p=271&vd_source=4acdb875c05ce9dccfce3cd6cfaac651)

成果图

    STEP1:创建工作空间

    mkdir -p mycar_ws/srccd mycarcatkin_make

    STEP2:在vscode中准备需要的文件夹

      右键src,点击Create Catkin Package先输入包名:mycar再输入依赖工具:urdf xacro gazebo_ros gazebo_ros_control gazebo_plugins

      STEP3:在vscode中准备需要的文件夹

      在mycar目录下依次创建 launch、urdf、worlds文件夹在 mycar/urdf 文件夹下再创建 xacro文件夹结构如下图所示

        STEP4:mycar/launch

        创建 environment.launch 文件

          mycar/launch/environment.launch

                                  

          STEP5:下载worlds文件夹下需要的文件

          终端输入命令git clone https://github.com/zx595306686/sim_demo.git得到以下文件

            将第三个文件 box_house.world 复制到mycar_ws中创建的worlds文件夹下

              STEP6:mycar/urdf/xacro

              创建以下文件

                mycar/urdf/xacro/car_base.urdf.xacro

                                                                                                                                                                                                                                                                      Gazebo/Yellow                                                                                                                                                                                                                      Gazebo/Red                                                                                                                                                                                                                                                                       Gazebo/Red                                                                      

                mycar/urdf/xacro/car_camera.urdf.xacro

                                                                                                                                                                                                                                   Gazebo/Blue                                        

                mycar/urdf/xacro/car_laser.urdf.xacro

                                                                                                                                                                                                                                                          Gazebo/Grey                                                                                                                                                                                                                                                 Gazebo/Black                                    

                mycar/urdf/xacro/car.urdf.xacro

                                

                mycar/urdf/xacro/inertial_matrix.xacro

                                                                                                                                                                        

                STEP7:运行

                启动 roscore

                建议在vscode外终端启动(也可在vscode中启动)

                  设置环境变量,启动gazebo

                  在vscode中新建终端注意要进入 mycar_ws 路径下依次执行以下命令

                    出现如下画面即代表创建成功第一次创建时可检查一下左栏选项是否一致

                      常见问题汇总

                      1、ResourceNotFound: gazebo_ros

                      ResourceNotFound: gazebo_rosROS path [0]=/opt/ros/kinetic/share/rosROS path [1]=/home/park/catkin_ws/srcROS path [2]=/opt/ros/kinetic/share
                      问题:找不到资源解决办法:直接安装缺失的gazebo:$ sudo apt-get install ros-kinetic-gazebo-ros-pkgs ros-kinetic-gazebo-ros-control

                      2、[Err] [REST.cc:205] Error in REST request Gazebo 启动报错

                        1、在终端输入命令   sudo vim ~/.ignition/fuel/config.yaml2、将https://api.ignitionfuel.org替换为https://fuel.ignitionrobotics.org

                        3、Unable to convert from SDF version 1.7 to 1.6

                          将 environment.world文件 中第一行的该为即可。

                            关键词: