各位大家好,在用ROS仿真的时候遇到一个问题,希望指点,提前谢谢啦!
问题如下,我写好了一个urdf文件的简单模型,用来模拟立柱升降,rviz和gazebo的结果:
代码如下:
<?xml version="1.0"?>
<robot name = "column">
<link name = "world"/>
<joint name = "fixed" type = "fixed">
<parent link = "world"/>
<child link = "base_link"/>
</joint>
<link name = "base_link">
<visual>
<origin xyz = "0 0 0.08" rpy = "0 0 0"/>
<geometry>
<box size = "0.5 0.3 0.16"/>
</geometry>
<material name = "silver">
<color rgba = "0.75 0.75 0.75 1"/>
</material>
</visual>
<collision>
<origin xyz = "0 0 0.08" rpy = "0 0 0"/>
<geometry>
<box size = "0.5 0.3 0.16"/>
</geometry>
</collision>
<inertial>
<mass value = "0.5"/>
<inertia ixx = "0.02" iyy = "0.06" izz = "0.04" ixy = "0" ixz = "0" iyz = "0"/>
</inertial>
</link>
<joint name = "joint0" type = "fixed">
<origin xyz = "0 0 0.16" rpy = "0 0 0"/>
<parent link = "base_link"/>
<child link = "column1"/>
</joint>
<link name = "column1">
<visual>
<origin xyz = "0 0 0.28" rpy = "0 0 0"/>
<geometry>
<box size = "0.2 0.1 0.56"/>
</geometry>
<material name = "silver">
<color rgba = "0.75 0.75 0.75 1"/>
</material>
</visual>
<collision>
<origin xyz = "0 0 0.28" rpy = "0 0 0"/>
<geometry>
<box size = "0.2 0.1 0.56"/>
</geometry>
</collision>
<inertial>
<mass value = "1"/>
<inertia ixx = "1" iyy = "1" izz = "1" ixy = "0" ixz = "0" iyz = "0"/>
</inertial>
</link>
启动的launch文件如下:
rviz
<launch>
<param name = "robot_description" textfile = "$(find column_pkg)/urdf/column.urdf"/>
<node name = "joint_state_publisher_gui" pkg = "joint_state_publisher_gui" type = "joint_state_publisher_gui"/>
<node name = "robot_state_publisher" pkg = "robot_state_publisher" type = "robot_state_publisher"/>
</launch>
gazebo
<launch>
<param name = "robot_description" textfile = "$(find column_pkg)/urdf/column.urdf"/>
<include file = "$(find gazebo_ros)/launch/empty_world.launch"/>
<node name ="spawn_urdf" pkg = "gazebo_ros" type = "spawn_model" args = "-param robot_description -urdf -model column"/>
</launch>
然而在rviz和gazebo中出现的初始模型不一样,这个问题怎么解决?
操作环境:ubuntu20.4 ros noetic
尝试过修改limit词条,无效