gazebo仿真中遇到的坑

2023-05-16

1.urdf中的关节无法加载到gazebo

[error]:This robot has a joint named “joint_1” which is not in the gazebo model.

原因:urdf的link标签下的惯性设置问题

已解决,参考:https://answers.ros.org/question/238899/this-robot-has-a-joint-named-joint_1-which-is-not-in-the-gazebo-model/


2.urdf的标签缺少hardware_interface/

[ WARN] [1592977254.131172803, 0.157000000]: Deprecated syntax, please prepend ‘hardware_interface/’ to ‘PositionJointInterface’ within the tag in joint ‘shoulder_pan_joint’.

已解决。
提示已经很明显了,把下面的标签

<hardwareInterface>PositionJointInterface</hardwareInterface>

换成这个:

<hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>

3.没有指定pid

No p gain specified for pid

已解决,参考:
1.https://answers.ros.org/question/293830/what-is-the-fix-for-no-p-gain-specified-for-pid-namespace-gazebo_ros_controlpid_gainsback_right_wheel_joint-ros-melodic/

2.http://www.dtmao.cc/news_show_494301.shtml

3.https://www.pianshen.com/article/44461332312/

虽然3个都差不多但还是建议都打开看看


4.urdf文件和python编码冲突导致无法加载参数服务器

UnicodeEncodeError: ‘ascii’ codec can’t encode characters in position 0-1: ordinal not in range

在这里插入图片描述urdf采用UTF-8的编码方式,而python默认采用ascll码

已解决

参考(一个是原因,一个是解决办法):
https://www.cnblogs.com/excellentlhw/p/10916953.html
https://blog.csdn.net/weixin_39221360/article/details/79525341
解决方法有三种:

  1.在命令行修改,仅本会话有效:
     1)通过>>>sys.getdefaultencoding()查看当前编码(若报错,先执行>>>import sys >>>reload(sys));
     2)通过>>>sys.setdefaultencoding('utf8')设置编码

  2.较繁琐,最有效
     1)在程序文件中以下三句
          import sys
          reload(sys)
          sys.setdefaultencoding('utf8')
  
  3.修改Python本环境(推荐)
     在Python的Lib\site-packages文件夹下新建一个sitecustomize.py文件,内容为:
         #coding=utf8
         import sys
         reload(sys)
         sys.setdefaultencoding('utf8')

  重启Python解释器,发现编码已被设置为utf8,与方案二同效;这是因为系统在Python启动的时候,
  自行调用该文件,设置系统的默认编码,而不需要每次都手动加上解决代码,属于一劳永逸的解决方法。

亲测第三种有效,附上寻找python安装目录下的Python的Lib\site-packages目录的方法:
方法一:

$ echo $PYTHONPATH

方法二:

$ python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"

我是在方法一的安装地址中创建sitecustomize.py成功修改了python的编码方式,在方法二的地址中创建则没有成功。

参考:https://blog.csdn.net/leafrenchleaf/article/details/84013529


5.base_link之inertia问题

[ WARN] : The root link base_link has an inertia specified in the URDF, but KDL does not support a root link with an inertia. As a workaround, you can add an extra dummy link to your URDF.

在这里插入图片描述
参考如下

<link name="base_link">
    <visual>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://minibot_description/meshes/mb_4wheels/base_link.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="0 0.50196 1 1" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://minibot_description/meshes/mb_4wheels/base_link.STL" />
      </geometry>
    </collision>
  </link>

  <joint name="inertial_joint" type="fixed">
    <parent link="base_link"/>
    <child link="main_mass"/>
    <origin xyz="0 0 0 " rpy="0 0 0"/>
  </joint>
  
  <link name="main_mass" type="fixed">
    <inertial>
      <origin
        xyz="-0.00063415 0.00050377 0.011118"
        rpy="0 0 0" />
      <mass
        value="2.9032" />
      <inertia
        ixx="0.005"
        ixy="0.001"
        ixz="0.005"
        iyy="0.001"
        iyz="0.001"
        izz="0.005"
         />
    </inertial>
  </link>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

gazebo仿真中遇到的坑 的相关文章

随机推荐

  • STM32F1 定时器 PWM输入捕获两路

    IO u32 TIM4CH3 CAPTURE UPVAL 61 0 通道3捕获到高电平的时刻 IO u32 TIM4CH3 CAPTURE DOWNVAL 61 0 通道3捕获到低电平的时刻 IO u32 TIM4CH4 CAPTURE U
  • openwrt 使用uci更改ip

    以lan口举例 xff1a 设置lan口ip uci set network lan ipaddr 61 192 168 0 251 提交 uci commit network 重启网络 etc init d network restart
  • STM32F103 USART1串口重映射功能的实现

    STM32F103 USART1串口重映射实现方法代码 转载请注明出处 xff1a https blog csdn net qq 43400642 article details 84838405 我们知道 xff0c F103的usart
  • FreeRTOS api库函数之Message Buffers(消息缓冲区)

    xMessageBufferCreate xff08 xff09 MessageBufferHandle t xMessageBufferCreate xff08 size t xBufferSizeBytes xff09 使用动态分配的内
  • C/C++经典程序之打印三角形

    等腰直角三角形 xff08 直角边在左下 xff09 include lt stdio h gt int main int i j int line printf 34 请输入行数 xff1a 34 scanf 34 d 34 amp li
  • STM32F4 DMA

    STM32F4有2个DMA xff0c 每个DMA控制器有8个数据流 xff0c 每个数据流有多达8个通道 xff0c 但是DMA1 控制器 AHB 外设端口与 DMA2 控制器的情况不同 xff0c 不连接到总线矩阵 xff0c 因此 x
  • STM32粗略延时,大致精确

    考虑到一些情况下 xff0c 无法使用系统定时或者定时器 xff0c 而进行的时间计算 STM32F1系列 xff0c 对于72Mhz来说 void my delay ms u32 ms 对于stm32f1系列 72mhz大致是1ms u1
  • linux下的串口配置

    经过验证是准确无误的 xff0c 配置以后可以通过以下指令查看 stty F dev ttyUSB0 a 查看 dev ttyUSB0的串口配置 stty F dev ttyUSB0 ispeed 115200 ospeed 115200
  • Leetcode 42 接雨水

    Leetcode42接雨水 题解1 xff1a 正反两扫 xff08 Simple and effect xff09 题解2 xff1a DP题解3 xff1a 单调栈 xff08 单调栈存储的是下标 xff0c 满足从栈底到栈顶的下标对应
  • 错误 Command “python setup.py egg_info“ failed with error code 1 in /tmp/pip-build*

    安装Roboware Studio后 xff0c 为了支持Python调试功能 xff0c 需要先安装pylint 使用sudo python m pip install pylint命令产生报错 xff1a Command python
  • imu可视化和frame_id的查询

    得到imu的frame id rostopic echo topic grep frame id 得到imu的可视化 xff1a 下载源代码 xff1a 链接 https github com ccny ros pkg imu tools
  • catkin_make 与cmake

    http blog csdn net zyh821351004 article details 50388429 1 catkin make 与cmake的关系 程序在cmake编译的流程 xff1a cmake指令依据你的CMakeLis
  • 报错:ResourceNotFound: gazebo_ros

    Traceback most recent call last File 34 opt ros kinetic lib python2 7 dist packages roslaunch init py 34 line 306 in mai
  • ROS中的ROS_MASTER_URI环境变量解析

    ROS MASTER URI 61 http localhost 11311中的ROS MASTER URI是什么呢 xff1f URI是什么呢 xff1f 查阅百度百科可知 xff1a URI xff08 Uniform Resource
  • win10 cmd窗口中文乱码,永久解决方法(编码格式设置为UTF-8)

    转 xff1a https blog csdn net tfs411082561 article details 78416569 commentBox 1 临时修改 xff0c 只作用于当前打开的窗口 进入cmd窗口后 xff0c 直接执
  • C#获取文本框的任意行内容

    C 中 textbox Lines Length 可以获得文本框里文本的行数 xff1b 而textbox Lines i 代表文本框任意一行的内容 xff0c 所以获取文本框最后一行的方法为 xff1a span class token
  • add-apt-repository命令详解

    该命令是通过PPA源方式安装软件的添加PPA源到Source list中的命令 xff0c 该软件安装方式的流程为 xff1a 1 搜索PPA软件源 xff0c 如在Google上软件名称关键字 43 PPA xff0c 或者也可直接到 l
  • sw2urdf插件安装提示

    sw2urdf 1 6版本安装在solid works2012 2014 2016 2017 2020上会闪退 xff08 亲测 xff09 sw2urdf 1 5版本安装在solid works2017 2020上可以正常运行 xff08
  • ROS多机通信

    假设需要让电脑biowin和电脑biowin G3实现连接 xff0c 并以biowin G3为主机 1 让所有计算机需要通信处于同一网络 2 将局域网地址绑定到主机名上 所有需要通信的电脑在 etc hosts文件中 xff0c 添加需要
  • gazebo仿真中遇到的坑

    1 urdf中的关节无法加载到gazebo error This robot has a joint named joint 1 which is not in the gazebo model 原因 xff1a urdf的link标签下的