【ROS-melodic Learning】——机器人导航(古月居代码报错与解决方案)

遇见的问题及解决方案

1. cannot launch node of type [arbotix_python/arbotix_driver]: arbotix_python

学习古月居ROS教程时,在导航那一节运行roslaunch mrobot_bringup fake_mrobot_with_laser.launch遇到以下问题:

ERROR: cannot launch node of type [arbotix_python/arbotix_driver]: arbotix_python
ROS path [0]=/opt/ros/melodic/share/ros
ROS path [1]=/home/yuan/catkin_ws/src
ROS path [2]=/opt/ros/melodic/share

解决方案
1.首先检查是否安装arbotix_python

 roscd arbotix_python

出现这个报错,说明未安装

roscd: No such package/stack 'arbotix_python'

接着安装arbotix_python

sudo apt-get install ros-melodic-arbotix

参考——cannot launch node of type [arbotix_python/arbotix_driver]: arbotix_python

2. Couldn’t find executable named XXX.py

运行rosrun mrobot_navigation random_navigation.py报错。

[rosrun] Couldn't find executable named random_navigation.py below /home/yuan/catkin_ws/src/mrobot_navigation
[rosrun] Found the following, but they're either not files,
[rosrun] or not executable:
[rosrun]   /home/yuan/catkin_ws/src/mrobot_navigation/scripts/random_navigation.py

原因——python文件未授权

解决方案

找到python文件所在目录
输入指令对python文件进行授权

chmod +x random_navigation.py

参考——学习笔记——解决“Couldn’t find executable named XXX.py”问题

3. Joint state with name: “base_l_wheel_joint” was received but not found in URDF

原因是在robot描述文件URDF中关节定义出错,找到launch文件使用的URDF描述文件,并将left_wheel_joint修改成base_l_wheel_joint,将right_wheel_joint修改为base_r_wheel_joint

        <joint name="base_l_wheel_joint" type="continuous">
            <origin xyz="0 ${(motor_length+wheel_length)/2} 0" rpy="0 0 0"/>
            <parent link="left_motor"/>
            <child link="left_wheel_link"/>
            <axis xyz="0 1 0"/>
        </joint>
        <joint name="base_r_wheel_joint" type="continuous">
            <origin xyz="0 -${(motor_length+wheel_length)/2} 0" rpy="0 0 0"/>
            <parent link="right_motor"/>
            <child link="right_wheel_link"/>
            <axis xyz="0 1 0"/>
        </joint>

参考——Joint state with name: “base_l_wheel_joint” was received but not found in URDF

4. The ‘state_publisher‘ executable is deprecated. Please use ‘robot_state_publisher‘ instead

<launch>

    <param name="/use_sim_time" value="false" />

    <!-- 加载机器人URDF/Xacro模型 -->
    <arg name="urdf_file" default="$(find xacro)/xacro --inorder '$(find mrobot_description)/urdf/mrobot_with_rplidar.urdf.xacro'" />

    <param name="robot_description" command="$(arg urdf_file)" />

    <node name="arbotix" pkg="arbotix_python" type="arbotix_driver" output="screen" clear_params="true">
        <rosparam file="$(find mrobot_bringup)/config/fake_mrobot_arbotix.yaml" command="load" />
        <param name="sim" value="true"/>
    </node>

    <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />
    <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher">
        <param name="publish_frequency" type="double" value="20.0" />
    </node>

</launch>

state_publisher 替换为 robot_state_publisher

    <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher">

5. [Err] [REST.cc:205] Error in REST request

运行roslaunch mrobot_gazebo mrobot_laser_nav_gazebo.launch出现以下报错:
[Err] [REST.cc:205] Error in REST request

解决方案
打开编辑~/.ignition/fuel/config.yaml文件

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

首先注释 url : https://api.ignitionfuel.org
然后添加 url: https://api.ignitionrobotics.org

servers:
  -
    name: osrf
    url: https://api.ignitionrobotics.org  
# url: https://api.ignitionfuel.org

参考——运行Gazebo出现[Err] [REST.cc:205] Error in REST reques

6. [ERROR] [1672464181.845772, 354.200000]: Spawn service failed. Exiting.

[INFO] [1672464181.842715, 354.200000]: Spawn status: SpawnModel: Entity pushed to spawn queue, but spawn service timed out waiting for entity to appear in simulation under the name mrobot
[ERROR] [1672464181.845772, 354.200000]: Spawn service failed. Exiting.

解决方案
将launch文件中.world文件里的sim_time值改为0

<sim_time>354 199000000</sim_time>
<sim_time>0</sim_time>

7. Warning: Invalid argument “/map” passed to canTransform argument target_frame in tf2 frame_ids cannot start with a ‘/’ like: at line 134 in /tmp/binarydeb/ros-melodic-tf2-0.6.5/src/buffer_core.cpp

运行roslaunch mrobot_navigation fake_nav_cloister_demo.launch报错

Warning: Invalid argument "/map" passed to canTransform argument target_frame in tf2 frame_ids cannot start with a '/' like:  at line 134 in /tmp/binarydeb/ros-melodic-tf2-0.6.5/src/buffer_core.cpp

解决方案
melodic系统下,将package-name/config文件夹内所有的global_costmap_params.yaml和local_costmap_params.yaml文件里的头几行去掉“/”,返回工作空间根目录下重新编译。

global_costmap:
   global_frame: /map
   robot_base_frame: /base_footprint
   update_frequency: 1.0
   publish_frequency: 0
   static_map: true
   rolling_window: false
   resolution: 0.01
   transform_tolerance: 1.0
   map_type: costmap

改成

global_costmap:
   global_frame: map
   robot_base_frame: base_footprint
   update_frequency: 1.0
   publish_frequency: 0
   static_map: true
   rolling_window: false
   resolution: 0.01
   transform_tolerance: 1.0
   map_type: costmap

参考——Warning: Invalid argument “/map“ passed to canTransform argument target_frame in tf2 frame_ids···

8. [ WARN] [1672468645.200381474, 355.503000000]: Parameter pdist_scale is deprecated. Please use the name path_distance_bias instead.

[ WARN] [1672468645.200381474, 355.503000000]: Parameter pdist_scale is deprecated. Please use the name path_distance_bias instead.
[ WARN] [1672468645.202587182, 355.503000000]: Parameter gdist_scale is deprecated. Please use the name goal_distance_bias instead.

按提示更改参数名称
/home/yuan/catkin_ws/src/mrobot_navigation/config/fake/base_local_planner_params.yaml

   holonomic_robot: false
   yaw_goal_tolerance: 0.1 # about 6 degrees
   xy_goal_tolerance: 0.05  # 5 cm
   latch_xy_goal_tolerance: false
   path_distance_bias: 0.4
   goal_distance_bias: 0.8
   meter_scoring: true

9, [ERROR] [1672470046.193536887, 770.365000000]: Extrapolation Error: Lookup would require extrapolation into the future. Requested time 770.361000000 but the latest data is at time 770.330000000, when looking up transform from frame [odom] to frame [map]

参考——https://www.cnblogs.com/havain/p/11737363.html

  • 15
    点赞
  • 42
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 9
    评论
评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

yuan〇

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值