We are using the existing model of the robot to simulate, this section we will build a simple intelligent vehicle robot SmartCar, for the back to build a complex robot to lay the foundation.
First, create a hardware description package
Roscreat-pkg smartcar_description URDF
Second, the Smart car size data
Because the building is a very simple robot, so we try to use simple elements: the use of cuboid instead of car models, the use of cylinders to replace the wheel, the specific dimensions are as follows:
Iii. Establishment of URDF documents
Create a URDF folder under the Smartcar_description folder, creating a description file Smartcar.urdf for the Smart car, describing the code as follows:
<?xml version= "1.0"?> <robot name= "SmartCar" > <link name= "Base_link" > <visual> <geometry> <box size= 0.25/> </geometry> <origin rpy= "0 0 1.57075" x
yz= "0 0 0"/> <material name= "Blue" > <color rgba= "0 0 8 1"/> </material> </visual> </link> <link name= "Right_front_wheel" > <visual> <geometry > <cylinder length= "radius=" 0.025 "/> </geometry> <material name=" BLACK "&G
T <color rgba= "0 0 0 1"/> </material> </visual> </link> <joint name=
"Right_front_wheel_joint" type= "continuous" > <axis xyz= "0 0 1"/> <parent link= "Base_link"/> <child link= "Right_front_wheel"/> <origin rpy= "0 1.57075 0" xyz= "0.08 0.1-0.03"/> EF fort= "100"Velocity= "/>" <joint_properties damping= "0.0" friction= "0.0"/> </joint> <link na Me= "Right_back_wheel" > <visual> <geometry> <cylinder length= "." Radius= "0.025" /> </geometry> <material name= "Black" > <color rgba= "0 0 0 1"/> < /material> </visual> </link> <joint name= "Right_back_wheel_joint" type= "continuous"
> <axis xyz= "0 0 1"/> <parent link= "Base_link"/> <child-link= "Right_back_wheel"/> <origin rpy= "0 1.57075 0" xyz= "0.08-0.1-0.03"/> <limit "effort=" velocity= "/>" Int_properties damping= "0.0" friction= "0.0"/> </joint> <link name= "Left_front_wheel" > &L
t;visual> <geometry> <cylinder length= "." radius= "0.025"/> </geometry> <material name="Black" > <color rgba= "0 0 0 1"/> </material> </visual> </link> <joint name= "Left_front_wheel_joint" type= "continuous" > <axis xyz= "0 0 1"/> <parent link = "Base_link"/> <child link= "Left_front_wheel"/> <origin rpy= "0 1.57075 0" xyz= " -0.08 0.1-0.03"/&G
T
<limit effort= "velocity="/> <joint_properties damping= "0.0" friction= "0.0"/> </joint> <link name= "Left_back_wheel" > <visual> <geometry> <cylinder lengt H= "radius=" 0.025 "/> </geometry> <material name=" Black "> <color rgba=" 0 0 0 1 "/> </material> </visual> </link> <joint name=" Left_back_wheel_joi NT "type=" continuous "> <axis xyz=" 0 0 1 "/> <parent link=" Base_link "/> <child link=" lef T_back_wheel "/&Gt <origin rpy= "0 1.57075 0" xyz= " -0.08-0.1-0.03"/> <limit "effort=" velocity= "/>"
Properties damping= "0.0" friction= "0.0"/> </joint> <link name= "Head" > <visual> <geometry> <box size= "/> </geometry> <material name=" whi
TE "> <color rgba=" 1 1 1 1 "/> </material> </visual> </link>
<joint name= "Tobox" type= "fixed" > <parent link= "base_link"/> <child link= "Head"/> <origin xyz= "0 0.08 0.025"/> </joint> </robot>