Model on RViz / Gazebo with wrong orientation and incorrect links' position! How to fix?
Hi, everyone!
I’m newbie at ROS, URDF, Rviz, Gazebo... I’m learning about these topics for research. Running Ubuntu 18.04, ROS Melodic Morenia, RViz version 1.13.7 and Gazebo 9.12. I’ve build a model on SolidWorks 2018 and used the sw2urdf plugin to create a urdf file and export the meshes .STL from assembly. Now I can spawn the model on Rviz and Gazebo, but the model appears with a wrong orientation and some links in a different position from the original assembly. I’ve tested some changes in the URDF file, but without success. I’ve tried to use the joint control on Rviz, but the GUI doesn’t appear. How can I fix the wrong position links and orientation from the model? How can I use the joint control GUI?
My URDF file and display.launch
<?xml version="1.0"?>
<!-- This URDF was automatically created by SolidWorks to URDF Exporter! Originally created by Stephen Brawner (brawner@gmail.com)
Commit Version: 1.5.1-0-g916b5db Build Version: 1.5.7152.31018
For more information, please see http://wiki.ros.org/sw_urdf_exporter -->
<robot
name="roboturdf_4">
<link
name="base_link">
<inertial>
<origin
xyz="0.020092 0.30138 -0.0034671"
rpy="0 0 0" />
<mass
value="29.722" />
<inertia
ixx="0.65036"
ixy="1.6601E-16"
ixz="6.6492E-17"
iyy="0.31967"
iyz="2.902E-06"
izz="0.77965" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://roboturdf_4/meshes/base_link.STL" />
</geometry>
<material
name="">
<color
rgba="0.79216 0.81961 0.93333 1" />
</material>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://roboturdf_4/meshes/base_link.STL" />
</geometry>
</collision>
</link>
<link
name="pr_link">
<inertial>
<origin
xyz="0.081627 -0.17409 0.10967"
rpy="0 0 0" />
<mass
value="4.7937" />
<inertia
ixx="0.06966"
ixy="3.3077E-07"
ixz="-2.0109E-07"
iyy="0.025789"
iyz="0.027949"
izz="0.052279" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://roboturdf_4/meshes/pr_link.STL" />
</geometry>
<material
name="">
<color
rgba="0.79216 0.81961 0.93333 1" />
</material>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://roboturdf_4/meshes/pr_link.STL" />
</geometry>
</collision>
</link>
<joint
name="pr_joint"
type="revolute">
<origin
xyz="-0.17192 0 0"
rpy="0 0 0" />
<parent
link="base_link" />
<child
link="pr_link" />
<axis
xyz="-1 0 0" />
<limit
lower="0"
upper="0"
effort="0"
velocity="0" />
</joint>
<link
name="kr_link">
<inertial>
<origin
xyz="0.079413 -0.23691 -0.055825"
rpy="0 0 0" />
<mass
value="4.1185" />
<inertia
ixx="0.07898"
ixy="-1.132E-17"
ixz="-2.5386E-18"
iyy="0.0084476"
iyz="-0.016566"
izz="0.074995" /> ...