robot jumps when spawn
when ever robot is spawn into gazebo it jumps there is the video below
https://drive.google.com/file/d/1h_Ku...
edit
<?xml version="1.0"?>
<robot name="mark" xmlns:xacro="http://ros.org/wiki/xacro">
<xacro:property name="pi" value="3.1415926535897931" />
<!-- Includes -->
<xacro:include filename="$(find mark_description)/urdf/mark_base.urdf.xacro"/>
<xacro:include filename="$(find mark_description)/urdf/mark_caster.urdf.xacro"/>
<xacro:include filename="$(find mark_description)/urdf/mark_wheel.urdf.xacro"/>
<!-- Differential Drive Plugin -->
<gazebo>
<plugin name="differential_drive_controller" filename="libgazebo_ros_diff_drive.so">
<alwaysOn>true</alwaysOn>
<updateRate>10.0</updateRate>
<robotBaseFrame>base_link</robotBaseFrame>
<publishWheelTF>true</publishWheelTF>
<publishWheelJointState>true</publishWheelJointState>
<wheelAcceleration>1</wheelAcceleration>
<leftJoint>left_wheel_joint</leftJoint>
<rightJoint>right_wheel_joint</rightJoint>
<wheelSeparation>0.33</wheelSeparation>
<wheelDiameter>0.17</wheelDiameter>
<wheelTorque>20</wheelTorque>
<commandTopic>cmd_vel</commandTopic>
<odometryTopic>odom</odometryTopic>
<odometryFrame>odom</odometryFrame>
</plugin>
</gazebo>
<!-- Base -->
<xacro:mark_base prefix="base"/>
<!-- Left Wheel -->
<xacro:mark_wheel prefix="left_wheel"
joint_x="-0.099185"
joint_y="0.23646"
joint_z="-0.059645"
joint_roll="0.0"
joint_pitch="0.0"
joint_yaw="0.0"
r="-1.57075"
parent_link="base_link" />
<!-- Right Wheel -->
<xacro:mark_wheel prefix="right_wheel"
joint_x="-0.099185"
joint_y="-0.23646"
joint_z="-0.059645"
joint_roll="0.0"
joint_pitch="0.0"
joint_yaw="0.0"
r="1.57075"
parent_link="base_link" />
<!-- Caster -->
<xacro:mark_caster prefix="front_caster"
x="0.2347"
y="0.0"
z="-0.083329"
roll="0.0"
pitch="0.0"
yaw="0.0"
parent_link="base_link" />
</robot>
caster wheel xacro
<?xml version="1.0"?>
<robot xmlns:xacro="http://ros.org/wiki/xacro">
<xacro:macro name="mark_caster" params="prefix x y z roll pitch yaw parent_link">
<link name="${prefix}_base_link">
<inertial>
<mass value="0.01" />
<origin xyz="0 0 0" />
<inertia ixx="1e-6" ixy="0.0" ixz="0.0" iyy="1e-6" iyz="0.0" izz="1e-6" />
</inertial>
<visual>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<mesh filename="package://mark_description/mesh/caster/un.dae"/>
</geometry>
<material name="Grey"/>
</visual>
<collision>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<mesh filename="package://mark_description/mesh/caster/un.dae"/>
</geometry>
</collision>
</link>
<gazebo reference="${prefix}_base_link">
<material>Gazebo/Grey</material>
<mu1>0.0</mu1>
<mu2>0.0</mu2>
<kp>1000000.0</kp>
<kd>100.0</kd>
<minDepth>0.001</minDepth>
<maxVel>1.0</maxVel>
</gazebo>
<joint name="${prefix}_base_joint" type="fixed">
<parent link="${parent_link}"/>
<child link="${prefix}_base_link"/>
<origin rpy="${roll} ${pitch} ${yaw}" xyz="${x} ${y} ${z}"/>
<axis xyz="0 0 0"/>
</joint>
<link name="${prefix}_rotate_link">
<inertial>
<mass value="0.01" />
<origin xyz="0 0 0" />
<inertia ixx="1e-6" ixy="0.0" ixz="0.0" iyy="1e-6" iyz="0.0" izz="1e-6" />
</inertial>
<visual>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<mesh filename="package://mark_description/mesh/caster/caster_rot.stl"/>
</geometry>
<material name="Grey"/>
</visual>
<collision>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<mesh filename="package://mark_description/mesh/caster/caster_rot ...
Not 100% sure this would work, but have you tried setting the inertia values ixx, iyy, and izz to a non-zero value for the links
caster_rotate_link
andcaster_base_link
?Yes I tried same thing happens
Like @abhishek47kashyap said, the inertias should probably be non-zero. In addition, I've seen this kind of behavior when there's overlapping geometry (inherent collisions). Such situations can cause the solver to "explode" the model. Since you're using meshes, I can't tell if there is a collision, so you'll have to do a close inspection of the model before starting the simulation. Remember that
visual
andcollision
elements aren't necessarily the same.On a side note, the inconsistent formatting of your URDF makes it difficult to read. Others may be more encouraged to answer if the information you provide is easier to assimilate :).
@tryan If you want I can send you my urdf file it will be a huge help
What does inherent collision means
If you have extra info, please edit your post to add/link it.
I just mean that the robot may be defined in such a way that parts of it collide with each other. For example, if a wheel happens to be placed such that it intersects part of the chassis.