Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0"?>
- <robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="evt1">
- <xacro:macro name="origin_base">
- <origin rpy="0.0 0.0 0.0" xyz="0 0 0"/>
- </xacro:macro>
- <xacro:property name="kd" value="10000000.0" />
- <xacro:property name="kp" value="00.0"/>
- <!-- WHEELS MACRO -->
- <xacro:macro name="wheel" params="rpy xyz name">
- <xacro:macro name="origin_wheel">
- <origin rpy="${rpy}" xyz="${xyz}"/>
- </xacro:macro>
- <link name="wheel_${name}_link">
- <inertial>
- <xacro:origin_base />
- <mass value="${wheel_mass}" />
- <inertia ixx="0.0016" ixy="0" ixz="0" iyy="0.0016" iyz="0" izz="0.003" /><!-- Good value of inertia -->
- <!--<inertia ixx="1" ixy="0" ixz="0" iyy="1" iyz="0" izz="1" />-->
- </inertial>
- <collision>
- <xacro:origin_base />
- <geometry>
- <cylinder radius="${wheel_radius}" length="${wheel_length}"/>
- </geometry>
- </collision>
- <visual>
- <xacro:origin_base />
- <geometry>
- <cylinder radius="${wheel_radius}" length="${wheel_length}"/>
- </geometry>
- <material name="green"/>
- </visual>
- </link>
- <joint name="wheel_${name}_joint" type="continuous">
- <parent link="wheel_axe"/>
- <child link="wheel_${name}_link"/>
- <xacro:origin_wheel />
- <limit effort="2000" velocity="200.0" />
- <axis xyz="0 0 1"/>
- </joint>
- <gazebo reference="wheel_${name}_link">
- <mu1 value="30.5"/>
- <mu2 value="2.5"/>
- <kp value="${kd}" />
- <kd value="${kp}" />
- </gazebo>
- <!-- transmission -->
- <transmission name="wheel_${name}_transmission">
- <type>transmission_interface/SimpleTransmission</type>
- <joint name="wheel_${name}_joint">
- <hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface>
- </joint>
- <actuator name="wheel_${name}_motor">
- <hardwareInterface>VelocityJointInterface</hardwareInterface>
- <mechanicalReduction>1</mechanicalReduction>
- </actuator>
- </transmission>
- </xacro:macro>
- <!-- CASTER WHEELS MACRO -->
- <xacro:macro name="caster_wheel" params="rpy xyz name">
- <xacro:macro name="caster_origin_wheel">
- <origin rpy="${rpy}" xyz="${xyz}"/>
- </xacro:macro>
- <link name="caster_wheel_${name}_link">
- <inertial>
- <xacro:origin_base />
- <mass value="${caster_wheel_mass}" />
- <inertia ixx="1.40041666667e-05" ixy="0" ixz="0" iyy="1.40041666667e-05" iyz="0" izz="2.56e-05" />
- </inertial>
- <collision>
- <xacro:origin_base />
- <geometry>
- <cylinder radius="${caster_wheel_radius}" length="${caster_wheel_length}"/>
- </geometry>
- </collision>
- <visual>
- <xacro:origin_base />
- <geometry>
- <cylinder radius="${caster_wheel_radius}" length="${caster_wheel_length}"/>
- </geometry>
- <material name="green"/>
- </visual>
- </link>
- <link name="caster_${name}_attach_link">
- <visual>
- <xacro:origin_base />
- <geometry>
- <cylinder radius="0.005" length="0.05"/>
- </geometry>
- <material name="green"/>
- </visual>
- <inertial>
- <xacro:origin_base />
- <mass value="${caster_wheel_mass}" />
- <inertia ixx="1.40041666667e-05" ixy="0" ixz="0" iyy="1.40041666667e-05" iyz="0" izz="2.56e-05" />
- </inertial>
- </link>
- <joint name="caster_wheel_${name}_joint_y" type="continuous">
- <parent link="base_footprint"/>
- <child link="caster_${name}_attach_link"/>
- <xacro:caster_origin_wheel />
- <!--<limit lower="-0.2" upper="0.2" effort="100" velocity="100"/>-->
- <axis xyz="0 1 0"/>
- <dynamics friction="0.03"/>
- </joint>
- <joint name="caster_wheel_${name}_joint" type="continuous">
- <parent link="caster_${name}_attach_link"/>
- <child link="caster_wheel_${name}_link"/>
- <axis xyz="0 0 1"/>
- <dynamics friction="0.03"/>
- <origin xyz="0 0 0" rpy="0 0 0" />
- </joint>
- <gazebo reference="caster_wheel_${name}_link">
- <mu1>1.5</mu1>
- <mu2>1.5</mu2>
- <kp>5000000.0</kp>
- <kd>10.0</kd>
- <minDepth>0.001</minDepth>
- <maxVel>0.1</maxVel>
- <fdir1>1 0 0</fdir1>
- <dynamics friction="0.05" />
- <material>Gazebo/FlatGreen</material>
- </gazebo>
- </xacro:macro>
- <xacro:macro name="sphere_" params="name xyz">
- <xacro:macro name="origin_sphere">
- <origin rpy="0 0 0" xyz="${xyz}"/>
- </xacro:macro>
- <link name="sphere_link_${name}">
- <inertial>
- <xacro:origin_base/>
- <mass value="${boule_mass}"/>
- <inertia ixx="0.0002835" ixy="0.0" ixz="0.0" iyy="0.0002835" iyz="0.0" izz="0.000324"/>
- </inertial>
- <collision>
- <xacro:origin_base />
- <geometry>
- <sphere radius="${boule_size}"/>
- </geometry>
- </collision>
- <visual>
- <xacro:origin_base />
- <geometry>
- <sphere radius="${boule_size}"/>
- </geometry>
- <material name="blue"/>
- </visual>
- </link>
- <gazebo reference="sphere_link_${name}">
- <kp>10e20</kp>
- <kd>1.0</kd>
- <mu1>0.2</mu1>
- <mu2>0.1</mu2>
- <maxContacts>1</maxContacts>
- <maxVel>0.0</maxVel>
- <min_depth>0.001</min_depth>
- </gazebo>
- <xacro:macro name="junta_model" params="name parent child">
- <joint name="${name}_joint_y" type="continuous">
- <xacro:origin_sphere />
- <parent link="${parent}"/>
- <child link="${name}_junta1"/>
- <axis xyz="0 1 0" />
- <dynamics friction="0.06"/> <!--Ajout de friction pour pas que ca tourne a l'infini -->
- </joint>
- <link name="${name}_junta1">
- <inertial>
- <mass value="0.025" />
- <inertia ixx="5.8083e-4" ixy="0" ixz="0" iyy="3.0833e-5" iyz="0" izz="5.9083e-4" />
- </inertial>
- </link>
- <joint name="${name}_joint_z" type="continuous">
- <parent link="${name}_junta1"/>
- <child link="${name}_junta2"/>
- <axis xyz="0 0 1" />
- <dynamics friction="0.06"/>
- </joint>
- <link name="${name}_junta2">
- <inertial>
- <mass value="0.025" />
- <inertia ixx="5.8083e-4" ixy="0" ixz="0" iyy="3.0833e-5" iyz="0" izz="5.9083e-4" />
- </inertial>
- </link>
- <joint name="${name}_joint_x" type="continuous">
- <parent link="${name}_junta2"/>
- <child link="${name}_junta3"/>
- <axis xyz="1 0 0" />
- <dynamics friction="0.06"/>
- </joint>
- <link name="${name}_junta3">
- <inertial>
- <mass value="0.025" />
- <inertia ixx="5.8083e-4" ixy="0" ixz="0" iyy="3.0833e-5" iyz="0" izz="5.9083e-4" />
- </inertial>
- </link>
- <joint name="${name}_jointfixed" type="fixed">
- <parent link="${name}_junta3"/>
- <child link="${child}"/>
- </joint>
- </xacro:macro>
- <xacro:junta_model name="sphere_${name}" parent="base_link" child="sphere_link_${name}"/>
- </xacro:macro>
- <xacro:macro name="caster_sans_contact" params="name xyz">
- <!--Caster back -->
- <link name="caster_${name}_link">
- <visual>
- <origin rpy="1.57079632679 0 0" xyz="0.0 0.0 0 "/>
- <geometry>
- <sphere radius="${radius_caster}"/>
- </geometry>
- <material name="Black"/>
- </visual>
- <collision>
- <geometry>
- <sphere radius="${radius_caster}"/>
- </geometry>
- <origin rpy="1.57079632679 0 0" xyz="0 0.0 0 "/>
- </collision>
- <inertial>
- <mass value="${caster_mass}"/>
- <origin xyz="0 0 0"/>
- <inertia ixx="0.00048" ixy="0.0" ixz="0.0" iyy="0.00048" iyz="0.0" izz="0.00048"/>
- </inertial>
- </link>
- <joint name="caster_${name}_joint" type="fixed">
- <parent link="base_footprint"/>
- <child link="caster_${name}_link"/>
- <origin rpy="-1.57079632679 0 0" xyz="${xyz}"/>
- </joint>
- <gazebo reference="caster_${name}_link">
- <turnGravityOff>false</turnGravityOff>
- <mu>0.0</mu>
- <mu2>0.0</mu2>
- <kp value="${kd}" />
- <kd value="${kp}" />
- </gazebo>
- </xacro:macro>
- <!---->
- </robot>
Add Comment
Please, Sign In to add comment